All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceHistoryEvents

Last Updated:Sep 04, 2023

Queries the system events of Elastic Compute Service (ECS) instances. By default, non-active system events are queried.

  • You can query system events that were completed within the last 30 days. No limits apply to the time range for querying uncompleted system events.
  • You can also specify InstanceEventCycleStatus to query the system events that are in the Scheduled, Executing, or Inquiring state.

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 DescribeInstanceHistoryEvents

The operation that you want to perform. Set the value to DescribeInstanceHistoryEvents.

RegionId String Yes cn-hangzhou

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

InstanceId String No i-uf678mass4zvr9n1****

The instance ID. If this parameter is not specified, the system events of all instances in the specified region are queried.

EventCycleStatus String No Executed

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

  • Scheduled
  • Avoided
  • Executing
  • Executed
  • Canceled
  • Failed
  • Inquiring
EventType String No SystemMaintenance.Reboot

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

  • SystemMaintenance.Reboot: The instance is restarted due to system maintenance.
  • SystemMaintenance.Redeploy: The instance is redeployed due to system maintenance.
  • SystemFailure.Reboot: The instance is restarted due to a system error.
  • SystemFailure.Redeploy: The instance is redeployed due to a system error.
  • SystemFailure.Delete: The instance is released due to an instance creation failure.
  • InstanceFailure.Reboot: The instance is restarted due to an instance error.
  • InstanceExpiration.Stop: The subscription instance is stopped due to expiration.
  • InstanceExpiration.Delete: The subscription instance is released due to expiration.
  • AccountUnbalanced.Stop: The pay-as-you-go instance is stopped due to an overdue payment.
  • AccountUnbalanced.Delete: The pay-as-you-go instance is released due to an overdue payment.
Note For more information, see Overview. The values of this parameter are applicable only to instance system events, not to disk system events.
NotBefore.Start String No 2017-11-30T06:32:31Z

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

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

The end of the scheduled execution window of the system event. 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 in which to query published system events. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

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

The end of the time range in which to query published system events. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

ImpactLevel String No null
Note This parameter is not publicly available.
PageNumber Integer No 1

The page number. Pages start from page 1.

Default value: 1

PageSize Integer No 10

The number of entries per page. Valid values: 1 to 100.

Default value: 10.

ResourceType String No instance

The resource type. Valid values:

  • instance: ECS instance.
  • ddh: dedicated host.
  • managehost: physical machine in a smart hosting pool.

Default value: instance.

EventId.N String No e-uf64yvznlao4jl2c****

The ID of system event N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values.

InstanceEventCycleStatus.N String No Executed

The lifecycle state of system event N. Valid values of N: 1 to 7. You can repeat this parameter to pass multiple values. Valid values:

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

The type of system event N. Valid values of N: 1 to 30. You can repeat this parameter to pass multiple values. Valid values:

  • SystemMaintenance.Reboot: The instance is restarted due to system maintenance.
  • SystemMaintenance.Redeploy: The instance is redeployed due to system maintenance.
  • SystemFailure.Reboot: The instance is restarted due to a system error.
  • SystemFailure.Redeploy: The instance is redeployed due to a system error.
  • SystemFailure.Delete: The instance is released due to an instance creation failure.
  • InstanceFailure.Reboot: The instance is restarted due to an instance error.
  • InstanceExpiration.Stop: The subscription instance is stopped due to expiration.
  • InstanceExpiration.Delete: The subscription instance is released due to expiration.
  • AccountUnbalanced.Stop: The pay-as-you-go instance is stopped due to an overdue payment.
  • AccountUnbalanced.Delete: The pay-as-you-go instance is released due to an overdue payment.
Note For more information, see Overview. The values of this parameter are applicable only to instance system events, not to disk system events.
ResourceId.N String No i-uf678mass4zvr9n1****

The ID of resource N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values. Valid values:

  • When ResourceType is set to instance, ResourceId.N specifies the ID of instance N.
  • When ResourceType is set to ddh, ResourceId.N specifies the ID of dedicated host N.
  • When ResourceType is set to managedhost, ResourceId.N specifies the ID of physical machine N from a smart hosting pool.

If this parameter is not specified, the system events of all resources of the type specified by ResourceType in the region specified by RegionId are queried.

Note We recommend that you use ResourceId.N to specify one or more resource IDs. If you specify both ResourceId.N and InstanceId, ResourceId.N takes precedence by default.
Tag.N.Key String No TestKey

The key of tag N of the resource.

Tag.N.Value String No TestValue

The value of tag N of the resource.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the resource group to which the resource belongs.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries per page.

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

The request ID.

PageNumber Integer 1

The page number.

TotalCount Integer 2

The total number of instances returned.

InstanceSystemEventSet Array of InstanceSystemEventType

The information about instance system events.

InstanceSystemEventType
EventId String e-uf64yvznlao4jl2c****

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:mm:ssZ format. The time is displayed in UTC.

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:mm:ssZ format. The time is displayed in UTC.

ResourceType String instance

The resource type. Valid values:

  • instance: ECS instance.
  • ddh: dedicated host.
  • managehost: physical machine in a smart hosting pool.
ImpactLevel String 100

The impact level of the system event.

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

The scheduled start time of the system event. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

InstanceId String i-uf678mass4zvr9n1****

The instance ID.

Reason String System maintenance is scheduled due to ***.

The reason why the system event was scheduled.

EventType Object

The type of the system event.

Name String InstanceExpiration.Stop

The name of the system event type.

Code Integer 34

The code of the system event type.

EventCycleStatus Object

The lifecycle state of the system event.

Name String Executed

The state name of the system event.

Code Integer 0

The state code of the system event.

ExtendedAttribute Object

The extended attribute 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.

InactiveDisks Array of InactiveDisk

