最近更新时间:2023.09.12 15:24:16
首次发布时间:2021.10.31 07:37:16
调用 DescribeAvailableResource 接口查询可用区中计算资源的库存信息,包括所属地域、可用区、计算资源库存状态等。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeAvailableResource | 要执行的操作,取值:DescribeAvailableResource。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
DestinationResource | String | 是 | InstanceType | 要查询的资源类型,取值: |
ZoneId | String | 否 | cn-beijing-a | 可用区ID,您可以调用DescribeZones查询一个地域下的可用区信息。 说明 默认为空,表示返回当前地域(RegionId)下的所有可用区中所有符合条件的资源。 |
InstanceTypeId | String | 否 | ecs.g2i.large | 指定一个要查询的资源规格。 |
InstanceChargeType | String | 否 | PostPaid | 资源的计费类型,取值:
|
SpotStrategy | String | 否 | NoSpot | 按量计费的抢占式策略,取值:
说明 当 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
AvailableZones | Array of Struct | - | 可用区中符合条件的资源的信息,具体请参见下表“ AvailableZone结构 ”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Status | String | Available | 可用区的资源库存状态,取值: |
RegionId | String | cn-beijing | 可用区所属地域ID。 |
ZoneId | String | cn-beijing-a | 可用区ID。 |
AvailableResources | Array of Struct | - | 可用区中各资源的具体信息,具体请参见下表“ AvailableResource结构 ”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Type | String | InstanceType | 资源的类型。 |
SupportedResources | Array of Struct | - | 资源的具体信息,具体请参见下表“ SupportedResource结构 ”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Status | String | Available | 资源的库存状态,取值: |
Value | String | ecs.g2i.large | 资源的取值。 |
GET /?Action=DescribeAvailableResource&Version=2020-04-01&DestinationResource=InstanceType&ZoneId=cn-*****&InstanceTypeId=ecs.g2i.large HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "2021062415303301022514515207C4****", "Action": "DescribeAvailableResource", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "AvailableZones": [{ "AvailableResources": [{ "SupportedResources": [{ "Status": "Available", "Value": "ecs.g2i.large" }], "Type": "InstanceType" }], "RegionId": "cn-beijing", "Status": "Available", "ZoneId": "cn-beijing-a" }] } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidDestinationResource | The specified DestinationResource is not valid, is unsupported, or cannot be used. | 指定的目标资源类不合法。 |
400 | MissingParameter.DestinationResource | The required parameter DestinationResource is not supplied. | 目标资源类型为空。 |
400 | InvalidInstanceChargeType | The specified InstanceChargeType is invalid. | 指定的实例计费类型不合法。 |
400 | InvalidSpotStrategy | The specified SpotStrategy is invalid. | 指定的实例抢占策略不合法。 |
404 | InvalidZone.NotFound | The specified zone does not exist. | 指定的可用区不存在。 |
404 | InvalidInstanceType.NotFound | The specified InstanceType does not exist. | 指定的实例规格不存在。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |