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

**********************
list_tags_for_resource
**********************



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

  

  Lists tags for the specified resource.

  

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


  **Request Syntax**
  ::

    response = client.list_tags_for_resource(
        ResourceARN='string'
    )
    
  :type ResourceARN: string
  :param ResourceARN: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.

    

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

    
    ::

      {
          'Tags': [
              {
                  'Key': 'string',
                  'Value': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Tags** *(list) --* 

        The tags that are assigned to the resource.

        
        

        - *(dict) --* 

          A custom key-value pair that's associated with a resource.

          
          

          - **Key** *(string) --* 

            The key identifier, or name, of the tag.

            
          

          - **Value** *(string) --* 

            The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

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

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

  

  **Examples**

  This example lists the tags of a resource.
  ::

    response = client.list_tags_for_resource(
        ResourceARN='arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Tags': [
            {
                'Key': 'Project',
                'Value': 'Zeta',
            },
            {
                'Key': 'Department',
                'Value': 'Engineering',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  