The information about the inactive disks that have been released and must be cleared.

InactiveDisk
CreationTime String 2018-11-30T06:32:31Z

The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

DeviceSize String 80

The size of the disk. Unit: GiB.

DeviceCategory String cloud_efficiency

The category of the disk. Valid values:

  • cloud: basic disk.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: enhanced SSD (ESSD).
  • local_ssd_pro: I/O-intensive local disk.
  • local_hdd_pro: throughput-intensive local disk.
  • ephemeral: retired local disk.
  • ephemeral_ssd: retired local SSD.
DeviceType String data

The type of the disk. Valid values:

  • system: system disk.
  • data: data disk.
ReleaseTime String 2019-11-30T06:32:31Z

The time when the disk was released. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

HostType String ddh

The type of the host. Valid values:

  • ddh: dedicated host.
  • managehost: physical machine in a smart hosting pool.
HostId String dh-bp1ewce1gk3iwv2****

The ID of the host.

MigrationOptions Array of String MigrationPlan

The migration solution of the instance. Valid value: MigrationPlan, which indicates that instances can be migrated only by using migration plans.

OnlineRepairPolicy String IsolateOnly

The online repair policy for the damaged disk. Valid value: IsolateOnly, which indicates that damaged disks are isolated but not repaired.

Rack String A01

The rack number of the cloud box.

PunishType String ecs_message_alert

The type of the penalty.

PunishDomain String 1228.test.com

The illegal domain name.

PunishUrl String http://1228.test.com/1

The illegal URL.

Code String PR111

The code of the security violation.

CanAccept String true

Indicates whether the event can be handled.

ResponseResult String true

The response result of the event. Valid values:

  • true: The event was handled.
  • false: The event failed to be handled.

Examples

Sample requests

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

Sample success responses

XML format

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

<DescribeInstanceHistoryEventsResponse>
    <PageSize>10</PageSize>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>2</TotalCount>
    <InstanceSystemEventSet>
        <EventId>e-uf64yvznlao4jl2c****</EventId>
        <EventPublishTime>2017-11-30T06:32:31Z</EventPublishTime>
        <EventFinishTime>2017-12-01T06:35:31Z</EventFinishTime>
        <ResourceType>instance</ResourceType>
        <ImpactLevel>100</ImpactLevel>
        <NotBefore>2017-12-06T00:00:00Z</NotBefore>
        <InstanceId>i-uf678mass4zvr9n1****</InstanceId>
        <Reason>System maintenance is scheduled due to ***.</Reason>
        <EventType>
            <Name>InstanceExpiration.Stop</Name>
            <Code>34</Code>
        </EventType>
        <EventCycleStatus>
            <Name>Executed</Name>
            <Code>0</Code>
        </EventCycleStatus>
        <ExtendedAttribute>
            <Device>/dev/vda</Device>
            <DiskId>d-diskid1</DiskId>
            <InactiveDisks>
                <CreationTime>2018-11-30T06:32:31Z</CreationTime>
                <DeviceSize>80</DeviceSize>
                <DeviceCategory>cloud_efficiency</DeviceCategory>
                <DeviceType>data</DeviceType>
                <ReleaseTime>2019-11-30T06:32:31Z</ReleaseTime>
            </InactiveDisks>
            <HostType>ddh</HostType>
            <HostId>dh-bp1ewce1gk3iwv2****</HostId>
            <MigrationOptions>MigrationOptions</MigrationOptions>
            <OnlineRepairPolicy>IsolateOnly</OnlineRepairPolicy>
            <Rack>cb-f8z7yvzgwfkl90h****0</Rack>
        </ExtendedAttribute>
    </InstanceSystemEventSet>
</DescribeInstanceHistoryEventsResponse>

JSON format

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

{
  "PageSize" : 10,
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber" : 1,
  "TotalCount" : 2,
  "InstanceSystemEventSet" : [ {
    "EventId" : "e-uf64yvznlao4jl2c****",
    "EventPublishTime" : "2017-11-30T06:32:31Z",
    "EventFinishTime" : "2017-12-01T06:35:31Z",
    "ResourceType" : "instance",
    "ImpactLevel" : "100",
    "NotBefore" : "2017-12-06T00:00:00Z",
    "InstanceId" : "i-uf678mass4zvr9n1****",
    "Reason" : "System maintenance is scheduled due to ***.",
    "EventType" : {
      "Name" : "InstanceExpiration.Stop",
      "Code" : 34
    },
    "EventCycleStatus" : {
      "Name" : "Executed",
      "Code" : 0
    },
    "ExtendedAttribute" : {
      "Device" : "/dev/vda",
      "DiskId" : "d-diskid1",
      "InactiveDisks" : [ {
        "CreationTime" : "2018-11-30T06:32:31Z",
        "DeviceSize" : "80",
        "DeviceCategory" : "cloud_efficiency",
        "DeviceType" : "data",
        "ReleaseTime" : "2019-11-30T06:32:31Z"
      } ],
      "HostType" : "ddh",
      "HostId" : "dh-bp1ewce1gk3iwv2****",
      "MigrationOptions" : [ "MigrationOptions" ],
      "OnlineRepairPolicy" : "IsolateOnly",
      "Rack" : "cb-f8z7yvzgwfkl90h****0"
    }
  } ]
}

Error codes

HTTP status code Error code Error message Description
403 InvalidParameter %s Invalid parameter.
403 EventIdLimitExceeded %s More than 100 event IDs are specified.
403 InvalidParameter.TimeEndBeforeStart %s Invalid parameter. Make sure that the end time is later than the start time.
403 OperationDenied.NotInWhiteList %s You are not authorized to perform this operation. Try again after you are authorized.
404 MissingParameter %s A parameter is not specified.

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