Skip to content

upload_layer_part async

upload_layer_part(
    repository_name: RepositoryName,
    upload_id: UploadId,
    part_first_byte: PartSize,
    part_last_byte: PartSize,
    layer_part_blob: LayerPartBlob,
    *,
    config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
    registry_id: Optional[RegistryIdOrAlias] = None,
) -> UploadLayerPartResponse

Uploads an image layer part to Amazon ECR.

When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (about 20MB). The UploadLayerPart API is called once for each new image layer part.

This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Parameters:

  • registry_id (Optional[RegistryIdOrAlias], default: None ) –

    The Amazon Web Services account ID, or registry alias, that's associated with the registry that you're uploading layer parts to. If you do not specify a registry, the default public registry is assumed.

  • repository_name (RepositoryName) –

    The name of the repository that you're uploading layer parts to.

  • upload_id (UploadId) –

    The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.

  • part_first_byte (PartSize) –

    The position of the first byte of the layer part witin the overall image layer.

  • part_last_byte (PartSize) –

    The position of the last byte of the layer part within the overall image layer.

  • layer_part_blob (LayerPartBlob) –

    The base64-encoded layer part payload.

Raises:

Source code in docs_src/capo_ecr_public/_services/async_ecrpublic.py
async def upload_layer_part(
    self,
    repository_name: "capo_ecr_public.types.repository_name.RepositoryName",
    upload_id: "capo_ecr_public.types.upload_id.UploadId",
    part_first_byte: "capo_ecr_public.types.part_size.PartSize",
    part_last_byte: "capo_ecr_public.types.part_size.PartSize",
    layer_part_blob: "capo_ecr_public.types.layer_part_blob.LayerPartBlob",
    *,
    config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
    registry_id: Optional[
        "capo_ecr_public.types.registry_id_or_alias.RegistryIdOrAlias"
    ] = None,
) -> "capo_ecr_public.types.upload_layer_part_response.UploadLayerPartResponse":
    """<p>Uploads an image layer part to Amazon ECR.</p> <p>When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (about 20MB). The UploadLayerPart API is called once for each new image layer part.</p> <note> <p>This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the <code>docker</code> CLI to pull, tag, and push images.</p> </note>

    Args:
        registry_id: <p>The Amazon Web Services account ID, or registry alias, that's associated with the registry that you're uploading layer parts to. If you do not specify a registry, the default public registry is assumed.</p>
        repository_name: <p>The name of the repository that you're uploading layer parts to.</p>
        upload_id: <p>The upload ID from a previous <a>InitiateLayerUpload</a> operation to associate with the layer part upload.</p>
        part_first_byte: <p>The position of the first byte of the layer part witin the overall image layer.</p>
        part_last_byte: <p>The position of the last byte of the layer part within the overall image layer.</p>
        layer_part_blob: <p>The base64-encoded layer part payload.</p>

    Raises:
        capo_ecr_public.errors.invalid_layer_part_exception.InvalidLayerPartException: <p>The layer part size isn't valid, or the first byte specified isn't consecutive to the last byte of a previous layer part upload.</p>
        capo_ecr_public.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr_public.errors.limit_exceeded_exception.LimitExceededException: <p>The operation didn't succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR Service Quotas</a> in the Amazon Elastic Container Registry User Guide.</p>
        capo_ecr_public.errors.registry_not_found_exception.RegistryNotFoundException: <p>The registry doesn't exist.</p>
        capo_ecr_public.errors.repository_not_found_exception.RepositoryNotFoundException: <p>The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.</p>
        capo_ecr_public.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr_public.errors.unsupported_command_exception.UnsupportedCommandException: <p>The action isn't supported in this Region.</p>
        capo_ecr_public.errors.upload_not_found_exception.UploadNotFoundException: <p>The upload can't be found, or the specified upload ID isn't valid for this repository.</p>
        capo_ecr_public.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecr_public.types.upload_layer_part_request.UploadLayerPartRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecr_public.types.upload_layer_part_response.UploadLayerPartResponse"
    ]:
        import capo_ecr_public._operations.spencer_frontend_service.upload_layer_part

        (
            output,
            http_response,
        ) = await capo_ecr_public._operations.spencer_frontend_service.upload_layer_part.async_upload_layer_part(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UploadLayerPart")
    )
    input_: capo_ecr_public.types.upload_layer_part_request.UploadLayerPartRequest = {
        "repository_name": repository_name,
        "upload_id": upload_id,
        "part_first_byte": part_first_byte,
        "part_last_byte": part_last_byte,
        "layer_part_blob": layer_part_blob,
    }
    if registry_id is not None:
        input_["registry_id"] = registry_id

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