(Bêta) Consulte un ou plusieurs types d'instances alternatifs en fonction d'un type d'instance spécifié. Pour les types d'instances qui ont été ou seront retirés, DescribeRecommendInstanceType répertorie tous les types d'instances pouvant servir de remplacement.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| Cores |
integer |
Non |
Le nombre de vCPU de l'instance ECS. |
2 |
| Memory |
number |
Non |
La taille de la mémoire de l'instance ECS. Unité : Gio. |
8.0 |
| InstanceFamilyLevel |
string |
Non |
Le niveau de la famille d'instances. Valeurs valides : |
EnterpriseLevel |
| InstanceType |
string |
Non |
Le type d'instance spécifié. Pour plus de détails, consultez Familles d'instances. Vous pouvez également appeler l'opération DescribeInstanceTypes pour obtenir la liste des types d'instances la plus récente. |
ecs.hfg6.large |
| NetworkType |
string |
Oui |
Le type de réseau de l'instance ECS. Valeurs valides : |
vpc |
| InstanceChargeType |
string |
Non |
Le mode de facturation de l'instance ECS. Pour plus de détails, consultez Aperçu de la facturation. Valeurs valides : |
PostPaid |
| SpotStrategy |
string |
Non |
La stratégie d'enchère pour l'instance spot. Valeurs valides : |
NoSpot |
| IoOptimized |
string |
Non |
Indique si l'instance est optimisée pour les E/S. Si le type d'instance ne prend en charge que les instances non optimisées pour les E/S, vous ne pouvez pas définir le paramètre IoOptimized. Valeurs valides : |
optimized |
| PriorityStrategy |
string |
Non |
La stratégie de recommandation basée sur la priorité. Valeurs valides : |
PriceFirst |
| MaxPrice |
number |
Non |
Le prix horaire maximum acceptable pour les instances payantes à l'usage ou spot. |
10.0 |
| RegionId |
string |
Oui |
L'identifiant de la région. Vous pouvez appeler DescribeRegions pour obtenir la liste des régions la plus récente. |
cn-hangzhou |
| ZoneId |
string |
Non |
L'identifiant de la zone. Vous pouvez appeler DescribeZones pour obtenir la liste des zones la plus récente. |
cn-hangzhou-f |
| SystemDiskCategory |
string |
Non |
La catégorie du disque système. Valeurs valides : |
cloud_ssd |
| ZoneMatchMode |
string |
Non |
Indique s'il faut recommander uniquement les types d'instances dans la zone spécifiée par ZoneId. Valeurs valides : |
Strict |
| Scene |
string |
Non |
Le scénario dans lequel les types d'instances sont recommandés. Valeurs valides : |
CREATE |
| InstanceTypeFamily |
array |
Non |
Paramètres de la collection de familles d'instances alternatives à partir de laquelle les types d'instances alternatives sont sélectionnés. Vous pouvez spécifier jusqu'à 10 familles d'instances. |
ecs.hfg6 |
|
string |
Non |
La famille d'instances. Pour les valeurs valides des types d'instances, consultez Familles d'instances. Vous pouvez également appeler DescribeInstanceTypeFamilys pour obtenir la liste des familles d'instances. |
ecs.hfg6 |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| Data |
object |
||
| RecommendInstanceType |
array<object> |
Les types d'instances recommandés. |
|
|
array<object> |
|||
| CommodityCode |
string |
The commodity code of the instance type. |
ecs |
| ZoneId |
string |
The zone ID of the instance type. |
cn-hangzhou-h |
| Priority |
integer |
The priority for sorting. |
2 |
| NetworkType |
string |
The network type of the ECS instance. |
vpc |
| Scene |
string |
The scenario in which the instance type is recommended. |
CREATE |
| SpotStrategy |
string |
The bidding policy for the spot instance. |
NoSpot |
| RegionId |
string |
The region ID of the instance type. |
cn-hangzhou |
| InstanceChargeType |
string |
The billing method of the instance. |
PostPaid |
| Zones |
object |
||
| zone |
array<object> |
The zones in which the instance type is available. |
|
|
array<object> |
|||
| ZoneNo |
string |
The zone ID of the instance type. |
cn-hangzhou-h |
| NetworkTypes |
object |
||
| NetworkType |
array |
The network types of the instance type. |
|
|
string |
The network type of the instance type. |
vpc |
|
| InstanceType |
object |
The name of the instance type. |
|
| SupportIoOptimized |
string |
Indicates whether the instance type supports I/O optimization. |
optimized |
| Cores |
integer |
The number of vCPUs of the instance type. |
1 |
| Memory |
integer |
The memory size of the instance type. Unit: MB. |
8192 |
| InstanceType |
string |
The name of the instance type. |
ecs.hfg6.large |
| InstanceTypeFamily |
string |
The instance family. |
ecs.hfg6 |
| Generation |
string |
The instance family generation. |
ecs-4 |
Exemples
JSON format
{
"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"
}
}
]
}
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | RecommendEmpty.InstanceTypeNotAuthorized | The recommend instanceTypes are not authorized. | No instance types can be recommended because no appropriate alternative instance types are available in the specified region or zone. |
| 400 | RecommendEmpty.InstanceTypeSoldOut | The recommend instanceTypes are out of usage. | No instance types can be recommended because the specified instance type is sold out and no appropriate alternative instance types are available within the specified region or zone. |
| 400 | RecommendEmpty.DiskCategoryNotRecommended | The specified disk category is not available for recommended. | The specified disk category is out of stock. |
| 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. | The instance billing method does not exist in our records. |
| 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. | You cannot specify the instance type, number of vCPUs, and memory size at the same time. |
| 400 | InvalidIoOptimized.NotFound | The specified parameter IoOptimized is not valid. | The specified IO optimization parameter IoOptimized is invalid. |
| 400 | InvalidRegionId.MalFormed | The specified parameter RegionId is not valid. | The specified RegionId parameter is invalid. |
| 400 | InvalidDiskCategory.NotFound | The specified parameter SystemDiskCategory is not supported. | The specified disk type DiskCategory not supported. |
| 400 | InvalidInstanceTypeFamily.NotFound | The specified InstanceTypeFamily is not valid. | |
| 400 | InvalidMaxPrice.NotSupported | The specified MaxPrice is not valid. | The specified MaxPrice parameter is invalid. This parameter takes effect only for Spot instances and must be set to a value greater than 0. |
| 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. | The specified image architecture does not support this instance type. |
| 400 | InvalidZoneId.ValueNotSupported | The specified ZoneId is not valid. | The specified ZoneId parameter is invalid. |
| 400 | InvalidCoreAndMemory.ValueNotSupported | The specified Cores/Memory does not match instance type. | The specified number of CPU cores and memory configuration do not match the specified specification (family). |
| 400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | The maximum number of pay-as-you-go instances has been reached. |
| 400 | RecommendEmpty.PerformanceNotSatisfied | The performance of recommend instanceType is not satisfied. | |
| 400 | RecommendEmpty.PriceNotSatisfied | The current price of recommend instanceTypes above user max price. | No instance types can be recommended because no instance types that meet the price requirements are available within the specified region or zone. |
| 400 | RecommendEmpty.QuotaNotSatisfied | The quota of recommend instanceTypes are out of usage. | No instance types can be recommended because none are available within the specified region or zone due to limited quotas. |
| 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. | No instance types can be recommended because no instance types that meet the requirements for the array of instance types are available within the specified region or zone. |
| 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. | The specified InstanceFamilyLevel parameter is invalid. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.