All Products
Search
Document Center

ENS:DescribeInstances

Last Updated:Nov 18, 2024

Queries the details of one or more Edge Node Service (ENS) instances.

Operation description

  • You can call this operation up to 800 times per second per account.
  • You can call this operation up to 100 times per second per user.
  • You can specify multiple request parameters to be queried. Specified parameters are evaluated by using the AND operator. Only the specified parameters are included in the filter conditions. However, if InstanceIds is set to an empty JSON array, it is regarded as a valid filter condition and an empty result is returned.

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
ens:DescribeInstanceslist
*Instance
acs:ens:*:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EnsRegionIdstringNo

The region ID.

cn-beijing-cmcc
InstanceIdstringNo

The ID of the instance.

i-5iqczfxps7csjrxeca****
EnsRegionIdsstringNo

The IDs of the regions. The value is a JSON array that consists of up to 100 IDs. Separate multiple IDs with commas (,).

["cn-suzhou-telecom","cn-chengdu-telecom"]
InstanceIdsstringNo

The IDs of the instances. The value is a JSON array that consists of up to 100 IDs. Separate IDs with commas (,).

["i-5iqczfxps7csjrxeca07****", "i-5iqczfxps7csjrxeca07****"]]
InstanceNamestringNo

The name of the instance.

TestName
ImageIdstringNo

The ID of the image.

centos_6_08_64_20G_alibase_****
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1
PageSizestringNo

The number of entries to return on each page. The maximum value is 100.

Default value: 10.

10
StatusstringNo

The status of the instance. Valid values:

  • Running
  • Stopped
  • Expired
Running
OrderByParamsstringNo

The method that you want to use to sort instances. The value of this parameter is in the JSON format.

You can sort instances by name, expiration time, node ID, or creation time. You can specify one or more methods.

{"InstanceNameSort":"asc","ExpireTimeSort":"asc","CreationTimeSort":"desc"}}
EnsServiceIdstringNo

The ID of the edge service. You can use the ID to query information about the instances that are created in the edge service.

ens-20190730202316s****
InstanceResourceTypestringNo

The condition that you want to use to filter instances by category. Valid values:

  • EnsInstance: ENS instances that you purchase.
  • EnsService: ENS instances that belong to edge services.
  • BuildMachine: ENS instances that are configured with image builders.
  • EnsPostPaidInstance: Pay-as-you-go ENS instances that you purchase.
EnsService
SearchKeystringNo

The keyword that you use to query the logs of the service. You can specify the values of parameters such as ip, InstanceName, and InstanceId as the keyword.

Joshua
NetworkIdstringNo

The ID of the network.

n-2zeuphj08tt7q3brd****
VSwitchIdstringNo

The ID of the vSwitch.

vsw-2zeh0r1pabwtg6wcs****
SecurityGroupIdstringNo

The ID of the security group.

sg-5kyicq2kfcapxrdds6tar7jqb
IntranetIpstringNo

The internal IP address of the instance.

47.100.XX.XX
Tagsarray<object>No

The tags that are added to the resource. This operation does not return tag information. You can call this operation in combination with the tag-related operations.

objectNo

The tags of the instance. This operation does not return tag information. You can call this operation in combination with the tag-related operations.

KeystringNo

The key of the tag that are to add to the instance. Valid values: 1 to 20.

tag
ValuestringNo

The tag value of the instance. Valid values: 1 to 20.

2
InstanceTypestringNo

The instance type.

ens.se1.tiny

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The returned service code. 0 indicates that the request was successful.

0
PageSizeinteger

The number of entries per page.

60
PageNumberinteger

The page number.

1
RequestIdstring

The request ID.

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

The total number of entries returned.

2
Instancesarray<object>

The returned instance information. It is an array that consists of InstanceAttributesType data.

Instanceobject

Schema of Response

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.

2019-07-26T06:40:43Z
Statusstring

The status of the instance. Valid values:

  • Running
  • Expired
  • Stopped
Running
SpecNamestring

The instance type.

ens.sn1.stiny
InstanceTypeFamilystring

The instance family. Valid values:

  • x86_vm: x86-based computing instance.
  • x86_pm: x86-based physical machine.
  • x86_bmi: x86-based bare metal instance.
  • x86_bm: bare metal instance with the SmartNIC.
  • pc_bmi: heterogeneous bare metal instance.
  • pc_vm: heterogeneous virtual machine.
  • arm_bmi: Arm-based computing instance.
x86_vm
InstanceResourceTypestring

The category of the instance. Valid values:

  • EnsInstance: ENS instances that you purchase.
  • EnsService: ENS instances that belong to edge services.
  • BuildMachine: ENS instances that are configured with image builders.
  • EnsPostPaidInstance: pay-as-you-go ENS instances that you purchase.
