调用DescribeInstanceTypes查询云服务器ECS提供的所有实例规格的信息,也可以查询指定实例规格的信息。
接口说明
调用接口前,您需要注意:
- 推荐您设置MaxResults与NextToken参数进行分页查询。具体使用说明:首次调用该接口时,您设置MaxResults参数以限制返回值中实例规格的条目数,如果一次调用只返回了部分被查询到的实例规格的条目数,则会同步返回NextToken参数值。您可以再次调用该接口,设置上次调用该接口返回的NextToken参数值以及MaxResults参数,以实现分页查询实例规格信息。
- DescribeInstanceTypes仅查询实例规格的配置和性能信息。如果您需要查询具体地域下可购买的实例规格,请使用DescribeAvailableResource。
- 如果您需要使用非售卖可见的实例规格或特别的规格需求,请提交工单联系阿里云。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 | 
|---|---|---|---|---|
| Action | String | 是 | DescribeInstanceTypes | 系统规定参数。取值:DescribeInstanceTypes。 | 
| InstanceTypeFamily | String | 否 | ecs.g6 | 实例规格所属的实例规格族。取值请参见DescribeInstanceTypeFamilies。 关于实例规格族的更多信息,请参见实例规格族。 | 
| MaxResults | Long | 否 | 10 | 分页查询时每页的最大条目数。最大值:1600 默认值:1600 | 
| NextToken | String | 否 | e71d8a535bd9cc11 | 查询凭证(Token)。取值为上一次调用该接口返回的NextToken参数值,初次调用接口时无需设置该参数。 | 
| InstanceTypes.N | String | 否 | ecs.g6.large | 指定查询的实例规格。N表示可以设置多个实例规格,N的取值范围:1~10。当该参数不传值时,默认查询所有实例规格的信息。 | 
返回数据
| 名称 | 类型 | 示例值 | 描述 | 
|---|---|---|---|
| RequestId | String | 00827261-20B7-4562-83F2-4DF39876A45A | 请求ID。 | 
| InstanceTypes | Array of InstanceType | 实例规格集合。 | |
| InstanceType | |||
| EniTotalQuantity | Integer | 0 |  
           说明 该参数正在邀测中,暂未开放使用。 
           | 
| LocalStorageCategory | String | local_ssd_pro | 本地盘类型。更多信息,请参见本地盘。可能值: 
 | 
| PrimaryEniQueueNumber | Integer | 4 | 主网卡默认队列数。 | 
| MemorySize | Float | 16 | 内存大小。单位:GiB | 
| LocalStorageCapacity | Long | 5000 | 实例挂载的本地盘的单盘容量。单位:GiB | 
| InstanceFamilyLevel | String | EnterpriseLevel | 实例规格族级别。可能值: 
 | 
| InstancePpsRx | Long | 500000 | 内网入方向网络收发包能力。单位:Pps | 
| EniIpv6AddressQuantity | Integer | 1 | 单块弹性网卡的IPv6地址上限。 | 
| MaximumQueueNumberPerEni | Integer | 4 | 单块弹性网卡最大队列数。 | 
| InstanceTypeId | String | ecs.g6.large | 实例规格ID。 | 
| InstanceBandwidthRx | Integer | 1024000 | 内网入方向带宽限制。单位:kbit/s | 
| SecondaryEniQueueNumber | Integer | 4 | 辅助弹性网卡默认队列数。 | 
| GPUSpec | String | NVIDIA V100 | GPU类型。 | 
| InstanceBandwidthTx | Integer | 1024000 | 内网出方向带宽限制。单位:kbit/s | 
| QueuePairNumber | Integer | 0 |  
           说明 该参数正在邀测中,暂未开放使用。 
           | 
| EriQuantity | Integer | 0 |  
           说明 该参数正在邀测中,暂未开放使用。 
           | 
| GPUAmount | Integer | 0 | GPU数量。 | 
| TotalEniQueueQuantity | Integer | 12 | 实例规格允许修改的弹性网卡队列数总配额。 | 
| NvmeSupport | String | unsupported | 实例规格所挂载的云盘是否支持NVMe。可能值: 
 | 
