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

*********
put_image
*********



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

  

  Creates or updates the image manifest and tags that are associated with an image.

   

  When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags that are associated with the image.

   

  .. 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/PutImage>`_  


  **Request Syntax**
  ::

    response = client.put_image(
        registryId='string',
        repositoryName='string',
        imageManifest='string',
        imageManifestMediaType='string',
        imageTag='string',
        imageDigest='string'
    )
    
  :type registryId: string
  :param registryId: 

    The Amazon Web Services account ID, or registry alias, that's associated with the public registry that contains the repository where the image is put. If you do not specify a registry, the default public registry is assumed.

    

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

    The name of the repository where the image is put.

    

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

    The image manifest that corresponds to the image to be uploaded.

    

  
  :type imageManifestMediaType: string
  :param imageManifestMediaType: 

    The media type of the image manifest. If you push an image manifest that doesn't contain the ``mediaType`` field, you must specify the ``imageManifestMediaType`` in the request.

    

  
  :type imageTag: string
  :param imageTag: 

    The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.

    

  
  :type imageDigest: string
  :param imageDigest: 

    The image digest of the image manifest that corresponds to the image.

    

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

    
    ::

      {
          'image': {
              'registryId': 'string',
              'repositoryName': 'string',
              'imageId': {
                  'imageDigest': 'string',
                  'imageTag': 'string'
              },
              'imageManifest': 'string',
              'imageManifestMediaType': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **image** *(dict) --* 

        Details of the image uploaded.

        
        

        - **registryId** *(string) --* 

          The Amazon Web Services account ID that's associated with the registry containing the image.

          
        

        - **repositoryName** *(string) --* 

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

          
        

        - **imageId** *(dict) --* 

          An object that contains the image tag and image digest associated with an image.

          
          

          - **imageDigest** *(string) --* 

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

            
          

          - **imageTag** *(string) --* 

            The tag that's used for the image.

            
      
        

        - **imageManifest** *(string) --* 

          The image manifest that's associated with the image.

          
        

        - **imageManifestMediaType** *(string) --* 

          The manifest media type of the image.

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

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

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

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

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

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

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

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

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

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

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

  