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, ECS API, or Cloud Monitor to view the scheduled simulated system events.

The following section describes the lifecycle of a simulated system event:

  • Scheduled: The status for the simulated system event is automatically changed to Scheduled after it is scheduled.
  • Executed: The status for 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 for the simulated system event is changed to Canceled if you cancel the event by calling CancelSimulatedSystemEvents.
  • Avoided: The status for the simulated system event of 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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • SystemMaintenance.Reboot: The instance is restarted due to system maintenance.
  • SystemFailure.Reboot: The instance is restarted due to a system failure.
  • InstanceFailure.Reboot: The instance is restarted due to an instance failure.
InstanceId.N RepeatList Yes i-instance1

The ID of ECS instance N. Valid values of N: 1 to 100. Specify multiple values in the repeated list form.

NotBefore String Yes 2018-12-01T06:32:31Z

The start time of the scheduled event execution period. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

RegionId String Yes cn-hangzhou

The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

EventIdSet List " EventId " : [ " e-bp16helosl7v0ooj**** " ]

The list of simulated event IDs.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=CreateSimulatedSystemEvents
&EventType=SystemMaintenance.Reboot
&InstanceId.1=i-instance1
&NotBefore=2018-12-01T06:32:31Z
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<CreateSimulatedSystemEventsResponse>
      <EventIdSet>
            <EventId>e-bp191hqye********34x</EventId>
            <EventId>e-bp191hqye********34y</EventId>
      </EventIdSet>
          <RequestId>E69EF3CC-94CD-42E7-8926-F133B86387C0</RequestId>
</CreateSimulatedSystemEventsResponse>

JSON format

{
    "EventIdSet":{
        "EventId":[
            "e-bp191hqye********34x",
            "e-bp191hqye********34y"
        ]
    },
    "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 the specified parameter value is invalid.
403 InvalidNotBefore.Passed %s The error message returned when 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. Check whether the value specified for the InstanceId parameter is correct.
403 SimulatedEventLimitExceeded %s The error message returned because the number of simulated system events has reached the upper limit.
403 InstanceIdLimitExceeded %s The error message returned because more than 100 instance IDs are specified.

For a list of error codes, visit the API Error Center.