Modifie certaines propriétés d'une instance ECS, notamment le mot de passe, le nom de l'instance, le nom d'hôte, l'appartenance au groupe de sécurité, le MTU et les données utilisateur de l'instance.
Description de l'opération
Les instances verrouillées pour des raisons de sécurité ne prennent pas en charge cette opération. Pour plus d'informations, consultez Impact des verrouillages de sécurité des ressources sur les appels d'API.
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:ModifyInstanceAttribute |
update |
*Instance
SecurityGroup
|
|
Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| InstanceId |
string |
Oui |
L'identifiant de l'instance. |
i-bp67acfmxazb4ph**** |
| Password |
string |
Non |
Le mot de passe de l'instance. Le mot de passe doit comporter de 8 à 30 caractères et contenir au moins trois des types de caractères suivants : lettres majuscules, lettres minuscules, chiffres et caractères spéciaux. Les caractères spéciaux suivants sont pris en charge : ()`~!@#$%^&*-_+=|{}[]:;'<>,.?/. Pour les instances Windows, le mot de passe ne peut pas commencer par une barre oblique (/). Prenez note des points suivants :
Remarque
Si vous spécifiez le paramètre Password, utilisez HTTPS pour envoyer la requête afin d'éviter les fuites de mot de passe. |
Test123456&$ |
| HostName |
string |
Non |
Le nom d'hôte du système d'exploitation. Prenez en compte les éléments suivants :
Le nom d'hôte est soumis aux limites suivantes selon les différents systèmes d'exploitation :
|
testHostName |
| InstanceName |
string |
Non |
Le nom de l'instance. Le nom doit comporter entre 2 et 128 caractères. Il doit commencer par une lettre majuscule, une lettre minuscule ou un caractère chinois et ne peut pas commencer par |
testInstanceName |
| Description |
string |
Non |
La description de l'instance. La description doit comporter entre 2 et 256 caractères et ne peut pas commencer par |
testInstanceDescription |
| UserData |
string |
Non |
Les données utilisateur de l'instance. Nous vous recommandons d'encoder les données en Base64 avant de les transmettre. Prenez note des points suivants :
Remarque
Avant l'encodage en Base64, les données brutes ne peuvent pas dépasser 32 Ko. Ne transmettez pas d'informations sensibles telles que des mots de passe et des clés privées en texte brut. Si vous devez transmettre des informations sensibles, chiffrez-les, encodez-les en Base64, puis déchiffrez-les de la même manière au sein de l'instance. |
ZWNobyBoZWxsbyBlY3Mh |
| Recyclable |
boolean |
Non |
Remarque
Ce paramètre est en prévisualisation sur invitation et n'est pas disponible publiquement. |
true |
| CreditSpecification |
string |
Non |
Le mode de fonctionnement de l'instance burstable. Valeurs valides :
Pour plus d'informations sur les modes de fonctionnement des instances burstables, consultez Qu'est-ce qu'une instance burstable ?. |
Standard |
| DeletionProtection |
boolean |
Non |
L'attribut de protection contre la libération de l'instance. Indique si l'instance peut être libérée depuis la console ou en appelant DeleteInstance. Remarque
Cet attribut s'applique uniquement aux instances postpayées et empêche uniquement les opérations de libération manuelle. Il ne s'applique pas aux opérations de libération initiées par le système. |
false |
| NetworkInterfaceQueueNumber |
integer |
Non |
Le nombre de files d'attente pour le contrôleur d'interface réseau (NIC) principal. Notez les points suivants :\n- L'instance doit être dans l'état Stopped.\n- La valeur ne peut pas dépasser le nombre maximal de files d'attente par NIC autorisé par le type d'instance. Le nombre total de files d'attente pour tous les NIC de l'instance ne peut pas dépasser le quota total de files d'attente autorisé par le type d'instance. Vous pouvez appeler DescribeInstanceTypes pour obtenir le nombre maximal de files d'attente par NIC et le quota total de files d'attente pour un type d'instance.\n- Si vous définissez ce paramètre sur -1, le nombre de files d'attente du NIC principal est réinitialisé à la valeur par défaut du type d'instance. Vous pouvez appeler DescribeInstanceTypes pour obtenir le nombre par défaut de files d'attente d'interface réseau élastique (ENI) pour un type d'instance. |
8 |
| SecurityGroupIds |
array |
Non |
Les identifiants des groupes de sécurité auxquels l'instance est réaffectée. Notez les points suivants :
Remarque
Les modifications apportées aux groupes de sécurité prennent effet sur l'instance peu après leur application, mais un léger délai peut survenir. |
sg-bp15ed6xe1yxeycg7o**** |
|
string |
Non |
L'identifiant du groupe de sécurité. |
sg-bp15ed6xe1yxeycg7o**** |
|
| RemoteConnectionOptions |
object |
Non |
Remarque
Ce paramètre est en prévisualisation sur invitation et n'est pas disponible publiquement. |
|
| Password |
string |
Non |
Remarque
Ce paramètre est en prévisualisation sur invitation et n'est pas disponible publiquement. |
hide |
| Type |
string |
Non |
Remarque
Ce paramètre est en prévisualisation sur invitation et n'est pas disponible publiquement. |
hide |
| EnableJumboFrame |
boolean |
Non |
Indique si la fonctionnalité Jumbo Frame doit être activée pour le MTU de l'instance. Valeurs valides :
Notez les points suivants :
|
false |
| CpuOptions.Core |
integer |
Non |
Le nombre de cœurs de processeur. Ce paramètre ne prend pas en charge les valeurs personnalisées et ne peut utiliser que la valeur par défaut. |
2 |
| CpuOptions.ThreadsPerCore |
integer |
Non |
Le nombre de threads par cœur de processeur. Le nombre de vCPU de l'instance ECS = valeur de CpuOptions.Core × valeur de CpuOptions.ThreadsPerCore.
|
2 |
| CpuOptions.TopologyType |
string |
Non |
Le type de topologie du processeur de l'instance. Valeurs valides :
Valeur par défaut : aucune. Prenez en compte les éléments suivants :
Remarque
Seules certaines familles d'instances prennent en charge ce paramètre. Pour plus d'informations sur les familles d'instances prises en charge, consultez Afficher et modifier la structure de topologie du processeur. |
DiscreteCoreToHTMapping |
| PrivateDnsNameOptions |
object |
Non |
La configuration du nom de domaine privé de l'instance.\n\n\nPour plus d'informations sur la résolution de domaine privé, consultez Résolution de domaine privé ECS. |
|
| EnableInstanceIdDnsARecord |
boolean |
Non |
Indique si la résolution DNS du nom de domaine basé sur l'identifiant de l'instance vers l'adresse IPv4 doit être activée. Valeurs valides :
Valeur par défaut : false. |
false |
| EnableInstanceIdDnsAAAARecord |
boolean |
Non |
Indique si la résolution DNS du nom de domaine basé sur l'identifiant de l'instance vers l'adresse IPv6 doit être activée. Valeurs valides :
Valeur par défaut : false. |
false |
| EnableIpDnsARecord |
boolean |
Non |
Indique si la résolution DNS du nom de domaine basé sur l'IP vers l'adresse IPv4 doit être activée. Valeurs valides :
Valeur par défaut : false. |
false |
| EnableIpDnsPtrRecord |
boolean |
Non |
Indique si la résolution DNS inverse de l'adresse IPv4 vers le nom de domaine basé sur l'IP doit être activée. Valeurs valides :\n- true : active la résolution.\n- false : désactive la résolution.\n\nValeur par défaut : false. |
false |
| HostnameType |
string |
Non |
Le type de nom d'hôte. Valeurs valides :
Valeur par défaut : Custom. |
Custom |
| CpuOptions |
object |
Non |
||
| NestedVirtualization |
string |
Non |
Remarque
Ce paramètre est en prévisualisation sur invitation et n'est pas disponible publiquement. |
enabled |
| EnableNetworkEncryption |
boolean |
Non |
Indique si le chiffrement du trafic réseau VPC doit être activé. Valeurs valides :
Remarque
Ce paramètre est en version préliminaire sur invitation et n'est pas disponible publiquement. |
true |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemples
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | InvalidInstanceName.Malformed | The specified parameter "InstanceName" is not valid. | The specified InstanceName parameter is invalid. |
| 400 | InvalidDescription.Malformed | The specified parameter "Description" is not valid. | The source description can be 2 to 256 characters in length. It cannot start with http:// and https://. |
| 400 | InvalidRemoteConnectionOptions.Password | The remote connection password is invalid. | |
| 400 | InvalidRemoteConnectionOptions.Type | The remote connection type is invalid. | |
| 400 | InstanceType.ValueNotSupported | The instance type not supported. | |
| 400 | OSType.ValueNotSupported | The OS type is not supported. | |
| 400 | InvalidHostPassword.Malformed | The specified parameter "Password" is not valid. | |
| 400 | InvalidHostName.Malformed | The specified parameter "HostName" is not valid. | The specified parameter HostName is invalid. |
| 400 | InvalidPassword.Malformed | The specified parameter "Password" is not valid. | The specified Password parameter is invalid. |
| 400 | InvalidUserData.SizeExceeded | The specified parameter "UserData" exceeds the size. | |
| 400 | InvalidUserData.NotSupported | TThe specified parameter "UserData" only support the vpc and IoOptimized Instance. | |
| 400 | ImageNotSupportCloudInit | The specified image does not support cloud-init. | The image does not support CloudInit. |
| 400 | ChargeTypeViolation | Pay-As-You-Go instances do not support this operation. | |
| 400 | InvalidParameter.RecycleBin | You do not have permission to set recyclable properties. | You are not authorized to perform the operation. |
| 400 | InvalidParameter.CreditSpecification | The specified CreditSpecification is not supported in this region. | The running mode of the specified burst performance instance is not supported in this zone. |
| 400 | InvalidInstanceStatus.CreditSpecRestricted | The current status of the resource does not support this operation. | The resource is in a state that does not support the current operation. |
| 400 | InvalidInstanceStatus.NotRunning | The current status of the resource is invalid, you can only do this operation when instance is running. | The resource is in a state that does not support the operation. Perform the operation when the instance is in the Running state. |
| 400 | InvalidNetworkType.NotSupported | The classic networkType does not support to modify security group | |
| 400 | InvalidOperation.EniCountExceeded | =The maximum number of eni in a enterprise security group is exceeded. | |
| 400 | JoinedGroupLimitExceed | %s | The maximum number of security groups to which the specified resource can be added has been reached. For more information, see the return value of the %s placeholder in the error message. |
| 400 | InvalidParameter | The specified parameter is not valid. | A specified parameter is invalid. |
| 400 | InvalidOperation.InvalidEcsState | %s | The current status of the instance does not support this operation. |
| 400 | InvalidParam.NotSupportJumboFrame | Not support jumbo frame. | |
| 400 | InvalidOperation.InstanceStatusNotSupport | The instance status is not support modify mtu config. | |
| 400 | InvalidOperation.InstanceStatusUnsupported | The specified instance status does not support modification of cpu topology type. | The specified instance status does not support modification of cpu topology type. |
| 400 | InvalidParameter.CpuOptionsTopologyType | The specified parameter CpuOptions.TopologyType: %s is not valid. | Illegal enumeration value for current CPU topology type |
| 400 | InvalidInstanceType.NotSupportCpuOptionsTopologyType | The specified instance type does not support CpuOptions.TopologyType: %s. | The current specification does not support the specified CPU topology type |
| 400 | InvalidAdditionalInfoPvdConfig.SizeExceeded | The specified parameter AdditionalInfo.PvdConfig exceeds the size. | |
| 400 | InvalidInstanceType.NotSupportHighDensityMode | The specified instance type does not support the use of the high density mode. | The current instance type does not support the cloud disk high-density mode. |
| 400 | InvalidStatus.StoppedRequired | The current state of the resource does not support this operation, it can only be operated in a stopped state. | The current state of the resource does not support this operation, only down state can operate |
| 400 | InvalidParameter.CpuOptionsTurboMode | The specified parameter TurboMode is not valid. | The specified parameter frequency mode is invalid |
| 400 | InvalidInstanceType.EnableNVSUnsupported | The specified instance type does not support EnableNVS. | The specified instance type does not support enabling the NVS feature. |
| 400 | InvalidInstanceType.EnableVISSTUnsupported | The specified instance type does not support EnableVISST. | The specified instance type does not support enabling the VISST feature. |
| 400 | InvalidInstanceType.EnableVRDTUnsupported | The specified instance type does not support EnableVRDT. | The specified instance type does not support enabling the VRDT feature. |
| 400 | InvalidInstanceType.SingleCoreMaxModeUnsupported | The specified instance type does not support TurboMode: "SINGLE CORE MAX". | The specified instance type does not support single-core maximum turbo mode |
| 400 | InvalidInstanceType.GpuOptionsConfidentialComputingUnsupported | The specified instance type does not support the confidential computing mode. | the current instance type does not support encrypted computing mode. |
| 400 | InvalidParameter.GpuOptionsConfidentialComputing | The specified parameter confidential computing mode is not valid. | The enum value of the GPU encryption computing mode of the current instance is invalid. |
| 400 | InvalidParameterAuthorized.GpuOptionsConfidentialComputing | The specified parameter confidential computing mode is unauthorized. | The specified GPU-based confidential computing mode parameter value for the instance is not authorized. |
| 400 | InvalidParameter.CpuOptionsNestedVirtualization | The specified parameter CpuOptions.NestedVirtualization: %s is not valid. | |
| 400 | InvalidInstanceType.NotSupportCpuOptionsNestedVirtualization | The specified instance type does not support CpuOptions.NestedVirtualization: %s. | The specified instance type does not support CpuOptions.NestedVirtualization value. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | The instance is locked for security reasons. Contact security technical support. |
| 403 | OperationDenied | The instance amount in the specified SecurityGroup reach its limit. | The maximum number of instances in the specified security group has been reached. |
| 403 | InvalidUserData.Forbidden | User not authorized to input the parameter "UserData"please apply for permission "UserData" | |
| 403 | InvalidUserData.Base64FormatInvalid | The specified UserData is not valid | An error occurred when the specified UserData parameter is encoded. |
| 403 | InvalidChargeType.ValueNotSupported | Deletion protection is only valid for postPaid instance, not for prePaid or spot instance. | Release protection can be enabled only for pay-as-you-go instances. |
| 403 | InvalidUser.Unauthorized | The user is not authorized | You are not authorized to perform this operation. |
| 403 | EnterpriseGroupLimited.MutliGroupType | The specified instance can not join multi SecurityGroup types. | The specified instance cannot belong to both a basic and an advanced security group. You can call the DescribeSecurityGroups operation to query the type of security groups. |
| 403 | SecurityGroupInstanceLimitExceed | %s | The number of instances in the security group has reached the maximum limit. |
| 403 | InstanceNotInSecurityGroup | The instance not in the group. | |
| 403 | InvalidOperation.InvalidRegion | %s | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | You cannot modify security groups managed by cloud services. |
| 403 | InvalidParameter.InvalidEniQueueNumber | %s | The number of network interface controller (NIC) queues is incorrect. For more information, refer to the actual return result of the %s placeholder in the error message. |
| 403 | InvalidOperation.MaxEniQueueNumberExceeded | %s | The number of Elastic Network Interface (ENI) queues exceeds the upper limit. For more information, see the actual return result of the %s placeholder in the error message. |
| 403 | InvalidOperation.ExceedInstanceTypeQueueNumber | %s | The maximum number of queues for all ENIs on an instance has been exceeded. For more information, see the return value of the %s placeholder in the error message. |
| 403 | InvalidOperation.InstanceTypeNotSupportHighPerformanceTrafficMode | %s | The instance type of the specified instance does not support the NIC of the RDMA communication mode. |
| 403 | InvalidParameter.InvalidQueuePairNumber | %s | |
| 403 | InvalidOperation.MaxEniQueuePairNumberExceed | %s | |
| 403 | InvalidOperation.EniQueuePairNumberOverflow | %s | |
| 403 | AclLimitExceed | %s | The number of ACL rules for an ENI or instance exceeds the upper limit. |
| 403 | InvalidInstanceType.CpuOptionsThreadsPerCoreUnsupported | The current instance type does not support setting or modifying the CpuOptions.ThreadsPerCore parameter. | The current instance type does not support setting or modifying the CpuOptions.ThreadsPerCore parameter. |
| 403 | InvalidParameter.CpuOptionsCore | The specified parameter CpuOptions.Core is not valid. | The specified parameter CpuOptions.Core is not valid. |
| 403 | InvalidParameter.CpuOptionsThreadsPerCore | The specified parameter CpuOptions.ThreadsPerCore is not valid. | The specified parameter CpuOptions.ThreadsPerCore is not valid. |
| 403 | InvalidOperation.UserNotSupportNetworkEncryption | User not support network encryption. | The user does not support specifying network traffic encryption parameters. |
| 403 | InvalidOperation.InstanceTypeNotSupportNetworkEncryption | The specified instance type does not support network encryption. | the specified instance type does not support vpc traffic encryption |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | The specified security group does not exist in this account. Check whether the security group ID is correct. |
| 404 | Credit.NotFound | The specified credit information does not exist. | The specified burst performance instance credit information does not exist. |
| 404 | InvalidInstanceStatus.NeedRestart | The current status of the resource is invalid, you can only do this operation after instance is restarted. | |
| 404 | InvalidParameter.SecurityGroupIdRepeated | The specified security group ids has repeated. | Duplicate security group IDs are specified. Check whether the specified SecurityGroupIds.N parameter is valid. |
| 404 | InvalidSecurityGroupType.NotSupportClassic | The specified SecurityGroupIds have classic group type. | The specified security group is in the classic network. Check whether the specified SecurityGroupIds.N parameter is valid. |
| 404 | InvalidSecurityGroupVpc.NotBelongToOneVpc | The specified SecurityGroupIds are belong to different vpc. | The specified security groups belong to different VPCs. Check whether the specified SecurityGroupIds.N parameter is valid. You can call the DescribeSecurityGroups operation to query the VPCs to which the security groups belong. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.