:doc:`SageMaker <../../sagemaker>` / Client / list_tags

*********
list_tags
*********



.. py:method:: SageMaker.Client.list_tags(**kwargs)

  

  Returns the tags for the specified SageMaker resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTags>`_  


  **Request Syntax**
  ::

    response = client.list_tags(
        ResourceArn='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type ResourceArn: string
  :param ResourceArn: **[REQUIRED]** 

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

    

  
  :type NextToken: string
  :param NextToken: 

    If the response to the previous ``ListTags`` request is truncated, SageMaker returns this token. To retrieve the next set of tags, use it in the subsequent request.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    Maximum number of tags to return.

    

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

    
    ::

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

    

    - *(dict) --* 
      

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

        An array of ``Tag`` objects, each with a tag key and a value.

        
        

        - *(dict) --* 

          A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

           

          You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see `AddTags <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AddTags.html>`__.

           

          For more information on adding metadata to your Amazon Web Services resources with tagging, see `Tagging Amazon Web Services resources <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>`__. For advice on best practices for managing Amazon Web Services resources with tagging, see `Tagging Best Practices\: Implement an Effective Amazon Web Services Resource Tagging Strategy <https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf>`__.

          
          

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

            The tag key. Tag keys must be unique per resource.

            
          

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

            The tag value.

            
      
    
      

      - **NextToken** *(string) --* 

        If response is truncated, SageMaker includes a token in the response. You can use this token in your subsequent request to fetch next set of tokens.

        
  