You can call this operation to query the system events of a specified instance. Inactive historical system events are queried by default. You can query system events within the last seven days. You can specify the InstanceEventCycleStatus parameter to query the system events that are in the Scheduled or Executing state.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
RegionId String Yes cn-hangzhou

The regions ID of the instance for which to query system events. You can call the DescribeRegions operation to query the latest region list.

Action String No DescribeInstanceHistoryEvents

The operation that you want to perform. For API requests using the HTTP and HTTPS methods, Action is required. Set the value to DescribeInstanceHistoryEvents.

EventCycleStatus String No Executed

The lifecycle status of the system event. This parameter takes effect only when the InstanceEventCycleStatus.N parameter is not specified. Valid values:

  • Scheduled
  • Avoided
  • Executing
  • Executed
  • Canceled
  • Failed
EventId.N RepeatList No e-2ze9yxxxxwtqcvai68rl

The IDs of one or more system events. Valid values of N: 1 to 100. The event IDs must be displayed in a repeated list format.

EventPublishTime.End String No 2017-12-01T06:32:31Z

The end of the time range where system events that are published during this time range is queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

EventPublishTime.Start String No 2017-11-30T06:32:31Z

The beginning of the time range where system events that are published during this time range is queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

EventType String No SystemMaintenance.Reboot

The type of the system event. This parameter takes effect only when the InstanceEventType.N parameter is not specified. Valid values:

  • SystemMaintenance.Reboot: The instance has been restarted due to system maintenance.
  • SystemFailure.Reboot: The instance has been restarted due to system failure.
  • SystemFailure.Delete: The instance has been released due to instance creation failure.
  • InstanceFailure.Reboot: The instance has been restarted due to instance failure.
  • InstanceExpiration.Stop: The instance has been stopped due to subscription expiration.
  • InstanceExpiration.Delete: The instance has been released due to subscription expiration.
  • AccountUnbalanced.Stop: The instance has been stopped due to an overdue payment.
  • AccountUnbalanced.Delete: The instance has been released due to an overdue payment.
InstanceEventCycleStatus.N RepeatList No Executed

The lifecycle status of one or more system events. Valid values of N: 1 to 6. Multiple values must be displayed in a repeated list format. Valid values:

  • Scheduled
  • Avoided
  • Executing
  • Executed
  • Canceled
  • Failed
InstanceEventType.N RepeatList No SystemMaintenance.Reboot

The types of one or more system events. Valid values of N: 1 to 30. Multiple values must be displayed in a repeated list format. Valid values:

  • SystemMaintenance.Reboot: The instance has been restarted due to system maintenance.
  • SystemFailure.Reboot: The instance has been restarted due to system failure.
  • SystemFailure.Delete: The instance has been released due to instance creation failure.
  • InstanceFailure.Reboot: The instance has been restarted due to instance failure.
  • InstanceExpiration.Stop: The instance has been stopped due to subscription expiration.
  • InstanceExpiration.Delete: The instance has been released due to subscription expiration.
  • AccountUnbalanced.Stop: The instance has been stopped due to an overdue payment.
  • AccountUnbalanced.Delete: The instance has been released due to an overdue payment.
InstanceId String No i-myInstance

The ID of the instance to be queried. If no instance ID is specified, system events of all instances in the specified region are queried.

NotBefore.End String No 2017-12-01T06:32:31Z

The end of the time range where system events that are scheduled for execution during this time range are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

NotBefore.Start String No 2017-11-30T06:32:31Z

The beginning of the time range where system events that are scheduled for execution during this time range are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

PageNumber Integer No 1

The number of the page to return. Pages start from page 1.

Default value: 1

PageSize Integer No 10

The number of entries to return on each page. Valid values: 1 to 100.

Default value: 10

Response parameters

Parameter Type Example Description
InstanceSystemEventSet

An array of system events for the instance.

  └EventCycleStatus

The lifecycle status of the system event.

    └Code Integer 0

The status code of the system event.

    └Name String Executed

The status name of the system event.

  └EventFinishTime String 2017-12-01T06:35:31Z

The time when the system event ended. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format. The time is displayed in UTC.

  └EventId String e-2ze9yxxxxwtqcvai68rx

The ID of the system event.

  └EventPublishTime String 2017-11-30T06:32:31Z

The time when the system event was published. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format. The time is displayed in UTC.

  └EventType

The type of the system event.

    └Code Integer 34

The code of the system event type.

    └Name String InstanceExpiration.Stop

The name of the system event type.

  └ExtendedAttribute

The extended attributes of the system event.

    └Device String /dev/vda

The device name of the local disk.

    └DiskId String d-diskid1

