Copie une image personnalisée d'une région à une autre. Vous pouvez utiliser cette opération pour déployer des instances ECS dans plusieurs régions ou répliquer des instances ECS entre régions.
Description de l'opération
Description de l'opération.
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:CopyImage |
update |
*Image
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| DestinationImageName |
string |
Non |
Le nom de l'image copiée. Le nom doit comporter de 2 à 128 caractères. Il doit commencer par une lettre et ne peut pas commencer par |
VotreNomImage |
| DestinationDescription |
string |
Non |
La description de l'image copiée. La description doit comporter de 2 à 256 caractères et ne peut pas commencer par |
Ceci est un exemple de description |
| ImageId |
string |
Oui |
L'identifiant de l'image personnalisée source. |
m-bp1h46wfpjsjastc**** |
| RegionId |
string |
Oui |
L'identifiant de la région de l'image personnalisée source. Vous pouvez appeler DescribeRegions pour interroger la liste des régions la plus récente. |
cn-hangzhou |
| DestinationRegionId |
string |
Non |
L'identifiant de la région de destination vers laquelle l'image est copiée. |
cn-shanghai |
| Encrypted |
boolean |
Non |
Indique si l'image copiée doit être chiffrée. |
false |
| KMSKeyId |
string |
Non |
L'identifiant de la clé utilisée pour chiffrer l'image. |
e522b26d-abf6-4e0d-b5da-04b7******3c |
| EncryptAlgorithm |
string |
Non |
Remarque
Ce paramètre n'est pas disponible publiquement. |
hide |
| ResourceGroupId |
string |
Non |
L'identifiant du groupe de ressources de l'image copiée. Si vous ne définissez pas ce paramètre, l'image copiée appartient au groupe de ressources par défaut. |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
Non |
Les balises. |
|
|
object |
Non |
Les balises. |
||
| Value |
string |
Non |
La valeur de la balise de l'image copiée. Valeurs valides de N : 1 à 20. La valeur de la balise peut être une chaîne vide. La valeur de la balise peut comporter jusqu'à 128 caractères et ne peut pas commencer par |
ValeurTest |
| Key |
string |
Non |
La clé de la balise de l'image copiée. Valeurs valides de N : 1 à 20. La clé de la balise ne peut pas être une chaîne vide. La clé de la balise peut comporter jusqu'à 128 caractères et ne peut pas commencer par |
CléTest |
| DryRun |
boolean |
Non |
Indique si un test à blanc uniquement doit être effectué. Valeurs valides : |
false |
| ClientToken |
string |
Non |
Le jeton client utilisé pour garantir l'idempotence de la requête. Vous pouvez utiliser le client pour générer le jeton, mais assurez-vous que le jeton est unique parmi les différentes requêtes. ClientToken ne peut contenir que des caractères ASCII et ne peut pas dépasser 64 caractères. Pour plus d'informations, consultez Comment garantir l'idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
| Scénario | État de l'image source | Paramètre Encrypted | Paramètre KMSKeyId | Si le chiffrement par défaut EBS au niveau du compte est configuré dans la région de destination | Résultat de l'image de destination | Description |
| 1 | Image non chiffrée | False ou non spécifié | Non spécifié | Non configuré | Image non chiffrée | Aucun chiffrement n'est appliqué. L'image reste inchangée. |
| 2 | Image non chiffrée | True | Non spécifié | Quelconque | Image entièrement chiffrée | L'utilisateur demande explicitement le chiffrement. Si le chiffrement par défaut EBS au niveau du compte est configuré, la clé par défaut configurée est le chiffrement par clé secrète. Sinon, la clé de service est le chiffrement par clé secrète. |
| 3 | Image non chiffrée | True | Spécifié | Quelconque | Image entièrement chiffrée | L'utilisateur demande explicitement le chiffrement. Le KMSKeyId spécifié est le chiffrement par clé secrète. |
| 4 | Image non chiffrée | Non spécifié | Non spécifié | Configuré | Image entièrement chiffrée | La clé configurée dans le chiffrement par défaut EBS au niveau du compte est le chiffrement par clé secrète. |
| 5 | Image chiffrée | Non spécifié | Non spécifié | Non configuré | Image chiffrée | Le format d'origine est préservé. Les instantanés non chiffrés restent non chiffrés, et les instantanés chiffrés sont chiffrés avec la clé de service. |
| 6 | Image chiffrée | Non spécifié ou True | Non spécifié | Configuré | Image entièrement chiffrée | La clé configurée dans le chiffrement par défaut EBS au niveau du compte est le chiffrement par clé secrète. |
| 7 | Image chiffrée | True | Non spécifié | Non configuré | Image entièrement chiffrée | La clé de service est le chiffrement par clé secrète. |
| 8 | Image chiffrée | True | Non spécifié | Configuré | Image entièrement chiffrée | La clé configurée dans le chiffrement par défaut EBS au niveau du compte est le chiffrement par clé secrète. |
| 9 | Image chiffrée | True | Spécifié | Quelconque | Image entièrement chiffrée | L'utilisateur demande explicitement le chiffrement. Le KMSKeyId spécifié est le chiffrement par clé secrète. |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| ImageId |
string |
L'identifiant de l'image copiée. |
m-bp1h46wfpjsjastd**** |
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemples
JSON format
{
"ImageId": "m-bp1h46wfpjsjastd****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | The specified destination description is wrongly formed. | |
| 400 | SourceRegion.NotFound | The source region not found. | |
| 400 | DestinationRegion.NotFound | The destination region not found. | |
| 400 | IncorrectImageStatus | The image not available. | |
| 400 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | |
| 400 | InvalidImageName.Duplicated | The specified image name is already in use in the target region. Please try a different one. | |
| 400 | InvalidParameter.EncryptedIllegal | The specified parameter Encrypted must be true when kmsKeyId is not empty. | |
| 400 | InvalidEncrypted.NotMatchEncryptAlgorithm | The specified parameter Encrypted must be true when EncryptAlgorithm is not empty. | |
| 400 | InvalidEncryptAlgorithm | The specified parameter EncryptAlgorithm is not valid. | |
| 400 | InvalidEncrypted.NotMatchKmsKeyId | The specified parameter Encrypted must be true when KmsKeyId is not empty. | |
| 400 | OperationDenied.CommunityImage | Community image does not support copy. | |
| 400 | InvalidImageName.Malformed | The specified destination image name is wrongly formed. | |
| 400 | InvalidParameter.KmsNotEnabled | The specified operation need enable KMS. | |
| 400 | OperationDenied.ImageCopyConflict | The same image cannot be copied concurrently. Please wait until the last copy is completed before performing the next operation. | |
| 400 | Account.Arrearage | Your account has an outstanding payment. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 401 | InvalidAliUid.IsNull | The aliUid must not be null. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 403 | Forbbiden | User not authorized to operate on the specified resource. | |
| 403 | InvalidOperation.CopyingDataFromThisRegionUnsupported | Data transfer from the current region to other regions is not supported. | |
| 403 | InvalidOperation.CopyingDataToThisRegionUnsupported | Only Some Regions %s can copy data to this region. | |
| 403 | QuotaExceed.Image | The number of images exceeds the limit (%s). | |
| 403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | |
| 403 | OperationDenied.ImageCopying | The image is currently being copied. Please try again later. | |
| 403 | RegionNotSupportCopy | The region not support copy. | |
| 403 | InvalidSnapshot.TooOld | This operation is denied because the specified snapshot is created before 2013-07-15. | |
| 403 | OperationDenied | The specified snapshot is not allowed to create image. | |
| 403 | IncorrectDestinationRegion | The destination region is not equal the target region. | |
| 403 | OperationDeined.EncryptedSnapshot | The image contains encrypted snapshots, which do not support copying. | |
| 403 | OperationDenied.SameRegionOnly | The image shared from others can not be copied to another region directly. | |
| 403 | OperationDenied.NotPublished | The operation is denied because corresponding marketplace image is not published in destination region. | |
| 403 | OperationDenied.NotAuthorized | The operation is denied because corresponding marketplace image is not authorized to current user. | |
| 403 | OperationDenied.EncryptSnapshotAcrossRegion | The image do not contain encrypted snapshots, which do not support copying to encrypted ones. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | |
| 403 | InvalidRegion.NotSupport | The specified region does not support byok. | |
| 403 | UserNotInTheWhiteList | The user is not in byok white list. | |
| 403 | InvalidRegionId.NotSupportEncryptAlgorithm | The current region does not support creating encrypted disks with EncryptAlgorithm. | |
| 403 | OperationDenied.KmsServiceUnauthorized | The account is not authorized to kms service, please authorize it. | |
| 403 | OperationDenied.NonCompliantDestinationRegion | The copy operation to the destination region is not in compliance with regulations. | |
| 403 | InvalidEncrypted.NotMatchDiskDefaultEncryption | The specified parameter Encrypted not match for your account default encryption settings. | |
| 403 | InvalidParameter.DataEncryptedKeyCreateFailed | Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support. | |
| 403 | SizeExceed.Image | The image exceeds the maximum size. You can use the CopySnapshot API to copy your snapshots of the image and then create a new image from them. | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK (Customer Master Key) must be in an active state. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. | |
| 403 | InvalidOperation.VhdImageUnsupported | The specified vhd image is not supported for this operation. Please switch to a raw image and retry. | |
| 403 | InvalidOperation.CloudBoxImageCopyUnsupported | Copying CloudBox images is not supported. | |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.