Modifica los atributos de una imagen personalizada, como la familia de imágenes, el nombre, el modo de arranque, el estado y la compatibilidad con NVMe, mediante la operación ModifyImageAttribute con parámetros como ImageId e ImageFamily.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
ecs:ModifyImageAttribute |
update |
*Image
|
Ninguna | Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| RegionId |
string |
Sí |
El ID de la región de la imagen personalizada. Puede llamar a DescribeRegions para consultar la lista de regiones más reciente. |
cn-hangzhou |
| ImageId |
string |
Sí |
El ID de la imagen personalizada. |
m-bp18ygjuqnwhechc**** |
| ImageName |
string |
No |
El nombre de la imagen personalizada. El nombre debe tener entre 2 y 128 caracteres de longitud. Debe comenzar con una letra o un carácter chino y no puede comenzar con Valor predeterminado: null, lo que indica que se conserva el nombre original. |
testImageName |
| Status |
string |
No |
El estado de la imagen. Valores válidos:
Nota
Para revertir una imagen personalizada en una familia de imágenes a la versión anterior, puede establecer la última imagen personalizada disponible en el estado obsoleto. Sin embargo, si la imagen es la única imagen personalizada disponible en la familia de imágenes, la familia de imágenes no tendrá ninguna imagen personalizada disponible para crear instancias después de que la imagen quede obsoleta. Proceda con precaución. |
Deprecated |
| ImageFamily |
string |
No |
El nombre de la familia de imágenes. El nombre debe tener entre 2 y 128 caracteres de longitud. Debe comenzar con una letra o un carácter chino y no puede comenzar con Valor predeterminado: null. |
hangzhou-daily-update |
| BootMode |
string |
No |
El modo de arranque de la imagen. Valores válidos:
Importante
Para evitar que las instancias no se inicien debido a un modo de arranque no compatible, asegúrese de comprender los modos de arranque admitidos por la imagen antes de modificar este parámetro. Para obtener más información sobre los modos de arranque de imágenes, consulte Modos de arranque de imágenes. Valores válidos:
|
BIOS |
| LicenseType |
string |
No |
El tipo de licencia utilizado para activar el sistema operativo después de importar la imagen. Actualmente, solo se admite BYOL. BYOL: La licencia que viene con el sistema operativo de origen. Cuando utilice BYOL, asegúrese de que su clave de licencia admita su uso en Alibaba Cloud. |
BYOL |
| Description |
string |
No |
La descripción de la imagen personalizada. La descripción debe tener entre 2 y 256 caracteres de longitud y no puede comenzar con Valor predeterminado: null, lo que indica que se conserva la descripción original. |
testDescription |
| Features |
object |
No |
Los atributos de características de la imagen. |
|
| NvmeSupport |
string |
No |
Modifica el atributo de compatibilidad con NVMe de la imagen. Si no se especifica este parámetro, se conserva el valor actual. Importante Antes de habilitar esta característica, asegúrese de que el controlador NVMe esté preinstalado en el sistema operativo. Procedimiento recomendado: instale el controlador en una instancia, cree una imagen personalizada y luego llame a esta operación. Habilitar esta característica forzosamente sin el controlador provocará fallos en el inicio de la instancia. |
supported |
| ImdsSupport |
string |
No |
El modo de acceso a metadatos de la imagen. Valores válidos:
|
v2 |
| DryRun |
boolean |
No |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
|||
| RequestId |
string |
El ID de la solicitud. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Ejemplos
Respuesta exitosa
JSON Formato
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | InvalidImageName.Malformed | Image names must be between 2 and 128 characters long, using either English or Chinese characters. The name must start with a letter or a Chinese character, and can include numbers, colons, underscores and hyphens. | The length of the image name is 2 to 128 English or Chinese characters. It must start with an uppercase letter or a Chinese character and can contain numbers, colons (:), underscores (_), or dashes (-). |
| 400 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | |
| 400 | InvalidImageName.Duplicated | The specified Image name has already bean used. | The specified image name is already in use. |
| 400 | InvalidDescription.Malformed | The specified description is wrongly formed. | The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://. |
| 400 | ImageQuotaFull.ImageFamily | The specified image family has exceeded max number of images for one image family. | |
| 400 | InvalidImageFamily.Malformed | The specified parameter "ImageFamily" is malformed. | |
| 400 | ImageFamilyQuotaFull | The specified region has exceeded max number of image family. | |
| 400 | InvalidBootMode.NotSupport | The specified parameter BootMode is not supported. | |
| 400 | InvalidLicenseType.NotSupported | The specified parameter LicenseType is not supported. | |
| 400 | InvalidParameter.FeaturesImdsSupport | The specified parameter Features.ImdsSupport is not supported. | The specified parameter Features.ImdsSupport is not supported. |
| 403 | ImageStatus.NotAvailable | The specified image status is not available. | The status of the specified image is not Available. |
| 403 | ImageStatus.NotDeprecated | The specified image status is not deprecated. | The specified image is not in the Deprecated state. |
| 403 | ImageUseShared | The specified image has been shared to others, please remove shared accounts first. | |
| 403 | OperationDeined.ImageUsingByInstance | The boot mode of the image cannot be modified because it has associated instances. | The boot mode of the image cannot be modified while the image has associated instances. |
| 403 | InvalidOperation.FeaturesImdsSupportNotMatch | The specified parameter Features.ImdsSupport can not be set to v1 from v2. | The specified parameter Features.ImdsSupport can not be set to v1 from v2. |
| 403 | InvalidStatus.ImageIsCreating | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. |
| 403 | InvalidOperation.PublicImageUnsupported | The community image's publisher is not the current account. Modification is not permitted. | The community image's publisher is not the current account. Modification is not permitted. |
| 403 | InvalidDescription.Malformed | The specified parameter description is not valid. | The specified parameter description is invalid. |
| 403 | InvalidBootMode.SecureBootUnsupported | Secure Boot requires UEFI or UEFI-Preferred boot mode. Please check the BootMode and try again. | Secure Boot requires UEFI or UEFI-Preferred boot mode. Please check the startup mode and try again. |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | The specified image does not exist in this account. Check whether the image ID is correct. |
Consulte Códigos de error para ver la lista completa.
Notas de la versión
Consulte Notas de la versión para ver la lista completa.