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

*****************
delete_repository
*****************



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

  

  Deletes a repository in a public registry. If the repository contains images, you must either manually delete all images in the repository or use the ``force`` option. This option deletes all images on your behalf before deleting the repository.

  

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


  **Request Syntax**
  ::

    response = client.delete_repository(
        registryId='string',
        repositoryName='string',
        force=True|False
    )
    
  :type registryId: string
  :param registryId: 

    The Amazon Web Services account ID that's associated with the public registry that contains the repository to delete. If you do not specify a registry, the default public registry is assumed.

    

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

    The name of the repository to delete.

    

  
  :type force: boolean
  :param force: 

    The force option can be used to delete a repository that contains images. If the force option is not used, the repository must be empty prior to deletion.

    

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

    
    ::

      {
          'repository': {
              'repositoryArn': 'string',
              'registryId': 'string',
              'repositoryName': 'string',
              'repositoryUri': 'string',
              'createdAt': datetime(2015, 1, 1)
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **repository** *(dict) --* 

        The repository that was deleted.

        
        

        - **repositoryArn** *(string) --* 

          The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the ``arn:aws:ecr`` namespace, followed by the region of the repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name. For example, ``arn:aws:ecr:region:012345678910:repository/test``.

          
        

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

          The Amazon Web Services account ID that's associated with the public registry that contains the repository.

          
        

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

          The name of the repository.

          
        

        - **repositoryUri** *(string) --* 

          The URI for the repository. You can use this URI for container image ``push`` and ``pull`` operations.

          
        

        - **createdAt** *(datetime) --* 

          The date and time, in JavaScript date format, when the repository was created.

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

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

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

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

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

  