Consulte l'inventaire des types d'instances ou des types de disques système dans une zone avant de modifier le type d'instance ou le type de disque système d'une instance.
Description de l'opération
Les exemples suivants décrivent des scénarios de modification courants :
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
|
ecs:DescribeResourcesModification |
get |
*Instance
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| RegionId |
string |
Oui |
L'identifiant de la région de l'instance dont vous souhaitez modifier la configuration. Vous pouvez appeler DescribeRegions pour consulter la liste des régions la plus récente. |
cn-hangzhou |
| ResourceId |
string |
Oui |
L'identifiant d'instance (InstanceId) de l'instance dont vous souhaitez modifier le type d'instance ou le type de disque système. |
i-bp67acfmxazb4p**** |
| MigrateAcrossZone |
boolean |
Non |
Indique si les modifications de type d'instance inter-clusters sont prises en charge. Valeurs valides : |
true |
| DestinationResource |
string |
Oui |
Le type de ressource à modifier. Valeurs valides : |
InstanceType |
| OperationType |
string |
Non |
Le type d'opération de mise à niveau ou de rétrogradation. |
Upgrade |
| InstanceType |
string |
Non |
Le type d'instance cible. Pour plus d'informations, consultez Famille d'instances. Vous pouvez également appeler DescribeInstanceTypes pour consulter la liste des types d'instances la plus récente. |
ecs.g7.large |
| Cores |
integer |
Non |
Le nombre de cœurs vCPU du type d'instance cible. Pour les valeurs valides, consultez Famille d'instances. |
2 |
| Memory |
number |
Non |
La taille de la mémoire du type d'instance cible. Unité : Gio. Pour les valeurs valides, consultez Famille d'instances. |
8.0 |
| ZoneId |
string |
Non |
L'identifiant de la zone cible. |
cn-hangzhou-e |
| Conditions |
array |
Non |
La liste des conditions. |
|
|
string |
Non |
Seul DiskCategory est pris en charge, ce qui indique la consultation des types d'instances disponibles après la modification du type de disque de l'instance actuelle. |
DiskCategory |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| AvailableZones |
object |
||
| AvailableZone |
array<object> |
La collection d'objets AvailableZone contenant les informations de zone. |
|
|
array<object> |
|||
| ZoneId |
string |
The zone ID. |
cn-hangzhou-e |
| Status |
string |
The resource status. Valid values:
|
Available |
| StatusCategory |
string |
The resource category based on detailed inventory. Valid values:
|
WithStock |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| AvailableResources |
object |
||
| AvailableResource |
array<object> |
The array of available resources that can be created. |
|
|
array<object> |
|||
| Type |
string |
The resource type. Valid values:
|
InstanceType |
| SupportedResources |
object |
||
| SupportedResource |
array<object> |
The array of supported resources that can be created. |
|
|
object |
|||
| Status |
string |
The resource status. Valid values:
|
Available |
| Value |
string |
The resource value. |
ecs.g7.large |
| Max |
integer |
The maximum disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
2048 |
| Unit |
string |
The unit of disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
GiB |
| StatusCategory |
string |
The resource category based on detailed inventory. Valid values:
|
WithStock |
| Min |
integer |
The minimum disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
20 |
| ConditionSupportedResources |
object |
||
| ConditionSupportedResource |
array<object> |
The list of conditionally supported resources that can be created. |
|
|
array<object> |
The conditionally supported resource that can be created. After the conditions are met, the current resource can be changed to a resource in this list. |
||
| Conditions |
object |
||
| Condition |
array<object> |
The list of conditions. |
|
|
object |
The list of conditions. |
||
| Key |
string |
The condition name. Valid values: DiskCategory: the disk type does not meet the requirements. |
DiskCategory |
| Status |
string |
The inventory status of the resource. Valid values:
|
Available |
| Value |
string |
The resource value. |
ecs.g5.large |
| Max |
integer |
The maximum disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
2048 |
| Unit |
string |
The unit of disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
GiB |
| StatusCategory |
string |
The resource category based on detailed inventory. Valid values:
|
WithStock |
| Min |
integer |
The minimum disk capacity. This parameter takes effect only when DestinationResource is set to SystemDisk. |
20 |
Exemples
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"AvailableZones": {
"AvailableZone": [
{
"ZoneId": "cn-hangzhou-e",
"Status": "Available",
"StatusCategory": "WithStock",
"RegionId": "cn-hangzhou",
"AvailableResources": {
"AvailableResource": [
{
"Type": "InstanceType",
"SupportedResources": {
"SupportedResource": [
{
"Status": "Available",
"Value": "ecs.g7.large",
"Max": 2048,
"Unit": "GiB",
"StatusCategory": "WithStock",
"Min": 20
}
]
},
"ConditionSupportedResources": {
"ConditionSupportedResource": [
{
"Conditions": {
"Condition": [
{
"Key": "DiskCategory"
}
]
},
"Status": "Available",
"Value": "ecs.g5.large",
"Max": 2048,
"Unit": "GiB",
"StatusCategory": "WithStock",
"Min": 20
}
]
}
}
]
}
}
]
}
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | Invalid.OperationType | The specified operationType is not valid. | The specified OperationType parameter is invalid. |
| 400 | Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | The specified DestinationResource parameter is invalid. |
| 400 | Invalid.InstanceChargeType | The specified InstanceChargeType is not valid. | The specified InstanceChargeType parameter is invalid. |
| 400 | InvalidCondition.Malformed | The specified Condition is not valid. | |
| 403 | InvalidDedicatedHostId.NotFound | The specified DedicatedHostId does not exist in our records. | The specified dedicated host does not exist. |
| 403 | InvalidParam.TypeAndCpuMem.Conflict | The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time. | You cannot specify the instance type, number of vCPUs, and memory size at the same time. |
| 403 | InvalidParam.Cores | The specified parameter 'Cores' should be empty. | The specified parameter 'Cores' should be empty. |
| 403 | InvalidParam.Memory | The specified parameter 'Memory' should be empty. | The specified parameter 'Memory' should be empty. |
| 403 | InvalidParameter.ResourceOwnerId | The specified parameter ResourceOwnerId is not available anymore. | |
| 404 | Invalid.RegionId | The specified RegionId does not exist. | The specified RegionId parameter is invalid. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | Unavailable.Regions | The available regions does not exists. | The available region does not exist. |
| 404 | Invalid.ResourceType | The ResourceType provided does not exist in our records. | The specified resource type is invalid. |
| 404 | Invalid.DestinationResource | The specified DestinationResource is not valid. | The specified DestinationResource parameter is invalid. |
| 404 | Invalid.IoOptimized | The specified IoOptimized is not valid. | The specified IoOptimized parameter is invalid. |
| 404 | Invalid.NetworkCategory | The specified NetworkCategory is not valid. | The specified NetworkCategory parameter is invalid. |
| 404 | Invalid.SpotStrategy | The specified SpotStrategy is not valid. | The specified SpotStrategy parameter is invalid. |
| 404 | Invalid.ResourceId | The specified ResourceId is not valid. | The specified ResourceId parameter is invalid. |
| 404 | Invalid.InstancePayType | The specified InstancePayType is not valid. | The specified InstanceChargeType parameter is invalid. |
| 404 | Invalid.OperationType | The specified OperationType is not valid. | The specified parameter OperationType is invalid. |
| 404 | OperationDenied | The specified operation is denied as this instanceType is not support. | The instance type does not support this operation. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId provided does not exist in our records. | The specified instance does not exist. |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found in our records. | The specified resource does not exist. Check whether the resource ID is correct. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.