Batch / Client / list_tags_for_resource

list_tags_for_resource#

Batch.Client.list_tags_for_resource(**kwargs)#

Lists the tags for an Batch resource. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren’t supported.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    resourceArn='string'
)
Parameters:

resourceArn (string) –

[REQUIRED]

The Amazon Resource Name (ARN) that identifies the resource that tags are listed for. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren’t supported.

Return type:

dict

Returns:

Response Syntax

{
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • tags (dict) –

      The tags for the resource.

      • (string) –

        • (string) –

Exceptions

  • Batch.Client.exceptions.ClientException

  • Batch.Client.exceptions.ServerException

Examples

This demonstrates calling the ListTagsForResource action.

response = client.list_tags_for_resource(
    resourceArn='arn:aws:batch:us-east-1:123456789012:job-definition/sleep30:1',
)

print(response)

Expected Output:

{
    'tags': {
        'Department': 'Engineering',
        'Stage': 'Alpha',
        'User': 'JaneDoe',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}