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

**************
delete_service
**************



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

  

  Deletes a specified service and all associated service attributes. If the service still contains one or more registered instances, the request fails.

  

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


  **Request Syntax**
  ::

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

    The ID or Amazon Resource Name (ARN) of the service that you want to delete. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see `Cross-account Cloud Map namespace sharing <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`ServiceDiscovery.Client.exceptions.InvalidInput`

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

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

  

  **Examples**

  Example: Delete service
  ::

    response = client.delete_service(
        Id='srv-p5zdwlg5uvvzjita',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  