Performing Operations on Events
Function
This API is used to perform operations on events, such as authorizing immediate execution, canceling execution, or authorizing scheduled execution. Before calling this API:
- Learn how to authenticate it.
- Obtain the required region and endpoint.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependency
gaussdbformysql:event:operateScheduleEvents
Permission_management
-
-
gaussdb:event:operateScheduleEvents
-
URI
POST /v3/{project_id}/schedule-events
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value contains 32 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. To obtain this value, call the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the token value. Constraints N/A Range N/A Default Value N/A |
| X-Language | No | String | Definition Request language type. Constraints N/A Range Default Value en-us |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| operation_type | Yes | String | Definition Event operation type. Constraints N/A Range Default Value N/A |
| event_instances | Yes | Array of EventInstances objects | Definition Event information. Constraints A maximum of 20 events are allowed in a batch. |
| event_schedule_window | No | Object | Definition Event execution window. Constraints This parameter is mandatory when operation_type is set to reservation. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| event_id | Yes | String | Definition Event ID. To obtain this value, see Obtaining the Event List. Constraints N/A Range The value contains 36 characters, starting with a UUID and ending with ev07. Only letters and digits are allowed. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| planned_day | Yes | String | Definition Execution date. Constraints The value is in yyyy-mm-dd format. Range The value must be later than or equal to the current date. Default Value N/A |
| start_time | No | String | Definition Start time of the event execution window. Constraints The value is in hh:mm format. This parameter is mandatory when end_time is specified. Range N/A Default Value 01:00 |
| end_time | No | String | Definition End time of the event execution window. Constraints The value is in hh:mm format. This parameter is mandatory when start_time is specified. Range N/A Default Value 03:00 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| results | Array of EventJobResult objects | Definition Response result of setting the event execution policy. |
| Parameter | Type | Description |
|---|---|---|
| event_id | String | Definition Event ID. Range The value contains 36 characters, starting with a UUID and ending with ev07. Only letters and digits are allowed. |
| instance_id | String | Definition Instance ID. Range The value contains 36 characters, starting with a UUID and ending with in07. Only letters and digits are allowed. |
| job_id | String | Definition ID of the event operation task. Range N/A |
| success | Boolean | Definition Whether the task is successfully delivered. Range |
| error_code | String | Definition Error code. Range N/A |
| error_msg | String | Definition Error message. Range N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Request
-
POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/schedule-events { "operation_type" : "execute", "event_instances" : [ { "event_id" : "18855d0aa0c14685998e727a70d2760cev07" } ] } -
POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/schedule-events { "operation_type" : "cancel", "event_instances" : [ { "event_id" : "18855d0aa0c14685998e727a70d2760cev07" } ] } -
POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/schedule-events { "operation_type" : "reservation", "event_instances" : [ { "event_id" : "18855d0aa0c14685998e727a70d2760cev07" } ], "event_schedule_window" : { "planned_day" : "2025-12-17", "start_time" : "01:00", "end_time" : "02:00" } }
Example Response
Status code: 200
Success.
{
"results" : [ {
"event_id" : "18855d0aa0c14685998e727a70d2760cev07",
"instance_id" : "5437da4b09c9450d9a4b87432bbf1336in07",
"job_id" : "2f092208-43b4-467f-b317-11001e5667ea",
"success" : true,
"error_code" : null,
"error_msg" : null
} ]
} Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot