completeLayerUpload method
Informs Amazon ECR that the image layer upload has completed for a
specified registry, repository name, and upload ID. You can optionally
provide a sha256 digest of the image layer for data
validation purposes.
When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.
May throw EmptyUploadException.
May throw InvalidLayerException.
May throw InvalidParameterException.
May throw KmsException.
May throw LayerAlreadyExistsException.
May throw LayerPartTooSmallException.
May throw RepositoryNotFoundException.
May throw ServerException.
May throw UploadNotFoundException.
Parameter layerDigests :
The sha256 digest of the image layer.
Parameter repositoryName :
The name of the repository to associate with the image layer.
Parameter uploadId :
The upload ID from a previous InitiateLayerUpload operation to
associate with the image layer.
Parameter registryId :
The Amazon Web Services account ID associated with the registry to which
to upload layers. If you do not specify a registry, the default registry
is assumed.
Implementation
Future<CompleteLayerUploadResponse> completeLayerUpload({
required List<String> layerDigests,
required String repositoryName,
required String uploadId,
String? registryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'layerDigests': layerDigests,
'repositoryName': repositoryName,
'uploadId': uploadId,
if (registryId != null) 'registryId': registryId,
},
);
return CompleteLayerUploadResponse.fromJson(jsonResponse.body);
}