Manually triggers a pipeline to create an image. You can start a build this way whether the pipeline is enabled or disabled. The response returns as soon as Image Builder creates the new image resource and queues the build. Use the returned imageBuildVersionArn with GetImage to track build progress.
Parameters:
-
image_pipeline_arn
(ImagePipelineArn)
–
The Amazon Resource Name (ARN) of the image pipeline that you want to manually invoke.
-
client_token
(ClientToken)
–
A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
-
tags
(Optional[TagMap], default:
None
)
–
The tags for Image Builder to apply to the image resource that's created when pipeline execution starts.
Raises:
-
CallRateLimitExceededException
–
You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.
-
ClientException
–
A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.
-
ForbiddenException
–
You are not authorized to perform the requested operation.
-
IdempotentParameterMismatchException
–
You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.
-
InvalidRequestException
–
The request is malformed or otherwise invalid. Verify the request and try again.
-
ResourceInUseException
–
The resource that you are trying to operate on is currently in use. Review the message details and retry later.
-
ResourceNotFoundException
–
At least one of the resources referenced by your request does not exist.
-
ServiceException
–
An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.
-
ServiceUnavailableException
–
The service is unable to process your request at this time.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Start a pipeline build manually
The following example starts a build for the specified pipeline. The response returns the ARN of the new image build version.
>>> client.start_image_pipeline_execution(image_pipeline_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline', client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLE66666')
Source code in docs_src/capo_imagebuilder/_services/imagebuilder.py
| def start_image_pipeline_execution(
self,
image_pipeline_arn: "capo_imagebuilder.types.image_pipeline_arn.ImagePipelineArn",
client_token: "capo_imagebuilder.types.client_token.ClientToken",
*,
config_overrides: Optional[imagebuilderClientConfig] = None,
tags: Optional["capo_imagebuilder.types.tag_map.TagMap"] = None,
) -> "capo_imagebuilder.types.start_image_pipeline_execution_response.StartImagePipelineExecutionResponse":
"""<p>Manually triggers a pipeline to create an image. You can start a build this way whether the pipeline is enabled or disabled. The response returns as soon as Image Builder creates the new image resource and queues the build. Use the returned <code>imageBuildVersionArn</code> with <a>GetImage</a> to track build progress.</p>
Args:
image_pipeline_arn: <p>The Amazon Resource Name (ARN) of the image pipeline that you want to manually invoke.</p>
client_token: <p>A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
tags: <p>The tags for Image Builder to apply to the image resource that's created when pipeline execution starts.</p>
Raises:
capo_imagebuilder.errors.call_rate_limit_exceeded_exception.CallRateLimitExceededException: <p>You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.</p>
capo_imagebuilder.errors.client_exception.ClientException: <p>A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.</p>
capo_imagebuilder.errors.forbidden_exception.ForbiddenException: <p>You are not authorized to perform the requested operation.</p>
capo_imagebuilder.errors.idempotent_parameter_mismatch_exception.IdempotentParameterMismatchException: <p>You have specified a client token for an operation using parameter values that differ from a previous request that used the same client token.</p>
capo_imagebuilder.errors.invalid_request_exception.InvalidRequestException: <p>The request is malformed or otherwise invalid. Verify the request and try again.</p>
capo_imagebuilder.errors.resource_in_use_exception.ResourceInUseException: <p>The resource that you are trying to operate on is currently in use. Review the message details and retry later.</p>
capo_imagebuilder.errors.resource_not_found_exception.ResourceNotFoundException: <p>At least one of the resources referenced by your request does not exist.</p>
capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
capo_imagebuilder.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unable to process your request at this time.</p>
capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Start a pipeline build manually
The following example starts a build for the specified pipeline. The response returns the ARN of the new image build version.
>>> client.start_image_pipeline_execution(image_pipeline_arn='arn:aws:imagebuilder:us-west-2:111122223333:image-pipeline/my-example-pipeline', client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLE66666')
"""
def _handler(
req: "OperationRequest[capo_imagebuilder.types.start_image_pipeline_execution_request.StartImagePipelineExecutionRequest]",
) -> OperationResponse[
"capo_imagebuilder.types.start_image_pipeline_execution_response.StartImagePipelineExecutionResponse"
]:
import capo_imagebuilder._operations.imagebuilder.start_image_pipeline_execution
output, http_response = (
capo_imagebuilder._operations.imagebuilder.start_image_pipeline_execution.start_image_pipeline_execution(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StartImagePipelineExecution")
)
input_: capo_imagebuilder.types.start_image_pipeline_execution_request.StartImagePipelineExecutionRequest = {
"image_pipeline_arn": image_pipeline_arn,
"client_token": client_token,
}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|