Skip to content

get_component

get_component(
    component_build_version_arn: ComponentVersionArnOrBuildVersionArn,
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
) -> GetComponentResponse

Retrieves a component object.

Parameters:

  • component_build_version_arn (ComponentVersionArnOrBuildVersionArn) –

    The Amazon Resource Name (ARN) of the component that you want to get. You can specify a build version ARN, or a component version ARN. The version can use the x wildcard in trailing positions, for example 1.0.x or 1.x.x. Version ARNs resolve to the latest available matching component build version.

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.

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

Get the details of a component build version The following example retrieves a component build version. The data field in the response contains the YAML document that defines the component.

>>> client.get_component(component_build_version_arn='arn:aws:imagebuilder:us-west-2:111122223333:component/my-example-component/1.0.0/1')
Source code in docs_src/capo_imagebuilder/_services/imagebuilder.py
def get_component(
    self,
    component_build_version_arn: "capo_imagebuilder.types.component_version_arn_or_build_version_arn.ComponentVersionArnOrBuildVersionArn",
    *,
    config_overrides: Optional[imagebuilderClientConfig] = None,
) -> "capo_imagebuilder.types.get_component_response.GetComponentResponse":
    """<p>Retrieves a component object.</p>

    Args:
        component_build_version_arn: <p>The Amazon Resource Name (ARN) of the component that you want to get. You can specify a build version ARN, or a component version ARN. The version can use the <code>x</code> wildcard in trailing positions, for example <code>1.0.x</code> or <code>1.x.x</code>. Version ARNs resolve to the latest available matching component build version.</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_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:
        Get the details of a component build version
        The following example retrieves a component build version. The data field in the response contains the YAML document that defines the component.

        >>> client.get_component(component_build_version_arn='arn:aws:imagebuilder:us-west-2:111122223333:component/my-example-component/1.0.0/1')
    """

    def _handler(
        req: "OperationRequest[capo_imagebuilder.types.get_component_request.GetComponentRequest]",
    ) -> OperationResponse[
        "capo_imagebuilder.types.get_component_response.GetComponentResponse"
    ]:
        import capo_imagebuilder._operations.imagebuilder.get_component

        output, http_response = (
            capo_imagebuilder._operations.imagebuilder.get_component.get_component(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetComponent")
    )
    input_: capo_imagebuilder.types.get_component_request.GetComponentRequest = {
        "component_build_version_arn": component_build_version_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output