查詢升級和降配執行個體規格或者系統盤時,某一可用性區域的可用資源資訊。
請求參數
| 名稱 | 類型 | 是否必需 | 描述 |
|---|---|---|---|
| Action | String | 是 | 系統規定參數。取值:DescribeResourcesModification |
| RegionId | String | 是 | 目標地域ID。您可以調用DescribeRegions查看最新的阿里雲地域列表。 |
| ResourceId | String | 是 | 資源ID。例如,當待查詢的資源為執行個體時,可以理解為 InstanceId。 |
| DestinationResource | String | 是 | 目標資源類型。取值範圍:
|
| Cores | Integer | 否 | 執行個體規格的vCPU核心數目。取值參閱執行個體規格類型系列。當DestinationResource=InstanceType參數有效,Cores才為有效參數。 |
| Memory | Integer | 否 | 執行個體規格的記憶體大小,單位為GiB。取值參閱執行個體規格類型系列。當DestinationResource=InstanceType,Memory才為有效參數。 |
| MigrateAcrossZone | Boolean | 否 | 是否支援跨叢集升級執行個體規格。取值範圍:
MigrateAcrossZone取值為True時,一旦您根據返回資訊升級了雲伺服器,請留意以下注意事項:
|
| OperationType | String | 否 | 更改預付費(訂用帳戶)配置的操作類型。取值範圍:
|
| InstanceType | String | 否 | 執行個體規格。更多詳情,請參閱執行個體規格類型系列,也可以調用DescribeInstanceTypes介面獲得最新的規格表。當參數DestinationResource取值為SystemDisk時,必須同時指定InstanceType參數。 |
返回參數
| 名稱 | 類型 | 描述 |
|---|---|---|
| AvailableZones | Array of AvailableZones |
資料中心資訊AvailableZoneType組成的集合 |
AvailableZoneType
| 名稱 | 類型 | 描述 |
|---|---|---|
| RegionId | String | 地域ID |
| ZoneId | String | 可用性區域ID |
| Status | String | 資源狀態,傳回值:
|
| AvailableResources | Array of AvailableResourcesType |
可供建立的具體資源群組成的數組 |
AvailableResourcesType
| 名稱 | 類型 | 描述 |
|---|---|---|
| Type | String | 資源類型。傳回值:
|
| SupportedResources | Array of SupportedResourcesType |
支援的可供建立的具體資源群組成的數組 |
SupportedResourcesType
| 名稱 | 類型 | 描述 |
|---|---|---|
| Value | String | 資源值 |
| Status | String | 資源狀態,傳回值:
|
| Min | Integer | 資源規格的最小值,該參數值為空時不返回 |
| Max | Integer | 資源規格的最大值,該參數值為空時不返回 |
| Unit | Integer | 資源規格單位,該參數值為空時不返回 |
樣本
請求樣本
https://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&DestinationResource=InstanceType
&RegionId=cn-hangzhou
&<公共請求參數>
返回樣本
XML格式
<DescribeResourcesModificationResponse>
<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>
</DescribeResourcesModificationResponse>
JSON格式
{
"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",
}
]
}
}
錯誤碼
以下為本介面特有的錯誤碼。更多錯誤碼,請訪問 API錯誤中心 。
| 錯誤碼 | 錯誤資訊 | HTTP 狀態碼 | 說明 |
|---|---|---|---|
| Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | 400 | 您必須指定必需參數 DestinationResource。 |
| Invalid.OperationType | The specified operationType is not valid. | 400 | 指定的 OperationType 不合法。 |
| InvalidParam.Cores | The specified parameter 'Cores' should be empty | 403 | 當 DestinationResource=InstanceType,Cores 才為有效參數。 |
| InvalidParam.Memory | The specified parameter 'Memory' should be empty | 403 | 當 DestinationResource=InstanceType,Memory 才為有效參數。 |
| InvalidParam.TypeAndCpuMem.Conflict | The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time. | 403 | 當 DestinationResource=InstanceType,Cores 和 Memory 才為有效參數。 |
| Invalid.DestinationResource | The specified DestinationResource is not valid. | 404 | 指定的 DestinationResource 不合法。 |
| Invalid.IoOptimized | The specified IoOptimized is not valid. | 404 | 指定的 IoOptimized 不合法。 |
| Invalid.OperationType | The specified OperationType is not valid. | 404 | 指定的 OperationType 不合法。 |
| Invalid.RegionId | The specified RegionId does not exist. | 404 | 指定的 RegionId 不存在。 |
| Invalid.ResourceId | The specified ResourceId is not valid. | 404 | 指定的 ResourceId 不合法。 |
| Invalid.ResourceType | The ResourceType provided does not exist in our records. | 404 | 指定的 ResourceType 不存在。 |
| Invalid.SpotStrategy | The specified SpotStrategy is not valid. | 404 | 指定的 SpotStrategy 不合法。 |
| InvalidInstanceId.NotFound | The specified InstanceId provided does not exist in our records. | 404 | 指定的 InstanceId 不存在。 |
| Unavailable.Regions | The specified region is limited to access. | 404 | 指定的 RegionId 沒有許可權。 |
| InvalidRegionId.NotFound | The specified RegionId does not exist. | 404 | 指定的 RegionId 不存在。 |
| InvalidResourceId.NotFound | The specified ResourceId is not found in our records | 404 | 指定的 ResourceId 不存在。 |
| OperationDenied | The specified operation is denied as this instanceType is not support. | 404 | 指定的 InstanceType 不支援該操作。 |