Skip to content

get_component_version_artifact

get_component_version_artifact(
    arn: ComponentVersionARN,
    artifact_name: NonEmptyString,
    *,
    config_overrides: Optional[GreengrassV2ClientConfig] = None,
    s3_endpoint_type: Optional[S3EndpointType] = None,
    iot_endpoint_type: Optional[IotEndpointType] = None,
) -> GetComponentVersionArtifactResponse

Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this operation to identify the URL that they can use to download an artifact to install.

Parameters:

  • arn (ComponentVersionARN) –

    The ARN of the component version. Specify the ARN of a public or a Lambda component version.

  • artifact_name (NonEmptyString) –

    The name of the artifact.

    You can use the GetComponent operation to download the component recipe, which includes the URI of the artifact. The artifact name is the section of the URI after the scheme. For example, in the artifact URI greengrass:SomeArtifact.zip, the artifact name is SomeArtifact.zip.

  • s3_endpoint_type (Optional[S3EndpointType], default: None ) –

    Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.

    All Amazon Web Services Regions except US East (N. Virginia) use REGIONAL in all cases. In the US East (N. Virginia) Region the default is GLOBAL, but you can change it to REGIONAL with this parameter.

  • iot_endpoint_type (Optional[IotEndpointType], default: None ) –

    Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint. Specify fips if you want the returned Amazon S3 pre-signed URL to point to an Amazon S3 FIPS endpoint. If you don't specify a value, the default is standard.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action.

  • InternalServerException –

    IoT Greengrass can't process your request right now. Try again later.

  • ResourceNotFoundException –

    The requested resource can't be found.

  • ThrottlingException –

    Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

  • ValidationException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_greengrassv2/_services/greengrass_v2.py
def get_component_version_artifact(
    self,
    arn: "capo_greengrassv2.types.component_version_arn.ComponentVersionARN",
    artifact_name: "capo_greengrassv2.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[GreengrassV2ClientConfig] = None,
    s3_endpoint_type: Optional[
        "capo_greengrassv2.types.s3_endpoint_type.S3EndpointType"
    ] = None,
    iot_endpoint_type: Optional[
        "capo_greengrassv2.types.iot_endpoint_type.IotEndpointType"
    ] = None,
) -> "capo_greengrassv2.types.get_component_version_artifact_response.GetComponentVersionArtifactResponse":
    """<p>Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this operation to identify the URL that they can use to download an artifact to install.</p>

    Args:
        arn: <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version. Specify the ARN of a public or a Lambda component version.</p>
        artifact_name: <p>The name of the artifact.</p> <p>You can use the <a href="https://docs.aws.amazon.com/greengrass/v2/APIReference/API_GetComponent.html">GetComponent</a> operation to download the component recipe, which includes the URI of the artifact. The artifact name is the section of the URI after the scheme. For example, in the artifact URI <code>greengrass:SomeArtifact.zip</code>, the artifact name is <code>SomeArtifact.zip</code>.</p>
        s3_endpoint_type: <p>Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.</p> <p>All Amazon Web Services Regions except US East (N. Virginia) use <code>REGIONAL</code> in all cases. In the US East (N. Virginia) Region the default is <code>GLOBAL</code>, but you can change it to <code>REGIONAL</code> with this parameter.</p>
        iot_endpoint_type: <p>Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint. Specify <code>fips</code> if you want the returned Amazon S3 pre-signed URL to point to an Amazon S3 FIPS endpoint. If you don't specify a value, the default is <code>standard</code>.</p>

    Raises:
        capo_greengrassv2.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_greengrassv2.errors.internal_server_exception.InternalServerException: <p>IoT Greengrass can't process your request right now. Try again later.</p>
        capo_greengrassv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_greengrassv2.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.</p>
        capo_greengrassv2.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_greengrassv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_greengrassv2.types.get_component_version_artifact_request.GetComponentVersionArtifactRequest]",
    ) -> OperationResponse[
        "capo_greengrassv2.types.get_component_version_artifact_response.GetComponentVersionArtifactResponse"
    ]:
        import capo_greengrassv2._operations.greengrass_v2.get_component_version_artifact

        output, http_response = (
            capo_greengrassv2._operations.greengrass_v2.get_component_version_artifact.get_component_version_artifact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetComponentVersionArtifact")
    )
    input_: capo_greengrassv2.types.get_component_version_artifact_request.GetComponentVersionArtifactRequest = {
        "arn": arn,
        "artifact_name": artifact_name,
    }
    if s3_endpoint_type is not None:
        input_["s3_endpoint_type"] = s3_endpoint_type
    if iot_endpoint_type is not None:
        input_["iot_endpoint_type"] = iot_endpoint_type

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