EnsService
HostNamestring

The hostname of the instance.

  • The hostname cannot start or end with a period (.) or hyphen (-). It cannot contain consecutive periods (.) or hyphens (-).
  • For a Windows instance, the hostname must be 2 to 15 characters in length and can contain letters, digits, and hyphens (-). The hostname cannot contain periods (.) or contain only digits.
  • For an instance that runs another operating system such as Linux, the hostname must be 2 to 64 characters in length. You can use periods (.) to separate the hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).
testHostName
InstanceIdstring

The ID of the instance.

i-instanc****
InternetMaxBandwidthIninteger

The maximum outbound bandwidth. Unit: Mbit/s.

40
InternetMaxBandwidthOutinteger

The minimum inbound bandwidth. Unit: Mbit/s.

100
EnsRegionIdstring

The region ID of the instance.

cn-hangzhou-telecom
Cpustring

The number of vCPUs.

2
ExpiredTimestring

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

2119-07-13T02:38:57Z
InstanceNamestring

The name of the instance.

i-5itef0f28t17bcdw9deu6meub
Diskinteger

The total size of the disk. Unit: MiB.

71680
OSNamestring

The name of the image.

centos 6.8 x86_64
Memoryinteger

The memory size. Unit: MB.

2048
ImageIdstring

The ID of the image.

m-****
DataDiskarray<object>

Details of the data disk.

DataDiskobject

Schema of Response

device_typestring

The extended field of the disk category. Valid values:

  • file: local disk.
  • pangu: ultra disk.
  • local_hdd: local HDD.
pangu
disk_typestring

The type of the cloud disk or local disk. Valid values:

system: system disk. data: data disk.

system
Sizeinteger

The size of the disk. Unit: MiB.

51200
DiskNamestring

The name of the disk.

DiskName
uuidstring

The UUID of the disk.

d-5itef1wtxj961mbff8xe9****
storageinteger

The size of the disk. Unit: MiB.

20480
DiskIdstring

The ID of the disk.

d-5ip4c2dhmas0vjd5u1r****
Categorystring

The category of the cloud disk or local disk. Valid values:

  • file: local disk.
  • pangu: ultra disk.
  • local_hdd: local HDD.
file
namestring

The name of the disk.

name
DiskSizeinteger

The size of the disk. Unit: GiB.

100
PublicIpAddressesarray<object>

Details of the public IP addresses.

PublicIpAddressobject

Schema of Response

Ipstring

The IP address.

119.147.xx.xx
GateWaystring

The gateway.

119.147.xx.xx
Ispstring

The Internet service provider (ISP).

unicom
PrivateIpAddressesarray<object>

Details of the private IP addresses.

PrivateIpAddressobject

Schema of Response

Ipstring

The IP address.

119.147.xx.xx
GateWaystring

The gateway.

119.147.xx.xx
Ispstring

The ISP.

cmcc
SecurityGroupIdsarray

The IDs of the security groups.

SecurityGroupIdstring

The ID of the security group.

sg-5kyicq2kfcapxrdds6ta****
InnerIpAddressarray

The private IP addresses of the instances.

IpAddressstring

The private IP address of the instance.

10.170.xx.xx
PublicIpAddressarray

The public IP addresses of the instances.

IpAddressstring

The public IP address of the instance.

119.147.xx.xx
SystemDiskobject

Details of the system disk.

device_typestring

The extended field of the disk category. Valid values:

  • file: local disk.
  • pangu: ultra disk.
  • local_hdd: local HDD.
pangu
disk_typestring

The type of the cloud disk or local disk. Valid values:

  • system: system disk.
  • data: data disk.
system
Sizeinteger

The size of the disk. Unit: MiB.

51200
DiskNamestring

The name of the disk.

DiskName
uuidstring

The UUID of the disk.

d-5ip4c2dhmas0rn7rt0p96****
storageinteger

The size of the disk. Unit: MiB.

20480
DiskIdstring

The ID of the disk.

d-5ip4c2dhmas0rn7rt0p9****
Categorystring

The category of the cloud disk or local disk. Valid values:

  • file: local disk.
  • pangu: ultra disk.
  • local_hdd: local HDD.
file
namestring

The name of the disk.

DiskName
NetworkAttributesobject

Details of the network.

NetworkIdstring

The ID of the network.

n-2zeuphj08tt7q3brd****
VSwitchIdstring

The vSwitch ID.

vsw-2zeh0r1pabwtg6wcs****
PrivateIpAddressarray

Details of the private IP addresses.

IpAddressstring

The private IP address of the instance. If a private IP address is specified, the number of private IP addresses must be 1. The private IP address must be an available IP address in the CIDR block of the vSwitch.

