Skip to content

list_lifecycle_execution_resources async

list_lifecycle_execution_resources(
    lifecycle_execution_id: LifecycleExecutionId,
    *,
    config_overrides: Optional[AsyncimagebuilderClientConfig] = None,
    parent_resource_id: Optional[NonEmptyString] = None,
    max_results: Optional[RestrictedInteger] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListLifecycleExecutionResourcesResponse

Lists resources that the runtime instance of the image lifecycle identified for lifecycle actions.

Parameters:

  • lifecycle_execution_id (LifecycleExecutionId) –

    The unique identifier for a runtime instance of the lifecycle policy.

  • parent_resource_id (Optional[NonEmptyString], default: None ) –

    The Amazon Resource Name (ARN) of an image build version to get the output resources for, such as AMIs or container images in Amazon ECR. You can get this value from the resourceId in the top-level response. If you leave this property empty, the response lists the Image Builder resources that the lifecycle execution identified for lifecycle actions. If the image build version that you specify in parentResourceId wasn't part of this lifecycle execution, the response contains an empty list.

  • max_results (Optional[RestrictedInteger], default: None ) –

    The maximum number of items to return in a single request.

  • next_token (Optional[PaginationToken], default: None ) –

    A token to specify where to start paginating. Use the nextToken value from a previously truncated response.

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.

  • InvalidPaginationTokenException –

    You have provided an invalid pagination token in your request.

  • InvalidRequestException –

    The request is malformed or otherwise invalid. Verify the request and try again.

  • 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:

List the resources that a lifecycle execution acted on The following example lists the resources that the specified lifecycle execution acted on. For a scheduled resource state update that hasn't started to apply changes yet, the resources list is empty.

>>> await client.list_lifecycle_execution_resources(lifecycle_execution_id='lce-401aefc3-a829-46f6-8fc2-91497988a503')
Source code in docs_src/capo_imagebuilder/_services/async_imagebuilder.py
async def list_lifecycle_execution_resources(
    self,
    lifecycle_execution_id: "capo_imagebuilder.types.lifecycle_execution_id.LifecycleExecutionId",
    *,
    config_overrides: Optional[AsyncimagebuilderClientConfig] = None,
    parent_resource_id: Optional[
        "capo_imagebuilder.types.non_empty_string.NonEmptyString"
    ] = None,
    max_results: Optional[
        "capo_imagebuilder.types.restricted_integer.RestrictedInteger"
    ] = None,
    next_token: Optional[
        "capo_imagebuilder.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_imagebuilder.types.list_lifecycle_execution_resources_response.ListLifecycleExecutionResourcesResponse":
    """<p>Lists resources that the runtime instance of the image lifecycle identified for lifecycle actions.</p>

    Args:
        lifecycle_execution_id: <p>The unique identifier for a runtime instance of the lifecycle policy.</p>
        parent_resource_id: <p>The Amazon Resource Name (ARN) of an image build version to get the output resources for, such as AMIs or container images in Amazon ECR. You can get this value from the <code>resourceId</code> in the top-level response. If you leave this property empty, the response lists the Image Builder resources that the lifecycle execution identified for lifecycle actions. If the image build version that you specify in <code>parentResourceId</code> wasn't part of this lifecycle execution, the response contains an empty list.</p>
        max_results: <p>The maximum number of items to return in a single request.</p>
        next_token: <p>A token to specify where to start paginating. Use the <code>nextToken</code> value from a previously truncated response.</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.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>You have provided an invalid pagination token in your request.</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.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:
        List the resources that a lifecycle execution acted on
        The following example lists the resources that the specified lifecycle execution acted on. For a scheduled resource state update that hasn't started to apply changes yet, the resources list is empty.

        >>> await client.list_lifecycle_execution_resources(lifecycle_execution_id='lce-401aefc3-a829-46f6-8fc2-91497988a503')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_imagebuilder.types.list_lifecycle_execution_resources_request.ListLifecycleExecutionResourcesRequest]",
    ) -> AsyncOperationResponse[
        "capo_imagebuilder.types.list_lifecycle_execution_resources_response.ListLifecycleExecutionResourcesResponse"
    ]:
        import capo_imagebuilder._operations.imagebuilder.list_lifecycle_execution_resources

        (
            output,
            http_response,
        ) = await capo_imagebuilder._operations.imagebuilder.list_lifecycle_execution_resources.async_list_lifecycle_execution_resources(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListLifecycleExecutionResources")
    )
    input_: capo_imagebuilder.types.list_lifecycle_execution_resources_request.ListLifecycleExecutionResourcesRequest = {
        "lifecycle_execution_id": lifecycle_execution_id
    }
    if parent_resource_id is not None:
        input_["parent_resource_id"] = parent_resource_id
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output