:doc:`ECRPublic <../../ecr-public>` / Client / batch_check_layer_availability

******************************
batch_check_layer_availability
******************************



.. py:method:: ECRPublic.Client.batch_check_layer_availability(**kwargs)

  

  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.

   

  .. note::

    

    This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the ``docker`` CLI to pull, tag, and push images.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ecr-public-2020-10-30/BatchCheckLayerAvailability>`_  


  **Request Syntax**
  ::

    response = client.batch_check_layer_availability(
        registryId='string',
        repositoryName='string',
        layerDigests=[
            'string',
        ]
    )
    
  :type registryId: string
  :param 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.

    

  
  :type repositoryName: string
  :param repositoryName: **[REQUIRED]** 

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

    

  
  :type layerDigests: list
  :param layerDigests: **[REQUIRED]** 

    The digests of the image layers to check.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'layers': [
              {
                  'layerDigest': 'string',
                  'layerAvailability': 'AVAILABLE'|'UNAVAILABLE',
                  'layerSize': 123,
                  'mediaType': 'string'
              },
          ],
          'failures': [
              {
                  'layerDigest': 'string',
                  'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest',
                  'failureReason': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **layers** *(list) --* 

        A list of image layer objects that correspond to the image layer references in the request.

        
        

        - *(dict) --* 

          An object that represents an Amazon ECR image layer.

          
          

          - **layerDigest** *(string) --* 

            The ``sha256`` digest of the image layer.

            
          

          - **layerAvailability** *(string) --* 

            The availability status of the image layer.

            
          

          - **layerSize** *(integer) --* 

            The size, in bytes, of the image layer.

            
          

          - **mediaType** *(string) --* 

            The media type of the layer, such as ``application/vnd.docker.image.rootfs.diff.tar.gzip`` or ``application/vnd.oci.image.layer.v1.tar+gzip``.

            
      
    
      

      - **failures** *(list) --* 

        Any failures associated with the call.

        
        

        - *(dict) --* 

          An object that represents an Amazon ECR image layer failure.

          
          

          - **layerDigest** *(string) --* 

            The layer digest that's associated with the failure.

            
          

          - **failureCode** *(string) --* 

            The failure code that's associated with the failure.

            
          

          - **failureReason** *(string) --* 

            The reason for the failure.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ECRPublic.Client.exceptions.RepositoryNotFoundException`

  
  *   :py:class:`ECRPublic.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`ECRPublic.Client.exceptions.ServerException`

  
  *   :py:class:`ECRPublic.Client.exceptions.RegistryNotFoundException`

  
  *   :py:class:`ECRPublic.Client.exceptions.UnsupportedCommandException`

  