:doc:`MachineLearning <../../machinelearning>` / Client / add_tags

********
add_tags
********



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/machinelearning-2014-12-12/AddTags>`_  


  **Request Syntax**
  ::

    response = client.add_tags(
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        ResourceId='string',
        ResourceType='BatchPrediction'|'DataSource'|'Evaluation'|'MLModel'
    )
    
  :type Tags: list
  :param Tags: **[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 @.

        

      
    

  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

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

    

  
  :type ResourceType: string
  :param ResourceType: **[REQUIRED]** 

    The type of the ML object to tag.

    

  
  
  :rtype: 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**
  
  *   :py:class:`MachineLearning.Client.exceptions.InvalidInputException`

  
  *   :py:class:`MachineLearning.Client.exceptions.InvalidTagException`

  
  *   :py:class:`MachineLearning.Client.exceptions.TagLimitExceededException`

  
  *   :py:class:`MachineLearning.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`MachineLearning.Client.exceptions.InternalServerException`

  