调用DescribeResourcesModification查询升级和降配实例规格或者系统盘时,某一可用区的可用资源信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeResourcesModification |
系统规定参数。取值:DescribeResourcesModification |
DestinationResource | String | 是 | InstanceType |
目标资源类型。取值范围:
|
RegionId | String | 是 | cn-hangzhou |
目标地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
ResourceId | String | 是 | i-bp67acfmxazb4p**** |
资源ID。例如,当待查询的资源为实例时,可以理解为InstanceId。 |
OperationType | String | 否 | Upgrade |
更改资源配置的操作类型。
默认值:Upgrade |
MigrateAcrossZone | Boolean | 否 | true |
是否支持跨集群升级实例规格。取值范围:
默认值:false 当参数MigrateAcrossZone取值为true时,一旦您根据返回信息升级了云服务器,请留意以下注意事项:
|
InstanceType | String | 否 | ecs.g5.large |
实例规格。更多详情,请参见实例规格族,也可以调用DescribeInstanceTypes 接口获得最新的规格表。当参数DestinationResource取值为SystemDisk时,必须同时指定InstanceType参数。 |
Cores | Integer | 否 | 2 |
实例规格的vCPU内核数目。取值参见实例规格族。当DestinationResource=InstanceType参数有效,Cores才为有效参数。 |
Memory | Float | 否 | 8.0 |
实例规格的内存大小,单位为GiB。取值参见实例规格族。当DestinationResource=InstanceType,Memory才为有效参数。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
AvailableZones | Array |
数据中心信息AvailableZone组成的集合。 |
|
AvailableZone | |||
AvailableResources | Array |
可供创建的具体资源组成的数组。 |
|
AvailableResource | |||
SupportedResources | Array |
支持的可供创建的具体资源组成的数组。 |
|
SupportedResource | |||
Max | Integer | 2 |
资源规格的最大值,该参数值为空时不返回。 |
Min | Integer | 1 |
资源规格的最小值,该参数值为空时不返回。 |
Status | String | Available |
资源状态。可能值:
|
StatusCategory | String | WithStock |
根据库存详细分类资源类别。可能值:
|
Unit | String | null |
资源规格单位,该参数值为空时不返回。 |
Value | String | ecs.g5.large |
资源值。 |
Type | String | InstanceType |
资源类型。可能值:
|
RegionId | String | cn-hangzhou |
地域ID。 |
Status | String | Available |
资源状态。可能值:
|
StatusCategory | String | WithStock |
根据库存详细分类资源类别。可能值:
|
ZoneId | String | cn-hangzhou-e |
可用区ID。 |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
请求ID。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&DestinationResource=InstanceType
&RegionId=cn-hangzhou
&ResourceId=i-bp67acfmxazb4p****
&MigrateAcrossZone=true
&OperationType=Upgrade
&InstanceType=ecs.g5.large
&<公共请求参数>
正常返回示例
XML
格式
<DescribeResourcesModificationResponse>
<RequestId>994F2B60-B050-49E3-9283-44655FAC7A4X</RequestId>
<AvailableZones>
<AvailableZone>
<Status>Available</Status>
<RegionId>cn-hangzhou</RegionId>
<AvailableResources>
<AvailableResource>
<Type>InstanceType</Type>
<SupportedResources>
<SupportedResource>
<Status>Available</Status>
<Value>ecs.g5.xlarge</Value>
</SupportedResource>
<SupportedResource>
<Status>Available</Status>
<Value>ecs.t5-lc1m2.large</Value>
</SupportedResource>
<SupportedResource>
<Status>Available</Status>
<Value>ecs.t5-c1m4.2xlarge</Value>
</SupportedResource>
<SupportedResource>
<Status>Available</Status>
<Value>ecs.c5.xlarge</Value>
</SupportedResource>
</SupportedResources>
</AvailableResource>
</AvailableResources>
<ZoneId>cn-hangzhou-e</ZoneId>
</AvailableZone>
</AvailableZones>
</DescribeResourcesModificationResponse>
JSON
格式
{
"RequestId": "994F2B60-B050-49E3-9283-44655FAC7A4X",
"AvailableZones": {
"AvailableZone": [
{
"Status": "Available",
"RegionId": "cn-hangzhou",
"AvailableResources": {
"AvailableResource": [
{
"Type": "InstanceType",
"SupportedResources": {
"SupportedResource": [
{
"Status": "Available",
"Value": "ecs.g5.xlarge"
},
{
"Status": "Available",
"Value": "ecs.t5-lc1m2.large"
},
{
"Status": "Available",
"Value": "ecs.t5-c1m4.2xlarge"
},
{
"Status": "Available",
"Value": "ecs.c5.xlarge"
}
]
}
}
]
},
"ZoneId": "cn-hangzhou-e"
}
]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | Invalid.RegionId | The specified RegionId does not exist. | 地域参数无效。 |
404 | Unavailable.Regions | The available regions does not exists | 地域参数无效。 |
400 | Invalid.OperationType | The specified operationType is not valid. | 指定的参数“operationType”无效。 |
400 | Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | 目标资源类型无效。 |
404 | Invalid.ResourceType | The ResourceType provided does not exist in our records. | 资源类型无效。 |
404 | Invalid.DestinationResource | The specified DestinationResource is not valid. | 指定的目标资源无效。 |
404 | Invalid.IoOptimized | The specified IoOptimized is not valid. | 指定的参数“IoOptimized”无效。 |
404 | Invalid.NetworkCategory | The specified NetworkCategory is not valid. | 指定的参数“NetworkCategory”无效。 |
404 | Invalid.SpotStrategy | The specified SpotStrategy is not valid. | 竞价策略参数无效。 |
400 | Invalid.InstanceChargeType | The specified InstanceChargeType is not valid. | 指定的参数“InstanceChargeType”无效。 |
404 | Invalid.ResourceId | The specified ResourceId is not valid. | 指定的参数“ResourceId”无效。 |
404 | Invalid.InstancePayType | The specified InstancePayType is not valid. | 指定的参数“InstanceChargeType”无效。 |
404 | OperationDenied | The specified operation is denied as this instanceType is not support. | 实例规格不支持当前操作。 |
403 | InvalidDedicatedHostId.NotFound | The specified DedicatedHostId does not exist in our records. | 指定的宿主机在当前地域中不存在。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId provided does not exist in our records. | 指定的实例不存在,请确认参数是否正确。 |
404 | InvalidResourceId.NotFound | The specified ResourceId is not found in our records | 指定的参数“ResourceId”无效,请确认该资源是否存在。 |
403 | InvalidParam.TypeAndCpuMem.Conflict | The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time. | 参数“InstanceType”、“Cores”、“Memory”不能同时为空。 |
403 | InvalidParam.Cores | The specified parameter 'Cores' should be empty | 指定的参数“Cores”应该为空。 |
403 | InvalidParam.Memory | The specified parameter 'Memory' should be empty | 指定的参数“Memory”应为空。 |
访问错误中心查看更多错误码。