You need to enable JavaScript to run this app.
导航

ListSupportedResourceTypes

最近更新时间2024.02.26 20:17:36

首次发布时间2022.06.27 21:21:35

查询容器服务支持的周边产品的资源类型列表。

请求参数

调用该 API 时的请求参数如下,除此之外还需传入公共请求参数。公共请求参数说明,请参见 公共参数

参数名称类型是否必选示例值描述
ActionStringListSupportedResourceTypes公共参数,本接口值:ListSupportedResourceTypes。
VersionString2022-05-12公共参数,本接口值:2022-05-12。
FilterObject SupportedResourceTypesFilter要是查询的资源类型筛选条件。
PageNumberInteger1分页查询时的起始页码,从 1 开始,默认为 1。
PageSizeInteger10分页查询时每页显示的记录数,取值:
  • 最小值:1
  • 最大值:100
  • 默认值:10

SupportedResourceTypesFilter

参数名参数类型是否必选示例值说明

ZoneIds

Array of String

["cn-beijing-a"]

可用区 ID 列表。

请参见 地域和可用区,获取可用区 ID(ZoneID)。

说明

不传参数值时返回指定 Region 下所有可用区下的资源信息。

ResourceTypes

Array of String

["Ecs","Zone"]

返回的资源类型,目前支持两种资源类型:

  • Ecs:云服务器(ECS)资源。
  • Zone:可用区类型资源。

不传参数值时,返回容器服务支持的所有资源类型。

请求示例

POST /?Action=ListSupportedResourceTypes&Version=2022-05-12 HTTP/1.1
Content-Type:application/json
{
    "PageNumber": 1,
    "PageSize": 10,
    "Filter": {
        "ZoneIds": ["cn-beijing-a"],
        "ResourceTypes": ["Ecs","Zone"]
    }
}

返回参数

本接口返回参数如下表所示,公共返回参数请参见 返回结果

参数名称类型示例值描述
ItemsArray of Object SupportedResourceTypesResponse支持的资源类型及规格的列表。
PageNumberInteger1当前页码。
PageSizeInteger10每页显示的资源类型数。
TotalCountInteger100返回数据列表的总量。

SupportedResourceTypesResponse

参数名称类型示例值描述

ResourceScope

String

Zone

资源所属范围,参数值说明:

  • Zone:可用区。
  • Region:地域。
ZoneIdStringcn-beijing-a资源所支持的具体可用区 ID。

ResourceType

String

Ecs

资源类型,参数值说明:

  • Ecs:云服务器(ECS)资源。
  • Zone:可用区资源。

ResourceSpecifications

Array of String

["ecs.c1.large"]

资源的对应规格列表。
当前仅支持云服务器类型的资源。云服务器规格说明,请参见 DescribeInstanceTypes 接口中的 InstanceTypeId 参数说明。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202205151028090****",
        "Action": "ListSupportedResourceTypes",
        "Version": "2022-05-12",
        "Service": "vke",
        "Region": "cn-beijing"
    },
    "Result": {
        "TotalCount": 2,
        "PageNumber": 1,
        "PageSize": 10,
        "Items": [
            {
                "ResourceScope": "Zone",
                "ZoneId": "cn-beijing-a",
                "ResourceType": "Ecs",
                "ResourceSpecifications": [
                    "ecs.c1.large"
                ]
            },
            {
                "ResourceScope": "Region",
                "ZoneId": "",
                "ResourceType": "Zone",
                "ResourceSpecifications": [
                    "cn-beijing-a"
                ]
            }
        ]
    }
}

错误码

本接口无专有错误码,公共错误码请参见 公共错误码