MachineLearning / Client / add_tags

add_tags#

MachineLearning.Client.add_tags(**kwargs)#

Adds one or more tags to an object, up to a limit of 10. Each tag consists of a key and an optional value. If you add a tag using a key that is already associated with the ML object, AddTags updates the tag’s value.

See also: AWS API Documentation

Request Syntax

response = client.add_tags(
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ResourceId='string',
    ResourceType='BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
)
Parameters:
  • Tags (list) –

    [REQUIRED]

    The key-value pairs to use to create tags. If you specify a key without specifying a value, Amazon ML creates a tag with the specified key and a value of null.

    • (dict) –

      A custom key-value pair associated with an ML object, such as an ML model.

      • Key (string) –

        A unique identifier for the tag. Valid characters include Unicode letters, digits, white space, _, ., /, =, +, -, %, and @.

      • Value (string) –

        An optional string, typically used to describe or define the tag. Valid characters include Unicode letters, digits, white space, _, ., /, =, +, -, %, and @.

  • ResourceId (string) –

    [REQUIRED]

    The ID of the ML object to tag. For example, exampleModelId.

  • ResourceType (string) –

    [REQUIRED]

    The type of the ML object to tag.

Return type:

dict

Returns:

Response Syntax

{
    'ResourceId': 'string',
    'ResourceType': 'BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
}

Response Structure

  • (dict) –

    Amazon ML returns the following elements.

    • ResourceId (string) –

      The ID of the ML object that was tagged.

    • ResourceType (string) –

      The type of the ML object that was tagged.

Exceptions

  • MachineLearning.Client.exceptions.InvalidInputException

  • MachineLearning.Client.exceptions.InvalidTagException

  • MachineLearning.Client.exceptions.TagLimitExceededException

  • MachineLearning.Client.exceptions.ResourceNotFoundException

  • MachineLearning.Client.exceptions.InternalServerException