The ID of the local disk.

  └InstanceId String i-myInstance

The ID of the instance.

  └NotBefore String 2017-12-06T00:00:00Z

The scheduled execution time of the system event. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format. The time is displayed in UTC.

PageNumber Integer 1

The number of the page returned.

PageSize Integer 10

The number of entries returned on each page.

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

The ID of the request.

TotalCount Integer 2

The total number of instance states.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeInstanceHistoryEvents
&RegionId=cn-hangzhou
&InstanceId=i-myInstance
&EventId. 1=e-2ze9yxxxxwtqcvai68rl
&InstanceEventCycleStatus. 1=Executed
&EventCycleStatus=Executed
&InstanceEventType. 1=SystemMaintenance.Reboot
&EventType=SystemMaintenance.Reboot
&NotBefore.Start=2017-11-30T06:32:31Z
&NotBefore.End=2017-12-01T06:32:31Z
&EventPublishTime.Start=2017-11-30T06:32:31Z
&EventPublishTime.End=2017-12-01T06:32:31Z
&PageNumber=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

<DescribeInstanceHistoryEventsResponse>
  <InstanceSystemEventSet>
    <InstanceSystemEventType>
      <InstanceId>i-2ze3tphuqvc93cixxxx3</InstanceId>
      <EventId>e-2ze9yxxxxwtqcvai68rl</EventId>
      <EventType>
        <Code>1</Code>
        <Name>SystemMaintenance.Reboot</Name>
      </EventType>
      <EventCycleStatus>
        <Code>0</Code>
        <Name>Executed</Name>
      </EventCycleStatus>
      <EventPublishTime>2017-11-30T06:32:31Z</EventPublishTime>
      <NotBefore>2017-12-01T06:32:31Z</NotBefore>
      <EventFinishTime>2017-12-01T06:35:31Z</EventFinishTime>
    </InstanceSystemEventType>
    <InstanceSystemEventType>
      <InstanceId>i-2ze3tphuqvc93cixxxx3</InstanceId>
      <EventId>e-2ze9yxxxxwtqcvai68r3</EventId>
      <EventType>
        <Code>34</Code>
        <Name>InstanceExpiration.Stop</Name>
      </EventType>
      <EventCycleStatus>
        <Code>8</Code>
        <Name>Avoided</Name>
      </EventCycleStatus>
      <EventPublishTime>2017-11-29T06:32:31Z</EventPublishTime>
      <NotBefore>2017-12-06T00:00:00Z</NotBefore>
      <EventFinishTime>2017-12-05T12:35:31Z</EventFinishTime>
    </InstanceSystemEventType>
  </InstanceSystemEventSet>
  <PageSize>10</PageSize>
  <PageNumber>1</PageNumber>
  <TotalCount>2</TotalCount>
  <RequestId>02EA76D3-5A2A-44EB-XXXX-8901881D8707</RequestId>
</DescribeInstanceHistoryEventsResponse>

JSON format

{
	"PageNumber":1,
	"TotalCount":2,
	"PageSize":10,
	"RequestId":"02EA76D3-5A2A-44EB-XXXX-8901881D8707",
	"InstanceSystemEventSet":{
		"InstanceSystemEventType":[
			{
				"EventPublishTime":"2017-11-30T06:32:31Z",
				"NotBefore":"2017-12-01T06:32:31Z",
				"EventFinishTime":"2017-12-01T06:35:31Z",
				"InstanceId":"i-2ze3tphuqvc93cixxxx3",
				"EventId":"e-2ze9yxxxxwtqcvai68rl",
				"EventType":{
					"Name":"SystemMaintenance.Reboot",
					"Code":1
				},
				"EventCycleStatus":{
					"Name":"Executed",
					"Code":0
				}
			},
			{
				"EventPublishTime":"2017-11-29T06:32:31Z",
				"NotBefore":"2017-12-06T00:00:00Z",
				"EventFinishTime":"2017-12-05T12:35:31Z",
				"InstanceId":"i-2ze3tphuqvc93cixxxx3",
				"EventId":"e-2ze9yxxxxwtqcvai68r3",
				"EventType":{
					"Name":"InstanceExpiration.Stop",
					"Code":34
				},
				"EventCycleStatus":{
					"Name":"Avoided",
					"Code":8
				}
			}
		]
	}
}

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 parameter format is invalid.
403 EventIdLimitExceeded %s The error message returned because more than 100 system event IDs are specified.
403 InvalidParameter.TimeEndBeforeStart %s The error message returned because the end time was earlier the start time.
403 OperationDenied.NotInWhiteList %s The error message returned because you are not authorized to perform this operation.

View error codes