All Products
Search
Document Center

CreateImage

Last Updated: May 11, 2018

Description

Creates an image for Batch Compute service.

Request parameters

Name Type Required Description
Name String No Image name.
Description String No Image description.
EcsImageId String Yes ID of the ECS image to be used.
Platform String Yes Platform type of the current image to be used. The options are Linux and Windows.
IdempotentToken String No Idempotence used to guarantee the request. The value is generated by a client. It must be unique among all requests and can contain a maximum of 64 characters, including letters, numbers, and underscores.

Response parameters

Attribute Type Description
Id String Image ID.

Examples

Request examples

  1. POST /images?IdempotentToken={IdempotentToken}
  2. {
  3. "Name": "ImageName",
  4. "Description": "ImageDescription",
  5. "EcsImageId": "EcsImageId",
  6. "Platform": "Linux",
  7. }

Response examples

Response status code

  1. HTTP/1.1 201 Created

Response body

  1. {
  2. "Id":"img-23jhhsd"
  3. }

Error message

Error code Error message HTTP status code Meaning
IdempotentTokenMismatch Specified idempotent token mismatch. 400 The token has been used, and different from that in the previous request.
InvalidJsonFormat The request body has an invalid json format. 400 The request body has an invalid JSON format.
InvalidHttpBody Specified parameter HttpBody is not valid. Its type must be object. 400 Http Body must be an object.
MissingName Name is mandatory for this action. 400 The parameter Name is missing.
InvalidName Specified parameter Name is not valid. Its type must be string. 400 Name must be a string.
InvalidName Specified parameter Name is not valid. Its length must be in [1, 64]. 400 The length of Name must be in the range of [1, 64].
InvalidName Specified parameter Name is not valid. It must only contain characters within [a-zA-Z0-9_-], and must not start with [0-9]. 400 Name can contain only letters, numbers, underscores, and hyphens, and cannot start with a number.
InvalidDescription Specified parameter Description is not valid. Its type must be string. 400 Description must be a string.
InvalidDescription Specified parameter Description is not valid. Its length must be in [0, 1024]. 400 The length of Description must be in the range of [0, 1024].
MissingEcsImageId EcsImageId is mandatory for this action. 400 The parameter EcsImageId is missing.
InvalidEcsImageId Specified parameter EcsImageId is not valid. Its type must be string. 400 EcsImageId must be a string.
InvalidEcsImageId Specified parameter EcsImageId is not valid. Its length must be in [1, 256]. 400 The length of EcsImageId must be in the range of [1, 256].
InvalidEcsImageId Specified parameter EcsImageId is not valid. The specified EcsImageId does not exist or not you onwer. 400 ECSImageId must be a valid ECS image ID.
InvalidEcsImageId Specified parameter EcsImageId is not valid. This EcsImageId has been registered. 400 This EcsImageId has been registered.
InvalidEcsImageId Specified parameter EcsImageId is not valid. The image is not available. 400 The current status of the ECS image is incorrect.
InvalidEcsImageId Specified parameter EcsImageId is not valid. The share Image Quota exceeds or the shared image user quota exceeds. 400 The custom image sharing quota or the maximum number of users to whom a single image can be shared is exceeded.
InvalidRoleArn Specified parameter RoleArn is not valid. You haven’t created AliyunBatchComputeDefaultRole yet. 400 AliyunBatchComputeDefaultRole is not created for the BatchCompute service yet.
InvalidRoleArn Specified parameter RoleArn is not valid. AliyunBatchComputeDefaultRole don’t have access to share image. 400 AliyunBatchComputeDefaultRole is not authorized to share images.
MissingPlatform Platform is mandatory for this action. 400 The parameter Platform is missing.
InvalidPlatform Specified parameter Platform is not valid. Its type must be string. 400 Platform must be a string.
InvalidPlatform Specified parameter Platform is not valid. Its length must be in [1, 256]. 400 The length of Platform must be in the range of [1, 256].
QuotaExhausted.MaxImageCount The MaxImageCount ({value}) quota is exhausted. 403 The number of images cannot exceed {value}.
Invalid{Parameter} Specified parameter {Parameter} is not valid. 400 The parameter {Parameter} is invalid.