You can call this operation to schedule simulated system events for one or more ECS instances. The simulated system events do not actually occur or affect ECS instances.
Description
You can use the ECS console, call the DescribeInstanceHistoryEvents operation, or use Cloud Monitor to view the scheduled simulated system events.
The following section describes the lifecycle of a simulated system event:
- Scheduled: The status of the simulated system event is automatically changed to Scheduled after it is scheduled.
- Executed: The status of the simulated system event is automatically changed to Executed at the scheduled time specified by the NotBefore parameter if no manual intervention is involved.
- Canceled: The status of the simulated system event is changed to Canceled if you cancel the event by calling the CancelSimulatedSystemEvents operation.
- Avoided: The status of the simulated system event generated from maintenance-triggered instance restart can be changed to Avoided if you restart the instance before the scheduled time of the simulated system event. The maintenance-triggered instance restart is indicated by the SystemMaintenance.Reboot value. For more information, see RebootInstance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateSimulatedSystemEvents |
The operation that you want to perform. Set the value to CreateSimulatedSystemEvents. |
EventType | String | Yes | SystemMaintenance.Reboot |
The type of the system event. Valid values:
|
InstanceId.N | RepeatList | Yes | i-bp1gtjxuuvwj17zr**** |
The ID of instance N. Valid values of N: 1 to 100. Specify multiple values in the repeated list format. |
NotBefore | String | Yes | 2018-12-01T06:32:31Z |
The start time of the scheduled event execution. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note For a system event that is created due to a system or instance failure, the system
event enters the
Executing state after it is created. In this case, the value of the NotBefore parameter is the time when the event enters the Executed state.
|
RegionId | String | Yes | cn-hangzhou |
The region ID of the system event. You can call the DescribeRegions operation to query the most recent region list. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
EventIdSet | List | " EventId " : [ " e-bp16helosl7v0ooj**** " ] |
The list of simulated event IDs. |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=CreateSimulatedSystemEvents
&EventType=SystemMaintenance.Reboot
&InstanceId.1=i-bp1gtjxuuvwj17zr****
&NotBefore=2018-12-01T06:32:31Z
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<CreateSimulatedSystemEventsResponse>
<EventIdSet>
<EventId>e-bp191hqye34x****</EventId>
<EventId>e-bp191hqye34y****</EventId>
</EventIdSet>
<RequestId>E69EF3CC-94CD-42E7-8926-F133B86387C0</RequestId>
</CreateSimulatedSystemEventsResponse>
JSON
format
{
"EventIdSet":{
"EventId":[
"e-bp191hqye34x****",
"e-bp191hqye34y****"
]
},
"RequestId":"679E9056-9B75-4306-8A72-A1DF93EBEF74"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | MissingParameter | %s | The error message returned because a required parameter is not specified. |
403 | InvalidParameter | %s | The error message returned because a specified parameter is invalid. |
403 | InvalidNotBefore.Passed | %s | The error message returned because the specified value of the NotBefore parameter is earlier than the current time. |
404 | InvalidInstanceId.NotFound | %s | The error message returned because the specified instance does not exist. |
403 | SimulatedEventLimitExceeded | %s | The error message returned because the maximum number of simulated system events has been reached. |
403 | InstanceIdLimitExceeded | %s | The error message returned because the value set for N in the InstanceId.N parameter is more than 100. |
For a list of error codes, visit the API Error Center.