batchCheckLayerAvailability method

Future<BatchCheckLayerAvailabilityResponse> batchCheckLayerAvailability({
  1. required List<String> layerDigests,
  2. required String repositoryName,
  3. String? registryId,
})

Checks the availability of one or more image layers that are within a repository in a public registry. When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.

May throw InvalidParameterException. May throw RegistryNotFoundException. May throw RepositoryNotFoundException. May throw ServerException. May throw UnsupportedCommandException.

Parameter layerDigests : The digests of the image layers to check.

Parameter repositoryName : The name of the repository that's associated with the image layers to check.

Parameter registryId : The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.

Implementation

Future<BatchCheckLayerAvailabilityResponse> batchCheckLayerAvailability({
  required List<String> layerDigests,
  required String repositoryName,
  String? registryId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SpencerFrontendService.BatchCheckLayerAvailability'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'layerDigests': layerDigests,
      'repositoryName': repositoryName,
      if (registryId != null) 'registryId': registryId,
    },
  );

  return BatchCheckLayerAvailabilityResponse.fromJson(jsonResponse.body);
}