Describes a list of the resources available in a certain zone. For example, you can retrieve the resource list in a zone before creating an ECS instance (RunInstances) in the zone.
Description
When you call this interface, consider the following:
- If you do not specify the
ZondId
parameter, the system returns resources that match the other criteria in all zones in the (RegionId
) region. - You can specify the
DestinationResource
parameter to retrieve different types of resource lists, and specify other parameters to refine your search. Options for the DestinationResourceDestinationResource
parameter have dependencies. When you select an option, the options to the left of the option in the chain are also required.- Sequence: (
Zone
) >IoOptimized
>InstanceType
>SystemDisk
>Datadisk
- Samples of parameter values in the sequence:
- If you set
DestinationResource
toSystemDisk
, you must specify theIoOptimized
andInstanceType
. - If you set
DestinationResource
toInstanceType
, you must specify theIoOptimized
. - If you set
DestinationResource
toDataDisk
, you must specify theIoOptimized
,InstanceType
, andSystemDiskCategory
.
- If you set
- Sequence: (
Request parameters
Name | Type | Required | Description |
---|---|---|---|
Action | String | Yes | The name of this interface. Value: DescribeAvailableResource. |
RegionId | String | Yes | ID of the target region. You can call DescribeRegions to obtain the latest region list. |
DestinationResource | String | Yes | Resource type to query. Optional values:
|
ZoneId | String | No | Zone ID. If you do not specify ZoneId , the system returns resources that match the other criteria in all zones throughout the current region. |
InstanceChargeType | String | No | Billing method of resources. For more information, see pricing overview. Optional values:
|
SpotStrategy | String | No | Sets your expected spot price for preemptible instances. Optional values:
InstanceChargeType must be set to PostPaid to make SpotStrategy valid. |
IoOptimized | String | No | Whether it is an I/O-optimized instance or not. Optional values:
DestinationResource to InstanceType , SystemDisk or DataDisk , you must specify IoOptimized as well. |
InstanceType | String | No | Instance type. For more information, see instance Type Family, or call DescribeInstanceTypes to obtain the latest type list. If you set DestinationResource to SystemDisk or DataDisk , you must specify the InstanceType . |
Systemdiskcategory | String | No | System disk category. Optional values:
|
Datadiskcategory | String | No | Data disk category. Optional values:
|
NetworkCategory | String | No | Network type of an ECS instance. Optional values:
|
Response parameters
Name | Type | Description |
---|---|---|
AvailableZones | Array of AvailableZoneType | A collection of zone types |
AvailableZoneType
Name | Type | Description |
---|---|---|
RegionId | String | Region ID. |
ZoneId | String | Zone ID. |
Status | String | Resource status. Possible values:
|
AvailableResources | Array of AvailableResourcesType | A collection of available resource types. |
AvailableResourcesType
Name | Type | Description |
---|---|---|
Type | String | The type of the ECS resource. Possible values:
|
SupportedResources | Array of SupportedResourcesType | A collection of supported available resource types. |
SupportedResourcesType
Name | Type | Description |
---|---|---|
Value | String | Name of the Resource. |
Status | String | Resource status. Possible values:
|
Min | Integer | Minimum limit of a resource type. No value is returned if the parameter is null. |
Max | Integer | Maximum limit of a resource type. No value is returned if the parameter is null. |
Unit | Integer | Resource type unit. No value is returned if the parameter is null. |
Examples
Request example
https://ecs.aliyuncs.com/?Action=DescribeAvailableResource
&RegionId=cn-hangzhou
&<Common Request Parameters>
Response example
XML format
<DescribeAvailableResourceResponse>
<AvailableZones>
<AvailableZone>
<ZoneId>cn-hangzhou-d</ZoneId>
<RegionId>cn-hangzhou</RegionId>
<Status>Available</Status>
<AvailableResources>
<AvailableResource>
<Type>instanceType</Type>
<SupportedResources>
<SupportedResource>
<Value>ecs.d1ne.xlarge</Value>
<Status>Available</Status>
</SupportedResource>
<SupportedResource>
<Value>ecs.d1ne. 2xlarge</Value>
<Status>Available</Status>
</SupportedResource>
</SupportedResources>
</AvailableResource>
</AvailableResources>
</AvailableZone>
<AvailableZone>
<ZoneId>cn-hangzhou-e</ZoneId>
<RegionId>cn-hangzhou</RegionId>
<Status>Available</Status>
<AvailableResources>
<AvailableResource>
<Type>instanceType</Type>
<SupportedResources>
<SupportedResource>
<Value>ecs.d1ne.xlarge</Value>
<Status>Available</Status>
</SupportedResource>
<SupportedResource>
<Value>ecs.d1ne. 2xlarge</Value>
<Status>Available</Status>
</SupportedResource>
</SupportedResources>
</AvailableResource>
</AvailableResources>
</AvailableZone>
</AvailableZones>
<RequestId>6DB97BCC-92BA-424D-A7C8-3F6486612BAE</RequestId>
</DescribeAvailableResourceResponse>
JSON format
{
"RequestId": "D0233A65-7F00-4B50-8023-101427229D4F",
"AvailableZones": {
"AvailableZone": [
{
"Status": "available",
"RegionId": "cn-hangzhou",
"AvailableResources": {
"AvailableResource": [
{
"Type": "instanceType",
"SupportedResources": {
"SupportedResource": [
{
"Status": "available",
"Value": "ecs.sn1ne.xlarge"
},
{
"Status": "available",
"Value": "ecs.sn2ne.xlarge"
}
]
}
}
]
},
"ZoneId": "cn-hangzhou-e",
}
]
}
}
Error codes
Error codes specific to this interface are as follows. For more information, see API Error Center.
Error code | Error messages | HTTP status code | Meaning |
---|---|---|---|
Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | 400 | You must specify the DestinationResource . |
Invalid.InstanceChargeType | The specified InstanceChargeType is not valid. | 400 | The specified InstanceChargeType does not exist. |
Invalid.IoOptimized | The specified IoOptimized is not valid. | 404 | The specified parameter IoOptimized is invalid. |
Invalid.NetworkCategory | The specified NetworkCategory is not valid. | 404 | The specified NetworkCategory is invalid. |
InvalidRegionId.NotFound | The specified RegionId does not exist. | 404 | The specified RegionId does not exist. |
Unavailable.Regions | The available regions does not exists. | 404 | You are not allowed to access the specified RegionId . |