batchDeleteImage method
Deletes a list of specified images that are within a repository in a
public registry. Images are specified with either an imageTag
or imageDigest.
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the digest of the image in your request.
May throw InvalidParameterException.
May throw RepositoryNotFoundException.
May throw ServerException.
May throw UnsupportedCommandException.
Parameter imageIds :
A list of image ID references that correspond to images to delete. The
format of the imageIds reference is imageTag=tag
or imageDigest=digest.
Parameter repositoryName :
The repository in a public registry that contains the image to delete.
Parameter registryId :
The Amazon Web Services account ID, or registry alias, that's associated
with the registry that contains the image to delete. If you do not specify
a registry, the default public registry is assumed.
Implementation
Future<BatchDeleteImageResponse> batchDeleteImage({
required List<ImageIdentifier> imageIds,
required String repositoryName,
String? registryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SpencerFrontendService.BatchDeleteImage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'imageIds': imageIds,
'repositoryName': repositoryName,
if (registryId != null) 'registryId': registryId,
},
);
return BatchDeleteImageResponse.fromJson(jsonResponse.body);
}