SageMaker / Client / list_tags



Returns the tags for the specified SageMaker resource.

See also: AWS API Documentation

Request Syntax

response = client.list_tags(
  • ResourceArn (string) –


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

  • NextToken (string) – 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.

  • MaxResults (integer) – Maximum number of tags to return.

Return type:



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.

        For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. 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.

        • 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.