(Beta)呼叫 DescribeRecommendInstanceType 根據一個指定的執行個體規格,查找一個或多個備選的執行個體規格。針對已經或者即將停售的執行個體規格,DescribeRecommendInstanceType 會羅列出作為替補的所有執行個體規格。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Cores |
integer |
否 |
ECS 執行個體 vCPU 核數。 說明
同時指定 |
2 |
| Memory |
number |
否 |
ECS 執行個體記憶體大小,單位為 GiB。 說明
同時指定 |
8.0 |
| InstanceFamilyLevel |
string |
否 |
執行個體規格族級別。取值範圍:
|
EnterpriseLevel |
| InstanceType |
string |
否 |
指定的執行個體規格。更多詳情,請參見執行個體規格族,也可以呼叫 DescribeInstanceTypes 介面獲得最新的規格表。 說明
如果您指定了 |
ecs.hfg6.large |
| NetworkType |
string |
是 |
ECS 執行個體的網路類型。取值範圍:
預設值:vpc |
vpc |
| InstanceChargeType |
string |
否 |
ECS 執行個體的計費方式。更多詳情,請參見計費概述。取值範圍:
預設值:PostPaid |
PostPaid |
| SpotStrategy |
string |
否 |
搶佔式執行個體的競價策略。取值範圍:
說明
使用 預設值:NoSpot |
NoSpot |
| IoOptimized |
string |
否 |
是否為 I/O 最佳化執行個體。執行個體規格只支援非 I/O 最佳化時,不能設定 IoOptimized 參數。取值範圍:
預設值:optimized 如果您設定的是已停售執行個體規格。預設值:none |
optimized |
| PriorityStrategy |
string |
否 |
優先推薦策略。取值範圍:
預設值:InventoryFirst |
PriceFirst |
| MaxPrice |
number |
否 |
按量付費執行個體或者搶佔式執行個體可接受的每小時最高價格。 說明
設定搶佔式執行個體的最高單價時, |
10.0 |
| RegionId |
string |
是 |
地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。 |
cn-hangzhou |
| ZoneId |
string |
否 |
可用區 ID。您可以呼叫 DescribeZones 查看最新的阿里雲可用區列表。 建議同時 ZoneMatchMode 取值為 Include(預設值),優先推薦 ZoneId 指定的可用區中的執行個體規格,並列出同地域下其他可用區中的執行個體規格。 |
cn-hangzhou-f |
| SystemDiskCategory |
string |
否 |
系統磁碟的雲端硬碟種類。取值範圍:
非 I/O 最佳化執行個體的預設值:cloud I/O 最佳化執行個體的預設值:cloud_efficiency。 |
cloud_ssd |
| ZoneMatchMode |
string |
否 |
是否僅推薦 ZoneId 指定的可用區中的執行個體規格。取值範圍:
當指定 |
Strict |
| Scene |
string |
否 |
在哪種場景下推薦執行個體規格。取值範圍:
預設值:CREATE |
CREATE |
| InstanceTypeFamily |
array |
否 |
設定備選的執行個體規格族集合,備選的執行個體規格會從該參數設定的執行個體規格族中選擇。最多可輸入 10 個執行個體規格族。 |
ecs.hfg6 |
|
string |
否 |
執行個體的規格族。規格族取值請參見執行個體規格族。您也可以呼叫 DescribeInstanceTypeFamilys 查詢規格族列表。 |
ecs.hfg6 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| Data |
object |
||
| RecommendInstanceType |
array<object> |
推薦的執行個體規格集合。 |
|
|
array<object> |
|||
| CommodityCode |
string |
執行個體規格的商品編碼。 |
ecs |
| ZoneId |
string |
執行個體規格所在的可用區 ID。 |
cn-hangzhou-h |
| Priority |
integer |
排序優先順序。 |
2 |
| NetworkType |
string |
ECS 執行個體的網路類型。 |
vpc |
| Scene |
string |
在哪種場景下推薦執行個體規格。 |
CREATE |
| SpotStrategy |
string |
搶佔式執行個體的搶佔策略。 |
NoSpot |
| RegionId |
string |
執行個體規格所在的地域 ID。 |
cn-hangzhou |
| InstanceChargeType |
string |
執行個體的計費方式。 |
PostPaid |
| Zones |
object |
||
| zone |
array<object> |
執行個體規格所在的可用區集合。 |
|
|
array<object> |
|||
| ZoneNo |
string |
執行個體規格所在的可用區 ID。 |
cn-hangzhou-h |
| NetworkTypes |
object |
||
| NetworkType |
array |
執行個體規格的網路類型集合。 |
|
|
string |
執行個體規格的網路類型。 |
vpc |
|
| InstanceType |
object |
執行個體規格名稱。 |
|
| SupportIoOptimized |
string |
執行個體規格是否支援 I/O 最佳化。 |
optimized |
| Cores |
integer |
執行個體規格的 vCPU 核數。 |
1 |
| Memory |
integer |
執行個體規格的記憶體大小,單位為 MB。 |
8192 |
| InstanceType |
string |
執行個體規格名稱。 |
ecs.hfg6.large |
| InstanceTypeFamily |
string |
執行個體規格族。 |
ecs.hfg6 |
| Generation |
string |
執行個體規格族系列。 |
ecs-4 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"Data": {
"RecommendInstanceType": [
{
"CommodityCode": "ecs",
"ZoneId": "cn-hangzhou-h",
"Priority": 2,
"NetworkType": "vpc",
"Scene": "CREATE",
"SpotStrategy": "NoSpot",
"RegionId": "cn-hangzhou",
"InstanceChargeType": "PostPaid",
"Zones": {
"zone": [
{
"ZoneNo": "cn-hangzhou-h",
"NetworkTypes": {
"NetworkType": [
"vpc"
]
}
}
]
},
"InstanceType": {
"SupportIoOptimized": "optimized",
"Cores": 1,
"Memory": 8192,
"InstanceType": "ecs.hfg6.large",
"InstanceTypeFamily": "ecs.hfg6",
"Generation": "ecs-4"
}
}
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | RecommendEmpty.InstanceTypeNotAuthorized | The recommend instanceTypes are not authorized. | |
| 400 | RecommendEmpty.InstanceTypeSoldOut | The recommend instanceTypes are out of usage. | |
| 400 | RecommendEmpty.DiskCategoryNotRecommended | The specified disk category is not available for recommended. | |
| 400 | InvalidNetworkType.ValueNotSupported | The specified parameter NetworkType is not valid. | |
| 400 | InvalidSpotStrategy.ValueNotSupported | The specified parameter SpotStrategy is not valid. | |
| 400 | InvalidInstanceChargeType.NotFound | The specified parameter InstanceChargeType is not valid. | |
| 400 | InvalidPriorityStrategy.ValueNotSupported | The specified parameter PriorityStrategy is not supported. | |
| 400 | InvalidParam.TypeAndCpuMem.Conflict | The specified parameters InstanceType and Cores,Memory should not be blank at the same time. | |
| 400 | InvalidIoOptimized.NotFound | The specified parameter IoOptimized is not valid. | |
| 400 | InvalidRegionId.MalFormed | The specified parameter RegionId is not valid. | |
| 400 | InvalidDiskCategory.NotFound | The specified parameter SystemDiskCategory is not supported. | |
| 400 | InvalidInstanceTypeFamily.NotFound | The specified InstanceTypeFamily is not valid. | |
| 400 | InvalidMaxPrice.NotSupported | The specified MaxPrice is not valid. | |
| 400 | InvalidZoneId.MalFormed | The specified ZoneId is not valid when Cores and Memory is not null. | |
| 400 | InvalidInstanceType.NotSupported | The specified InstanceType is not valid. | |
| 400 | InvalidZoneId.ValueNotSupported | The specified ZoneId is not valid. | |
| 400 | InvalidCoreAndMemory.ValueNotSupported | The specified Cores/Memory does not match instance type. | |
| 400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | |
| 400 | RecommendEmpty.PerformanceNotSatisfied | The performance of recommend instanceType is not satisfied. | |
| 400 | RecommendEmpty.PriceNotSatisfied | The current price of recommend instanceTypes above user max price. | |
| 400 | RecommendEmpty.QuotaNotSatisfied | The quota of recommend instanceTypes are out of usage. | |
| 400 | RecommendEmpty.IzNotMatched | The iz of recommend instanceTypes are not match. | |
| 400 | RecommendEmpty.InstanceTypeNotMatched | The recommend instanceTypes are not match. | |
| 400 | InvalidScene.ValueNotSupported | The specified Scene is invalid. | |
| 400 | RecommendEmpty.InstanceTypeFamilyNotMatched | The recommend instanceTypeFamily are not match. | |
| 400 | RecommendEmpty.GenerationNotMatch | The recommend instanceType generation are not match. | |
| 400 | RecommendEmpty.NetworkTypeNotSupported | The recommend instanceType networkType are not match. | |
| 400 | InvalidInstanceFamilyLevel.NotSupported | The specified InstanceFamilyLevel is not valid. | |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。