| DiskQuantity | Integer | 17 | 支持挂载的云盘数量上限。 | 
| InitialCredit | Integer | 120 | 突发性能实例t5、t6的初始vCPU积分值。 | 
| LocalStorageAmount | Integer | 1 | 实例挂载的本地盘的数量。 | 
| BaselineCredit | Integer | 4 | 突发性能实例t5、t6的基准vCPU计算性能(所有vCPU之和)。 | 
| InstancePpsTx | Long | 500000 | 内网出方向网络收发包能力。单位:Pps | 
| EniPrivateIpAddressQuantity | Integer | 10 | 单块弹性网卡的私有IP地址上限。 | 
| CpuCoreCount | Integer | 4 | vCPU内核数目。 | 
| InstanceTypeFamily | String | ecs.g6 | 实例规格族。 | 
| EniQuantity | Integer | 3 | 支持挂载的弹性网卡上限。 | 
| EniTrunkSupported | Boolean | true |  
           说明 该参数正在邀测中,暂未开放使用。 
           | 
| NextToken | String | e71d8a535bd9cc11 | 本次调用返回的查询凭证(Token)。 | 
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeInstanceTypes &InstanceTypeFamily=ecs.g6 &InstanceTypes.1=ecs.g6.large &<公共请求参数>
正常返回示例
XML格式 
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeInstanceTypesResponse>
    <RequestId>00827261-20B7-4562-83F2-4DF39876A45A</RequestId>
    <NextToken/>
    <InstanceTypes>
        <InstanceType>
            <InstancePpsTx>500000</InstancePpsTx>
            <NvmeSupport>unsupported</NvmeSupport>
            <PrimaryEniQueueNumber>4</PrimaryEniQueueNumber>
            <TotalEniQueueQuantity>12</TotalEniQueueQuantity>
            <EniTrunkSupported>true</EniTrunkSupported>
            <InstanceTypeFamily>ecs.g6</InstanceTypeFamily>
            <InstancePpsRx>500000</InstancePpsRx>
            <EriQuantity>0</EriQuantity>
            <InstanceBandwidthRx>1024000</InstanceBandwidthRx>
            <InstanceBandwidthTx>1024000</InstanceBandwidthTx>
            <SecondaryEniQueueNumber>4</SecondaryEniQueueNumber>
            <LocalStorageCategory/>
            <GPUSpec/>
            <InstanceTypeId>ecs.g6.xlarge</InstanceTypeId>
            <MemorySize>16</MemorySize>
            <MaximumQueueNumberPerEni>4</MaximumQueueNumberPerEni>
            <EniIpv6AddressQuantity>1</EniIpv6AddressQuantity>
            <EniTotalQuantity>5</EniTotalQuantity>
            <CpuCoreCount>4</CpuCoreCount>
            <EniQuantity>3</EniQuantity>
            <GPUAmount>0</GPUAmount>
            <DiskQuantity>17</DiskQuantity>
            <InstanceFamilyLevel>EnterpriseLevel</InstanceFamilyLevel>
            <EniPrivateIpAddressQuantity>10</EniPrivateIpAddressQuantity>
        </InstanceType>
    </InstanceTypes>
</DescribeInstanceTypesResponse> 
     JSON格式 
HTTP/1.1 200 OK
Content-Type:application/json
{
  "RequestId" : "00827261-20B7-4562-83F2-4DF39876A45A",
  "NextToken" : "",
  "InstanceTypes" : {
    "InstanceType" : [ {
      "InstancePpsTx" : 500000,
      "NvmeSupport" : "unsupported",
      "PrimaryEniQueueNumber" : 4,
      "TotalEniQueueQuantity" : 12,
      "EniTrunkSupported" : true,
      "InstanceTypeFamily" : "ecs.g6",
      "InstancePpsRx" : 500000,
      "EriQuantity" : 0,
      "InstanceBandwidthRx" : 1024000,
      "InstanceBandwidthTx" : 1024000,
      "SecondaryEniQueueNumber" : 4,
      "LocalStorageCategory" : "",
      "GPUSpec" : "",
      "InstanceTypeId" : "ecs.g6.xlarge",
      "MemorySize" : 16,
      "MaximumQueueNumberPerEni" : 4,
      "EniIpv6AddressQuantity" : 1,
      "EniTotalQuantity" : 5,
      "CpuCoreCount" : 4,
      "EniQuantity" : 3,
      "GPUAmount" : 0,
      "DiskQuantity" : 17,
      "InstanceFamilyLevel" : "EnterpriseLevel",
      "EniPrivateIpAddressQuantity" : 10
    } ]
  }
} 
    错误码
访问错误中心查看更多错误码。