All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceAttribute

更新時間:Nov 14, 2024

Queries the attributes of an Elastic Compute Service (ECS) instance.

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:DescribeInstanceAttributeget
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The instance ID.

i-uf6f5trc95ug8t33****

Response parameters

ParameterTypeDescriptionExample
object
Statusstring

The status of the instance. Valid values:

  • Pending: The instance is being created.
  • Running: The instance is running.
  • Starting: The instance is being started.
  • Stopping: The instance is being stopped.
  • Stopped: The instance is stopped.
Running
SerialNumberstring

The serial number of the instance.

51d1353b-22bf-4567-a176-8b3e12e4****
CreationTimestring

The time when the instance was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. For more information, see ISO 8601.

2017-12-10T04:04Z
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
Descriptionstring

The description of the instance.

testDescription
InstanceNamestring

The instance name.

testInstanceName
InstanceNetworkTypestring

The network type of the instance. Valid values:

  • classic: classic network
  • vpc: VPC
vpc
Memoryinteger

The memory size of the instance. Unit: MiB.

16384
ImageIdstring

The ID of the image that the instance is running.

m-bp1h46wfpjsjastc****
ClusterIdstring

The ID of the cluster to which the instance belongs.

Note This parameter will be removed in the future. To ensure future compatibility, we recommend that you use other parameters.
cls-bp67acfmxazb4p****
VlanIdstring

The virtual LAN (VLAN) ID of the instance.

Note This parameter will be removed in the future. To ensure future compatibility, we recommend that you use other parameters.
10
StoppedModestring

Indicates whether the system implements billing after the instance is stopped. Valid values:

  • KeepCharging: The instance is stopped in standard mode. The billing of the instance continues after the instance is stopped, and resources are retained for the instance.
  • StopCharging: The instance is stopped in economical mode. The billing of some resources of the instance stops after the instance is stopped. When the instance is stopped, its resources such as vCPUs, memory, and public IP address are released. The instance may be unable to start again if some required resources are out of stock in the current region.
  • Not-applicable: The instance does not support economical mode.
KeepCharging
HostNamestring

The hostname of the instance.

testHostName
InstanceIdstring

The instance ID

i-uf6f5trc95ug8t33****
InstanceTypestring

The instance type.

ecs.g5.large
InternetMaxBandwidthIninteger

The maximum inbound public bandwidth. Unit: Mbit/s.

50
InternetMaxBandwidthOutinteger

The maximum outbound public bandwidth. Unit: Mbit/s.

5
RegionIdstring

The ID of the region in which the instance resides.

cn-hangzhou
InstanceChargeTypestring

The billing method of the instance. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go
PrePaid
IoOptimizedstring

Indicates whether the ECS instance is I/O optimized. Valid values:

  • optimized: The ECS instance is I/O optimized.
  • none: The ECS instance is not I/O optimized.
true
Cpuinteger

The number of vCPUs.

8
ExpiredTimestring

The time when the instance expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. For more information, see ISO 8601.

2017-12-10T04:04Z
ZoneIdstring

The ID of the zone in which the instance resides.

cn-hangzhou-g
InternetChargeTypestring

The billing method for network usage. Valid values:

  • PayByBandwidth
  • PayByTraffic
Note When the pay-by-traffic billing method is used for network usage, the maximum inbound and outbound bandwidths are used as the upper limits of bandwidths instead of guaranteed performance specifications. In scenarios in which demands exceed resource supplies, the maximum bandwidths may not be reached. If you want guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
PayByTraffic
CreditSpecificationstring

The performance mode of the burstable instance. Valid values:

  • Standard: the standard mode. For more information, see the Performance modes section of the "Overview of burstable instances" topic.
  • Unlimited: the unlimited mode. For more information, see the Performance modes section of the "Overview of burstable instances" topic.
Standard
SecurityGroupIdsarray

The IDs of the security groups to which the instance belongs.

SecurityGroupIdstring

The IDs of the security groups to which the instance belongs.

sg-bp1fg655nh68xyz9i****
PublicIpAddressarray

The public IP address of the instance.

IpAddressstring

The public IP address of the instance.

121.40.**.**
InnerIpAddressarray

The internal IP address of the instance located in the classic network.

IpAddressstring

The internal IP address of the instance located in the classic network.

192.168.**.**
VpcAttributesobject

The VPC attributes of the instance.

VpcIdstring

The ID of the VPC.

vpc-wz9e4e9pmbcnj6ki6****
NatIpAddressstring

The NAT IP address of the instance. It is used by ECS instances in different VPCs for communication.

172.17.**.**
VSwitchIdstring

The ID of the vSwitch to which the instance is connected.

vsw-uf6ixacqz8osrwnqb****
PrivateIpAddressarray

The private IP address of the instance.

IpAddressstring

The private IP address of the instance.

192.168.**.**
EipAddressobject

The elastic IP address (EIP) associated with the instance.

