batchGetImage method
Gets detailed information for an image. Images are specified with either
an imageTag or imageDigest.
When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest.
May throw InvalidParameterException.
May throw LimitExceededException.
May throw RepositoryNotFoundException.
May throw ServerException.
May throw UnableToGetUpstreamImageException.
Parameter imageIds :
A list of image ID references that correspond to images to describe. The
format of the imageIds reference is imageTag=tag
or imageDigest=digest.
Parameter repositoryName :
The repository that contains the images to describe.
Parameter acceptedMediaTypes :
The accepted media types for the request.
Valid values:
application/vnd.docker.distribution.manifest.v1+json |
application/vnd.docker.distribution.manifest.v2+json |
application/vnd.oci.image.manifest.v1+json
Parameter registryId :
The Amazon Web Services account ID associated with the registry that
contains the images to describe. If you do not specify a registry, the
default registry is assumed.
Implementation
Future<BatchGetImageResponse> batchGetImage({
required List<ImageIdentifier> imageIds,
required String repositoryName,
List<String>? acceptedMediaTypes,
String? registryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerRegistry_V20150921.BatchGetImage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'imageIds': imageIds,
'repositoryName': repositoryName,
if (acceptedMediaTypes != null)
'acceptedMediaTypes': acceptedMediaTypes,
if (registryId != null) 'registryId': registryId,
},
);
return BatchGetImageResponse.fromJson(jsonResponse.body);
}