Invoke the DescribeInstanceHistoryEvents API and specify parameters such as InstanceId and EventType to query system event information for a specified instance. By default, this operation queries historical system events that are in a non-active state.
Operation description
-
You can query completed historical system events from up to the last 30 days. There is no time limit for querying incomplete system events.
-
When neither the EventCycleStatus nor the InstanceEventCycleStatus parameter is specified, the query results include only system events in the Avoided (event avoided), Executed (event execution completed), Canceled (event canceled), or Failed (event execution failed) status by default.
-
By specifying the InstanceEventCycleStatus parameter, you can also query system events in the Scheduled (awaiting execution), Executing (execution in progress), or Inquiring (inquiry in progress) status.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInstanceHistoryEvents |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the resource. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| RegionId |
string |
Yes |
The region ID of the resource. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| InstanceId |
string |
No |
The ID of the instance. If this parameter is not specified, the system events of all instances in the specified region are queried. |
i-uf678mass4zvr9n1**** |
| EventCycleStatus |
string |
No |
The lifecycle state of the system event. This parameter takes effect only when InstanceEventCycleStatus.N is not specified. Valid values:
|
Executed |
| EventType |
string |
No |
The type of the system event. This parameter takes effect only when InstanceEventType.N is not specified. Valid values:
Note
For more information, see Overview. The values of this parameter are applicable only to instance system events, but not to disk system events. |
SystemMaintenance.Reboot |
| NotBefore.Start |
string |
No |
The earliest scheduled start time for 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. |
2017-11-30T06:32:31Z |
| NotBefore.End |
string |
No |
The latest scheduled end time for 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. |
2017-12-01T06:32:31Z |
| EventPublishTime.Start |
string |
No |
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. |
2017-11-30T06:32:31Z |
| EventPublishTime.End |
string |
No |
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. |
2017-12-01T06:32:31Z |
| ImpactLevel |
string |
No |
Note
This parameter is not publicly available. |
null |
| PageNumber |
integer |
No |
Note
This parameter is deprecated. We recommend that you specify MaxResults or NextToken for a paged query. |
1 |
| PageSize |
integer |
No |
Note
This parameter is deprecated. We recommend that you specify MaxResults or NextToken for a paged query. |
10 |
| ResourceType |
string |
No |
The type of the resource. Valid values:
Default value: instance. |
instance |
| EventId |
array |
No |
The ID of system event N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values. |
e-uf64yvznlao4jl2c**** |
|
string |
No |
The ID of system event N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values. |
e-uf64yvznlao4jl2c**** |
|
| InstanceEventCycleStatus |
array |
No |
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:
|
Executed |
|
string |
No |
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:
|
Executed |
|
| InstanceEventType |
array |
No |
The type of system event N. Valid values of N: 1 to 30. You can repeat this parameter to pass multiple values. Valid values:
Note
For more information, see Overview. The values of this parameter are applicable only to instance system events, but not to disk system events. |
SystemMaintenance.Reboot |
|
string |
No |
The type of system event N. Valid values of N: 1 to 30. You can repeat this parameter to pass multiple values. Valid values:
Note
For more information, see Overview. The values of this parameter are applicable only to instance system events, but not to disk system events. |
SystemMaintenance.Reboot |
|
| ResourceId |
array |
No |
The ID of resource N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values. Valid values:
If this parameter is not specified, the system events of all resources of the type specified by Note
We recommend that you use |
i-uf678mass4zvr9n1**** |
|
string |
No |
The ID of resource N. Valid values of N: 1 to 100. You can repeat this parameter to pass multiple values. Valid values:
If this parameter is not specified, the system events of all resources of the type specified by Note
We recommend that you use |
i-uf678mass4zvr9n1**** |
|
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
The list of tags. |
||
| Key |
string |
No |
The key of tag N of the resource. |
TestKey |
| Value |
string |
No |
The value of tag N of the resource. |
TestValue |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the resource belongs. |
rg-bp67acfmxazb4p**** |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken. |
f1c9fa9de5752*** |
| MaxResults |
integer |
No |
The number of entries to return on each page. Valid values: 10 to 100. Default values:
|
100 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The queried instance system events. |
||
| PageSize |
integer |
The number of entries per page. Note
|
10 |
| RequestId |
string |
The ID of the request. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
The page number. Note
|
1 |
| TotalCount |
integer |
The total number of instances. Note
If you specify the MaxResults and NextToken request parameters to perform a paged query, the value of the TotalCount response parameter is invalid. |
2 |
| InstanceSystemEventSet |
object |
||
| InstanceSystemEventType |
array<object> |
Details about the instance system events. |
|
|
array<object> |
Details about the instance system event. |
||
| EventId |
string |
The ID of the system event. |
e-uf64yvznlao4jl2c**** |
| EventPublishTime |
string |
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. |
2017-11-30T06:32:31Z |
| EventFinishTime |
string |
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. |
2017-12-01T06:35:31Z |
| ResourceType |
string |
The type of the resource. Valid values:
|
instance |
| ImpactLevel |
string |
The impact level of the system event. |
100 |
| NotBefore |
string |
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. |
2017-12-06T00:00:00Z |
| InstanceId |
string |
The ID of the instance. |
i-uf678mass4zvr9n1**** |
| Reason |
string |
The reason why the system event occurred. |
System maintenance is scheduled due to ***. |
| EventType |
object |
The type of the system event. |
|
| Name |
string |
The name of the system event type. |
InstanceExpiration.Stop |
| Code |
integer |
The code of the system event type. |
34 |
| EventCycleStatus |
object |
The lifecycle status of the system event. |
|
| Name |
string |
The state name of the system event. |
Executed |
| Code |
integer |
The state code of the system event. |
0 |
| ExtendedAttribute |
object |
The extended attribute of the system event. |
|
| Device |
string |
The device name of the local disk. |
/dev/vda |
| DiskId |
string |
The ID of the local disk. |
d-diskid1 |
| InactiveDisks |
object |
||
| InactiveDisk |
array<object> |
The inactive disks that were released and whose data must be cleared. |
|
|
object |
The inactive disk that was released and whose data must be cleared. |
||
| CreationTime |
string |
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. |
2018-11-30T06:32:31Z |
| DeviceSize |
string |
The size of the disk. Unit: GiB. |
80 |
| DeviceCategory |
string |
The category of the disk. Valid values:
|
cloud_efficiency |
| DeviceType |
string |
The type of the disk. Valid values:
|
data |
| ReleaseTime |
string |
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. |
2019-11-30T06:32:31Z |
| HostType |
string |
The type of the host. Valid values:
|
ddh |
| HostId |
string |
The ID of the host. |
dh-bp1ewce1gk3iwv2**** |
| MigrationOptions |
object |
||
| MigrationOption |
array |
The migration solution of the instance. Valid value: MigrationPlan. Instances can be migrated only by using migration plans. |
|
|
string |
The migration solution of the instance. Valid value: MigrationPlan. Instances can be migrated only by using migration plans. |
MigrationPlan |
|
| OnlineRepairPolicy |
string |
The online repair policy for the damaged disk. Valid value: IsolateOnly, which indicates that damaged disks are isolated but not repaired. |
IsolateOnly |
| Rack |
string |
The rack number of the cloud box. |
A01 |
| PunishType |
string |
The type of the penalty. |
ecs_message_alert |
| PunishDomain |
string |
The illegal domain name. |
1228.test.com |
| PunishUrl |
string |
The illegal URL. |
http://1228.test.com/1 |
| Code |
string |
The code of the security violation. |
PR111 |
| CanAccept |
string |
Indicates whether the event can be handled. |
true |
| ResponseResult |
string |
The response result of the event. Valid values:
|
true |
| MetricValue |
string |
Metric value. |
18000 |
| MetricName |
string |
Metric Name. |
in_mbps |
| ReasonCode |
string |
The reason code category for the system event. |
VPCMigrationEcs |
| NextToken |
string |
A pagination token. It can be used in the next request to retrieve a new page of results. Note
If the NextToken parameter is not returned when you use the MaxResults and NextToken parameters to perform a paged query, no more data is returned. |
f1c9fa9de5752*** |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"TotalCount": 2,
"InstanceSystemEventSet": {
"InstanceSystemEventType": [
{
"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": {
"InactiveDisk": [
{
"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": {
"MigrationOption": [
"MigrationPlan"
]
},
"OnlineRepairPolicy": "IsolateOnly",
"Rack": "A01",
"PunishType": "ecs_message_alert",
"PunishDomain": "1228.test.com",
"PunishUrl": "http://1228.test.com/1",
"Code": "PR111",
"CanAccept": "true",
"ResponseResult": "true",
"MetricValue": "18000",
"MetricName": "in_mbps"
},
"ReasonCode": "VPCMigrationEcs"
}
]
},
"NextToken": "f1c9fa9de5752***"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | InvalidParameter | %s | |
| 403 | EventIdLimitExceeded | %s | |
| 403 | InvalidParameter.TimeEndBeforeStart | %s | The specified parameter is invalid. 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 when you are authorized. |
| 404 | MissingParameter | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.