All Products
Search
Document Center

:CreateSimulatedSystemEvents

更新時間:Dec 19, 2023

Schedules simulated system events for one or more Elastic Compute Service (ECS) instances. The simulated system events do not actually occur on or affect ECS instances.

Usage notes

You can use the ECS console, call ECS API operations, or use CloudMonitor to view the scheduled simulated system events.

A simulated system event transitions through the following states during its lifecycle:

  • Scheduled: The state of the simulated system event changes to Scheduled after it is scheduled.
  • Executed: The state of the simulated system event changes to Executed at the time specified by the NotBefore parameter if no manual intervention is involved.
  • Canceled: The state of the simulated system event changes to Canceled if you cancel the event by calling the CancelSimulatedSystemEvents operation.
  • Avoided: The state of the simulated system event that is generated from maintenance-triggered instance restart can change 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

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.

RegionId String Yes cn-hangzhou

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

EventType String Yes SystemMaintenance.Reboot

The type of the simulated system event. Valid values:

  • SystemMaintenance.Reboot: The instance is restarted due to system maintenance.
  • SystemFailure.Reboot: The instance is restarted due to a system error.
  • InstanceFailure.Reboot: The instance is restarted due to an instance error.
  • SystemMaintenance.Stop: The instance is stopped due to system maintenance.
  • SystemMaintenance.Redeploy: The instance is redeployed due to system maintenance.
  • SystemFailure.Redeploy: The instance is redeployed due to a system error.
  • SystemFailure.Stop: The instance is stopped due to a system error.
  • InstanceFailure.Reboot: The instance is restarted due to an instance error.
NotBefore String Yes 2018-12-01T06:32:31Z

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

Note After a simulated event is created for exception events that are caused by system errors or instance errors, the simulated event enters the Executing (Executing) state. In this case, the value of NotBefore is the time when the simulated event enters the Executed (Executed) state.
InstanceId.N String No i-bp1gtjxuuvwj17zr****

The ID of instance N.

Response parameters

Parameter

Type

Example

Description

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The request ID.

EventIdSet Array of String e-bp16helosl7v0ooj****

The ID of the simulated system event.

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

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateSimulatedSystemEventsResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <EventIdSet>" EventId " : [ " e-bp16helosl7v0ooj**** " ]</EventIdSet>
</CreateSimulatedSystemEventsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "EventIdSet" : [ "\" EventId \" : [ \" e-bp16helosl7v0ooj**** \" ]" ]
}

Error codes

HTTP status code

Error code

Error message

Description

403 InvalidParameter %s Invalid parameter value.
403 InvalidNotBefore.Passed %s The NotBefore value is earlier than the current time.
403 SimulatedEventLimitExceeded %s The maximum number of simulated system events is exceeded.
403 InstanceIdLimitExceeded %s More than 100 instance IDs are specified.
404 MissingParameter %s A required parameter is not specified.
404 InvalidInstanceId.NotFound %s The instance is not found. Check whether the specified instance ID is valid.

For a list of error codes, see Service error codes.