AWS Directory Service

2016/07/07 - AWS Directory Service - 3 new api methods

ListTagsForResource (new) Link ¶

Lists all tags on an Amazon Directory Services directory.

Request Syntax

client.list_tags_for_resource(
    ResourceId='string',
    NextToken='string',
    Limit=123
)
type ResourceId

string

param ResourceId

[REQUIRED]

The ID of the directory for which you want to retrieve tags.

type NextToken

string

param NextToken

Reserved for future use.

type Limit

integer

param Limit

Reserved for future use.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • Tags (list) --

      List of tags returned by the ListTagsForResource operation.

      • (dict) --

        Metadata assigned to an Amazon Directory Services directory consisting of a key-value pair.

        • Key (string) --

          A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and cannot be prefixed with "aws:". The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$").

        • Value (string) --

          A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$").

    • NextToken (string) --

      Reserved for future use.

AddTagsToResource (new) Link ¶

Adds or overwrites one or more tags for the specified Amazon Directory Services directory. Each directory can have a maximum of 10 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

Request Syntax

client.add_tags_to_resource(
    ResourceId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceId

string

param ResourceId

[REQUIRED]

The ID of the directory to which to add the tag.

type Tags

list

param Tags

[REQUIRED]

The tags to be assigned to the Amazon Directory Services directory.

  • (dict) --

    Metadata assigned to an Amazon Directory Services directory consisting of a key-value pair.

    • Key (string) -- [REQUIRED]

      A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and cannot be prefixed with "aws:". The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$").

    • Value (string) -- [REQUIRED]

      A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$").

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

RemoveTagsFromResource (new) Link ¶

Removes tags from an Amazon Directory Services directory.

Request Syntax

client.remove_tags_from_resource(
    ResourceId='string',
    TagKeys=[
        'string',
    ]
)
type ResourceId

string

param ResourceId

[REQUIRED]

The ID of the directory from which to remove the tag.

type TagKeys

list

param TagKeys

[REQUIRED]

The tag key (name) of the tag to be removed.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --