batchGetImage method

Future<BatchGetImageResponse> batchGetImage({
  1. required List<ImageIdentifier> imageIds,
  2. required String repositoryName,
  3. List<String>? acceptedMediaTypes,
  4. String? registryId,
})

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 ServerException. May throw InvalidParameterException. May throw RepositoryNotFoundException.

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 AWS 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 {
  ArgumentError.checkNotNull(imageIds, 'imageIds');
  ArgumentError.checkNotNull(repositoryName, 'repositoryName');
  _s.validateStringLength(
    'repositoryName',
    repositoryName,
    2,
    256,
    isRequired: true,
  );
  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);
}