Queries the information about an Elastic Compute Service (ECS) instance.

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 DescribeInstanceAttribute

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

InstanceId String Yes i-uf6f5trc95ug8t33****

The ID of the instance.

Response parameters

Parameter Type Example Description
Status String Running

The state 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.
SerialNumber String 51d1353b-22bf-4567-a176-8b3e12e4****

The serial number of the instance.

CreationTime String 2017-12-10T04:04Z

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.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The ID of the request.

Description String testDescription

The description of the instance.

InstanceName String testInstanceName

The name of the instance.

InstanceNetworkType String vpc

The network type of the instance. Valid values:

  • classic: classic network
  • vpc: Virtual Private Cloud (VPC)
Memory Integer 16384

The memory size of the instance. Unit: MiB.

ImageId String m-bp1h46wfpjsjastc****

The ID of the image that the instance is running.

ClusterId String cls-bp67acfmxazb4p****

The ID of the cluster to which the instance belongs.

Note This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.
VlanId String 10

The virtual LAN (VLAN) ID of the instance.

Note This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.
StoppedMode String KeepCharging

Indicates whether the instance continues to be billed after it is stopped. Valid values:

  • KeepCharging: standard mode. Billing of the instance continues after the instance is stopped, and resources are retained for the instance.
  • StopCharging: economical mode. 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.
HostName String testHostName

The hostname of the instance.

InstanceId String i-uf6f5trc95ug8t33****

The ID of the instance.

InstanceType String ecs.g5.large

The instance type.

InternetMaxBandwidthIn Integer 50

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

InternetMaxBandwidthOut Integer 5

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

RegionId String cn-hangzhou

The ID of the region in which the instance resides.

InstanceChargeType String PrePaid

The billing method of the instance. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
IoOptimized String true

Indicates whether the instance is I/O optimized.

Cpu Integer 8

The number of vCPUs.

ExpiredTime String 2017-12-10T04:04Z

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.

ZoneId String cn-hangzhou-g

The ID of the zone in which the instance resides.

InternetChargeType String PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-traffic
Note When the pay-by-traffic billing method for network usage is used, the maximum inbound and outbound bandwidth values are used as upper limits of bandwidths instead of guaranteed performance specifications. In scenarios where demand outstrips resource supplies, these maximum bandwidth values may be reached. If you want guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
CreditSpecification String Standard

The performance mode of the burstable instance. Valid values:

  • Standard: standard mode. For more information, see the "Standard mode" section in Overview.
  • Unlimited: unlimited mode. For more information, see the "Unlimited mode" section in Overview.
SecurityGroupIds Array of String sg-bp1fg655nh68xyz9i****

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

PublicIpAddress Array of String 121.40.**.**

The public IP address of the instance.

InnerIpAddress Array of String 192.168.**.**

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

VpcAttributes Object

The VPC attributes of the instance.

VpcId String vpc-wz9e4e9pmbcnj6ki6****

The ID of the VPC.

NatIpAddress String 172.17.**.**

The Network Address Translation (NAT) IP address of the instance. It is used by ECS instances in different VPCs for communication.

VSwitchId String vsw-uf6ixacqz8osrwnqb****

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

PrivateIpAddress Array of String 192.168.**.**

The private IP address of the instance.

EipAddress Object

Details about the elastic IP address (EIP) associated with the instance.

InternetChargeType String PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-traffic
Note When the pay-by-traffic billing method for network usage is used, the maximum inbound and outbound bandwidth values are used as upper limits of bandwidths instead of guaranteed performance specifications. In scenarios where demand outstrips resource supplies, these maximum bandwidth values may be reached. If you want guaranteed bandwidths for your instance, use the pay-by-bandwidth billing method for network usage.
IpAddress String 30.21.**.**

The EIP of the instance.

Bandwidth Integer 8

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

AllocationId String eip-wz9uilio26dfscamm****

The ID of the EIP.

DedicatedHostAttribute Object

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

DedicatedHostName String ecs-autoui-create-ddh-temp

The name of the dedicated host.

DedicatedHostId String dh-2ze7qrzz6lvbfhr0****

The ID of the dedicated host.

OperationLocks Array of LockReason

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 was made for the instance.
LockReason
LockReason String financial

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 was made for the instance.
EnableJumboFrame Boolean false

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

  • true: The Jumbo Frame feature is enabled for the instance.
  • false: The Jumbo Frame feature is disabled for the instance.

For more information, see Set the MTU size of an NIC.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeInstanceAttribute
&InstanceId=i-uf6f5trc95ug8t33****
&Common request parameters

Sample success responses

XML format

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

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

JSON format

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

{
  "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" : [ "sg-bp1fg655nh68xyz9i****" ],
  "PublicIpAddress" : [ "121.40.**.**" ],
  "InnerIpAddress" : [ "192.168.**.**" ],
  "VpcAttributes" : {
    "VpcId" : "vpc-wz9e4e9pmbcnj6ki6****",
    "NatIpAddress" : "172.17.**.**",
    "VSwitchId" : "vsw-uf6ixacqz8osrwnqb****",
    "PrivateIpAddress" : [ "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" : "financial"
  } ],
  "EnableJumboFrame" : false
}

Error codes

HTTP status code Error code Error message Description
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The error message returned because the specified instance does not exist. Check whether the specified instance ID is valid.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later.

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