172.17.**.**
Tagsarray<object>

The tags of the instance.

Note This operation does not return tag information. You can call this operation in combination with the tag-related operations.
Tagsobject

The tag.

Note This operation does not return tag information. You can call this operation in combination with the tag-related operations.
TagValuestring

The tag value.

value1
TagKeystring

The tag key.

key1
AutoReleaseTimestring

The automatic release time of the instance.

2023-06-28T14:38:52Z
SpotStrategystring

The bidding policy of the preemptible instance.

NoSpot

Examples

Sample success responses

JSONformat

{
  "Code": 0,
  "PageSize": 60,
  "PageNumber": 1,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TotalCount": 2,
  "Instances": {
    "Instance": [
      {
        "CreationTime": "2019-07-26T06:40:43Z",
        "Status": "Running",
        "SpecName": "ens.sn1.stiny",
        "InstanceTypeFamily": "x86_vm",
        "InstanceResourceType": "EnsService",
        "HostName": "testHostName",
        "InstanceId": "i-instanc****",
        "InternetMaxBandwidthIn": 40,
        "InternetMaxBandwidthOut": 100,
        "EnsRegionId": "cn-hangzhou-telecom",
        "Cpu": "2",
        "ExpiredTime": "2119-07-13T02:38:57Z",
        "InstanceName": "i-5itef0f28t17bcdw9deu6meub",
        "Disk": 71680,
        "OSName": "centos 6.8 x86_64",
        "Memory": 2048,
        "ImageId": "m-****",
        "DataDisk": {
          "DataDisk": [
            {
              "device_type": "pangu",
              "disk_type": "system",
              "Size": 51200,
              "DiskName": "DiskName",
              "uuid": "d-5itef1wtxj961mbff8xe9****",
              "storage": 20480,
              "DiskId": "d-5ip4c2dhmas0vjd5u1r****",
              "Category": "file",
              "name": "name",
              "DiskSize": 100,
              "EncryptKeyId": "",
              "Encrypted": true
            }
          ]
        },
        "PublicIpAddresses": {
          "PublicIpAddress": [
            {
              "Ip": "119.147.xx.xx",
              "GateWay": "119.147.xx.xx",
              "Isp": "unicom"
            }
          ]
        },
        "PrivateIpAddresses": {
          "PrivateIpAddress": [
            {
              "Ip": "119.147.xx.xx",
              "GateWay": "119.147.xx.xx",
              "Isp": "cmcc"
            }
          ]
        },
        "SecurityGroupIds": {
          "SecurityGroupId": [
            "sg-5kyicq2kfcapxrdds6ta****"
          ]
        },
        "InnerIpAddress": {
          "IpAddress": [
            "10.170.xx.xx"
          ]
        },
        "PublicIpAddress": {
          "IpAddress": [
            "119.147.xx.xx"
          ]
        },
        "SystemDisk": {
          "device_type": "pangu",
          "disk_type": "system",
          "Size": 51200,
          "DiskName": "DiskName",
          "uuid": "d-5ip4c2dhmas0rn7rt0p96****",
          "storage": 20480,
          "DiskId": "d-5ip4c2dhmas0rn7rt0p9****",
          "Category": "file",
          "name": "DiskName"
        },
        "NetworkAttributes": {
          "NetworkId": "n-2zeuphj08tt7q3brd****",
          "VSwitchId": "vsw-2zeh0r1pabwtg6wcs****",
          "PrivateIpAddress": {
            "IpAddress": [
              "172.17.**.**"
            ]
          }
        },
        "Tags": {
          "Tags": [
            {
              "TagValue": "value1",
              "TagKey": "key1"
            }
          ]
        },
        "AutoReleaseTime": "2023-06-28T14:38:52Z",
        "SpotStrategy": "NoSpot",
        "KeyPairName": ""
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterThe input parameter domainName that is mandatory for processing this request is not supplied.-
400InstanceIdNotFoundThe input parameter instancdId that is not found.The specified instance ID does not exist.
400NoPermissionPermission denied.-
400CallInterfaceCall Interface Happen Error.An error occurred when you call the operation.
400InvalidParameter.%sThe specified field %s invalid. Please check it again.-

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

Change history

Change timeSummary of changesOperation
2024-10-17The Error code has changed. The response structure of the API has changedView Change Details
2024-08-27The Error code has changed. The response structure of the API has changedView Change Details
2024-08-22The Error code has changed. The response structure of the API has changedView Change Details
2024-05-23The Error code has changed. The request parameters of the API has changedView Change Details
2024-04-09The Error code has changed. The response structure of the API has changedView Change Details
2024-01-25The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-01-04The Error code has changed. The response structure of the API has changedView Change Details