InternetChargeTypestring

The billing method for network usage. Valid values:

  • PayByBandwidth
  • PayByTraffic
Note When the pay-by-traffic billing method is used for network usage, the maximum inbound and outbound bandwidths are used as the upper limits of bandwidths instead of guaranteed performance specifications. In scenarios in which demands exceed resource supplies, the maximum bandwidths may not be reached. If you want guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
PayByTraffic
IpAddressstring

The ID of the elastic IP address (EIP).

30.21.**.**
Bandwidthinteger

The maximum public bandwidth of the EIP. Unit: Mbit/s.

8
AllocationIdstring

The ID of the EIP.

eip-wz9uilio26dfscamm****
DedicatedHostAttributeobject

Details about the dedicated host. It is an array that consists of the DedicatedHostClusterId, DedicatedHostId, and DedicatedHostName parameters.

DedicatedHostNamestring

The name of the dedicated host.

ecs-autoui-create-ddh-temp
DedicatedHostIdstring

The ID of the dedicated host.

dh-2ze7qrzz6lvbfhr0****
OperationLocksarray<object>

The reason why the instance was locked. Valid values:

  • financial: The dedicated host was locked due to overdue payments.
  • security: The instance was locked due to security reasons.
  • recycling: The preemptible instance was locked and pending release.
  • dedicatedhostfinancial: The instance was locked due to overdue payments for the dedicated host.
  • refunded: The instance was locked because a refund was made for the instance.
LockReasonobject

The reason why the instance was locked. Valid values:

  • financial: The dedicated host was locked due to overdue payments.
  • security: The instance was locked due to security reasons.
  • recycling: The preemptible instance was locked and pending release.
  • dedicatedhostfinancial: The instance was locked due to overdue payments for the dedicated host.
  • refunded: The instance was locked because a refund was made for the instance.
LockReasonstring

The reason why the instance was locked. Valid values:

  • financial: The instance was locked due to overdue payments.
  • security: The instance was locked due to security reasons.
  • recycling: The preemptible instance was locked and pending release.
  • dedicatedhostfinancial: The instance was locked due to overdue payments for the dedicated host.
  • refunded: The instance was locked because a refund is made for the instance.
financial
EnableJumboFrameboolean

Indicates whether the Jumbo Frame feature is enabled for the instance. Valid values:

  • true
  • false

For more information, see MTUs .

false

Examples

Sample success responses

JSONformat

{
  "Status": "Running",
  "SerialNumber": "51d1353b-22bf-4567-a176-8b3e12e4****",
  "CreationTime": "2017-12-10T04:04Z",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "Description": "testDescription",
  "InstanceName": "testInstanceName",
  "InstanceNetworkType": "vpc",
  "Memory": 16384,
  "ImageId": "m-bp1h46wfpjsjastc****",
  "ClusterId": "cls-bp67acfmxazb4p****",
  "VlanId": "10",
  "StoppedMode": "KeepCharging",
  "HostName": "testHostName",
  "InstanceId": "i-uf6f5trc95ug8t33****",
  "InstanceType": "ecs.g5.large",
  "InternetMaxBandwidthIn": 50,
  "InternetMaxBandwidthOut": 5,
  "RegionId": "cn-hangzhou",
  "InstanceChargeType": "PrePaid",
  "IoOptimized": "true",
  "Cpu": 8,
  "ExpiredTime": "2017-12-10T04:04Z",
  "ZoneId": "cn-hangzhou-g",
  "InternetChargeType": "PayByTraffic",
  "CreditSpecification": "Standard",
  "SecurityGroupIds": {
    "SecurityGroupId": [
      "sg-bp1fg655nh68xyz9i****"
    ]
  },
  "PublicIpAddress": {
    "IpAddress": [
      "121.40.**.**"
    ]
  },
  "InnerIpAddress": {
    "IpAddress": [
      "192.168.**.**"
    ]
  },
  "VpcAttributes": {
    "VpcId": "vpc-wz9e4e9pmbcnj6ki6****",
    "NatIpAddress": "172.17.**.**",
    "VSwitchId": "vsw-uf6ixacqz8osrwnqb****",
    "PrivateIpAddress": {
      "IpAddress": [
        "192.168.**.**"
      ]
    }
  },
  "EipAddress": {
    "InternetChargeType": "PayByTraffic",
    "IpAddress": "30.21.**.**",
    "Bandwidth": 8,
    "AllocationId": "eip-wz9uilio26dfscamm****"
  },
  "DedicatedHostAttribute": {
    "DedicatedHostName": "ecs-autoui-create-ddh-temp",
    "DedicatedHostId": "dh-2ze7qrzz6lvbfhr0****"
  },
  "OperationLocks": {
    "LockReason": [
      {
        "LockReason": "financial"
      }
    ]
  },
  "EnableJumboFrame": false
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.

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

Change history

Change timeSummary of changesOperation
No change history