All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceMaintenanceAttributes

最終更新日:Dec 23, 2024

Queries the maintenance attributes of an instance.

Operation description

This operation is used to query the specified maintenance policy of an instance, which contains the following maintenance attributes:

  • Maintenance window: the time period that you specify for maintenance.
  • Maintenance action: the action that you specify in response to instance shutdown.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeInstanceMaintenanceAttributesget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
PageNumberlongNo

The page number.

Pages start from page 1.

Default value: 1.

1
PageSizelongNo

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

Default value: 10.

10
InstanceIdarrayNo

The instance IDs. You can specify up to 100 instance IDs.

stringNo

The instance ID.

i-bp67acfmxazb4p****

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries per page.

10
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberinteger

The page number.

1
TotalCountinteger

The total number of queried maintenance attributes.

100
MaintenanceAttributesarray<object>

The maintenance attributes.

MaintenanceAttributeobject
NotifyOnMaintenanceboolean

Indicates whether an event notification was sent before maintenance.

false
InstanceIdstring

The instance ID.

i-bp67acfmxazb4p****
MaintenanceWindowsarray<object>

The maintenance windows.

MaintenanceWindowobject
EndTimestring

The end time of the maintenance window.

18:00:00
StartTimestring

The start time of the maintenance window.

02:00:00
ActionOnMaintenanceobject

The attributes of the maintenance action of the instance.

DefaultValuestring

The default maintenance action.

AutoRecover
Valuestring

The current maintenance action. Valid values:

  • Stop: stops the instance.
  • AutoRecover: automatically recovers the instance.
  • AutoRedeploy: redeploys the instance, which may damage the data disks attached to the instance.
Stop
SupportedValuesarray

The supported maintenance actions.

SupportedValuestring

The supported maintenance action.

Stop

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "TotalCount": 100,
  "MaintenanceAttributes": {
    "MaintenanceAttribute": [
      {
        "NotifyOnMaintenance": false,
        "InstanceId": "i-bp67acfmxazb4p****",
        "MaintenanceWindows": {
          "MaintenanceWindow": [
            {
              "EndTime": "18:00:00",
              "StartTime": "02:00:00"
            }
          ]
        },
        "ActionOnMaintenance": {
          "DefaultValue": "AutoRecover",
          "Value": "Stop",
          "SupportedValues": {
            "SupportedValue": [
              "Stop"
            ]
          }
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter%sA parameter is not specified.
403InvalidParameter%sThe specified parameter is invalid.
403InstanceIdLimitExceeded%sMore than 100 instance IDs are specified.
403OperationDenied.NotInWhiteList%sYou are not authorized to perform this operation. Try again when you are authorized.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history