Executes an image building task by using an image template.
Operation description
After an image template is created, call this operation to execute an image building task. The system builds, distributes, and creates shared images based on the parameters configured in the image template settings.
For the same image template, only one image building task can be executed at a time. You can call CancelImagePipelineExecution multiple times simultaneously. Canceling an image building task does not interfere with other image building tasks.
When you execute an image building template, multiple intermediate instances are created to help build images. The intermediate instances are ECS instances that use the pay-as-you-go billing method, and billing fees are incurred. For more information, see Pay-as-you-go.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:StartImagePipelineExecution |
update |
*ImagePipeline
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
TemplateTag
deprecated
|
array<object> |
No |
Note
This parameter is deprecated. |
|
|
object |
No |
|||
| Key |
string |
No |
Note
This parameter is deprecated. |
null |
| Value |
string |
No |
Note
This parameter is deprecated. |
null |
| Tag |
array<object> |
No |
The tags. |
|
|
object |
No |
The tag object. |
||
| Key |
string |
No |
The key of the tag. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with |
TestKey |
| Value |
string |
No |
The value of the tag. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with |
TestValue |
| ImagePipelineId |
string |
Yes |
The ID of the image template. |
ip-2ze5tsl5bp6nf2b3**** |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. ClientToken can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ExecutionId |
string |
The ID of the building task. |
exec-5fb8facb8ed7427c**** |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
JSON format
{
"ExecutionId": "exec-5fb8facb8ed7427c****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidImage.OsTypeUnsupported | The specified base image does not support image building. | The operating system of the specified base image does not support image building. |
| 400 | InvalidParameter.BuildContent | %s. | The build content is invalid. |
| 400 | InvalidParameter.TestContent | %s. | The test content is invalid. |
| 400 | InvalidImageComponent.NotSupported | %s. | The specified image component is not available. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | InvalidTagKey.Malformed | The specified Tag.N.Key is not valid. Tag keys cannot be empty or null, support up to 128 characters, cannot start with "aliyun" or "acs:", and cannot contain "http://" or "https://". | The specified Tag.N.Key is not valid. Tag keys cannot be empty or null, support up to 128 characters, cannot start with "aliyun" or "acs:", and cannot contain "http://" or "https://". |
| 400 | InvalidTagValue.Malformed | The specified Tag.N.Value is not valid. Tag values support up to 128 characters, and cannot contain "http://" or "https://". | The specified Tag.N.Value is not valid. Tag values support up to 128 characters, and cannot contain "http://" or "https://". |
| 400 | InvalidDockerRepositoryCredential.DockerRegistryMalformed | The specified parameter DockerRepositoryCredential.DockerRegistry is invalid. The length should be between 1 to 512 characters. | The specified parameter DockerRepositoryCredential.DockerRegistry is invalid. The length should be between 1 to 512 characters. |
| 400 | InvalidDockerRepositoryCredential.UserMalformed | The specified parameter DockerRepositoryCredential.User is invalid. The length should be between 1 to 128 characters. | The specified parameter DockerRepositoryCredential.User is invalid. The length should be between 1 to 128 characters. |
| 400 | InvalidImageName.Duplicated | The specified image name is already in use. | The specified image name is already in use. |
| 500 | StartImagePipelineExecution.Failed | Start image pipeline execution failed. | Failed to execute the image template task. |
| 403 | InvalidImagePipeline.HasRunningExecution | %s | |
| 403 | InvalidImagePipeline.OSSObjectNotAuthorized | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is not allowed to access. | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is not allowed to access. |
| 403 | InvalidImagePipeline.OSSObjectNeedRestore | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is an archived object and needs to be restored first. | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is an archived object and needs to be restored first. |
| 403 | InvalidOperation.NoRightAccessOSS | ECS service is not authorized to access your OSS. Check your RAM roles and policies, and ensure that ecs.aliyuncs.com is authorized to assume AliyunECSImageImportDefaultRole. | ECS service is not authorized to access your OSS. Check your RAM roles and policies, and ensure that "ecs.aliyuncs.com" is authorized to assume "AliyunECSImageImportDefaultRole". |
| 404 | InvalidImagePipeline.NotFound | %s | |
| 404 | InvalidInstanceType.NotFound | The specified instance type does not exist. | The specified InstanceType parameter does not exist. |
| 404 | InvalidVSwitchId.NotFound | The specified VSwitchId does not exist. | The specified VSwitchId does not exist |
| 404 | InvalidRegionId.NotFound | %s | The specified region ID does not exist. |
| 404 | InvalidImage.NotFound | %s. | The specified image ID does not exist. |
| 404 | ImageComponent.NotFound | %s. | The specified image component ID is not found. |
| 404 | InvalidImagePipeline.BaseImageNotFound | The BaseImage of the specified ImagePipeline is not found. | The BaseImage of the specified ImagePipeline is not found. |
| 404 | InvalidImagePipeline.OSSObjectNotFound | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is not found in this region. | The ImportImageOptions.DiskDeviceMappings.OSSObject of the specified ImagePipeline is not found in this region. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.