全部产品
Search
文档中心

云服务器 ECS:DescribeInstanceAttachmentAttributes

更新时间:Sep 04, 2023

调用DescribeInstanceAttachmentAttributes查询实例匹配的私有池信息。

接口说明

私有池是弹性保障服务或容量预定服务在创建后生成的,关联了与私有池匹配的实例信息。您可以在创建实例时设置私有池,实例将会与弹性保障服务或容量预定服务进行匹配。

当私有池失效后,实例与私有池的匹配关联数据也会失效。此时调用该接口,返回值的私有池信息将为空。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String DescribeInstanceAttachmentAttributes

系统规定参数。取值:DescribeInstanceAttachmentAttributes

RegionId String cn-hangzhou

弹性保障服务所属地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。

InstanceIds String ["i-bp67acfmxazb4****", "i-bp67acfmxazb5****", "i-bp67acfmxazb6****"]

实例ID。取值可以由多个实例ID组成一个JSON数组,最多支持100个ID,ID之间用半角逗号(,)隔开。

PageNumber Integer 1

实例状态列表的页码。

起始值:1。

默认值:1。

PageSize Integer 10

分页查询时设置的每页行数。

最大值:100。

默认值:10。

返回数据

名称

类型

示例值

描述

PageSize Integer 10

分页查询时设置的每页行数。

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

请求ID。

PageNumber Integer 1

实例状态列表的页码。

TotalCount Integer 1

符合查询条件的记录条数。

Instances Array of Instance

实例匹配的私有池信息组成的集合。

Instance
InstanceId String i-bp67acfmxazb4****

实例ID。

PrivatePoolOptionsMatchCriteria String Open

实例的私有池匹配模式。可能值:

  • Open:开放模式。实例自动匹配开放类型的私有池。
  • Target:指定模式。实例匹配指定的私有池。
  • None:不使用模式。实例不使用私有池。
PrivatePoolOptionsId String eap-bp67acfmxazb4****

私有池ID。当PrivatePoolOptionsMatchCriteria返回值为Open时,私有池ID为系统自动匹配时所分配的私有池ID。

示例

请求示例

https://ecs.aliyuncs.com/?Action=DescribeInstanceAttachmentAttributes
&RegionId=cn-hangzhou
&InstanceIds=["i-bp67acfmxazb4****", "i-bp67acfmxazb5****", "i-bp67acfmxazb6****"]
&<公共请求参数>

正常返回示例

XML格式

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

<DescribeInstanceAttachmentAttributesResponse>
    <Instances>
        <Instance>
            <InstanceId>i-bp67acfmxazb4****</InstanceId>
            <PrivatePoolOptionsMatchCriteria>Open</PrivatePoolOptionsMatchCriteria>
            <PrivatePoolOptionsId>eap-bp67acfmxazb4****</PrivatePoolOptionsId>
        </Instance>
    </Instances>
    <TotalCount>1</TotalCount>
    <RequestId>395245CB-A6FD-4777-8F83-A0B0DFE43F23</RequestId>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
</DescribeInstanceAttachmentAttributesResponse>

JSON格式

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

{
  "Instances" : {
    "Instance" : [ {
      "InstanceId" : "i-bp67acfmxazb4****",
      "PrivatePoolOptionsMatchCriteria" : "Open",
      "PrivatePoolOptionsId" : "eap-bp67acfmxazb4****"
    } ]
  },
  "TotalCount" : 1,
  "RequestId" : "395245CB-A6FD-4777-8F83-A0B0DFE43F23",
  "PageSize" : 10,
  "PageNumber" : 1
}

错误码

HttpCode

错误码

错误信息

描述

400 MissingParameter.RegionId The specified RegionId should not be null. RegionId是必选参数。
400 DedicatedHostNotSupported DedicatedHost is not supported for PrivatePool. 私有池不支持专有宿主机。
400 SpotNotSupported Spot is not supported for PrivatePool. 私有池不支持抢占式实例。
400 ClassicNetworkNotSupported Classic network is not supported for PrivatePool. 私有池不支持经典网络类型实例。
400 Invalid.InstanceId Instance does not exist. 实例不存在。
400 Invalid.PrivatePoolOptions.MatchCriteria Target mode does not support this operation. Target模式不支持本次操作。
400 MissingParameter.PrivatePoolOptions.Id The specified PrivatePoolOptions.Id should not be null. PrivatePoolOptions.Id 参数不能为空。
400 Invalid.PrivatePoolOptions.Id The PrivatePool does not exist. 私有池不存在。
400 Invalid.InstanceType The InstanceType does not match the PrivatePool. 实例类型与私有池不匹配。
400 Invalid.InstanceChargeType The InstanceChargeType does not match the PrivatePool. 实例计费类型与私有池不匹配。
400 Invalid.ZoneId The ZoneId does not match the PrivatePool. 可用区与私有池不匹配。
400 Invalid.PrivatePoolOptions.MatchCriteria The PrivatePoolOptions.MatchCriteria does not match the PrivatePool. 指定的PrivatePoolOptions.MatchCriteria参数与私有池不匹配。
400 InvalidPlatform.ValueNotSupported The Platform does not match the PrivatePool. 指定的Platform参数与私有池不匹配。
400 InvalidAliUid The PrivatePool does not belong to the user of the Instance. 私有池不属于创建实例的用户。
400 Invalid.InstanceId The Instance dose not attached to a PrivatePool. 实例未与私有池匹配。
400 Invalid.TooManyPrivatePoolOptions.Ids Too many PrivatePoolOptions.Ids in this request. PrivatePoolOptions.Ids参数超过上限。
400 Invalid.TooManyZoneIds Too many ZoneIds in the request. ZoneIds参数超过上限。
400 Invalid.TooManyInstanceTypes Too many InstanceTypes in the request. InstanceTypes参数超过上限。
400 Invalid.TooManyUnpaidPrivatePool Too many PrivatePools create but still unpaid. 多个私有池未支付。
400 Invalid.InstanceCpuCoreCountOrInstanceAmount Both InstanceCpuCoreCount and InstanceAmount are provided. InstanceCpuCoreCount和InstanceAmount两个参数不需要同时提供。
400 Invalid.PrivatePool.Purchase The PrivatePool has already paid. 私有池已经支付。
400 Invalid.AssuranceTimes.NotSupported The value of AssuranceTimes is not supported. AssuranceTimes参数值不支持。
400 RepeatStartPrivatePool PrivatePool has already been started. 私有池已经启动。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 内部错误,请重试。
404 InvalidInstanceIds.NotFound The specified InstanceIds does not exist. 指定的 InstanceId 不存在。请检查 InstanceId 参数值是否正确。您可以调用 DescribeInstances 查询指定实例的状态。

访问错误中心查看更多错误码。