:doc:`ServiceDiscovery <../../servicediscovery>` / Client / delete_namespace

****************
delete_namespace
****************



.. py:method:: ServiceDiscovery.Client.delete_namespace(**kwargs)

  

  Deletes a namespace from the current account. If the namespace still contains one or more services, the request fails.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/DeleteNamespace>`_  


  **Request Syntax**
  ::

    response = client.delete_namespace(
        Id='string'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The ID or Amazon Resource Name (ARN) of the namespace that you want to delete.

    

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

    
    ::

      {
          'OperationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **OperationId** *(string) --* 

        A value that you can use to determine whether the request completed successfully. To get the status of the operation, see `GetOperation <https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html>`__.

        
  
  **Exceptions**
  
  *   :py:class:`ServiceDiscovery.Client.exceptions.InvalidInput`

  
  *   :py:class:`ServiceDiscovery.Client.exceptions.NamespaceNotFound`

  
  *   :py:class:`ServiceDiscovery.Client.exceptions.ResourceInUse`

  
  *   :py:class:`ServiceDiscovery.Client.exceptions.DuplicateRequest`

  

  **Examples**

  Example: Delete namespace
  ::

    response = client.delete_namespace(
        Id='ns-ylexjili4cdxy3xm',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'OperationId': 'gv4g5meo7ndmeh4fqskygvk23d2fijwa-k98y6drk',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  