:doc:`StorageGateway <../../storagegateway>` / Client / add_tags_to_resource

********************
add_tags_to_resource
********************



.. py:method:: StorageGateway.Client.add_tags_to_resource(**kwargs)

  

  Adds one or more tags to the specified resource. You use tags to add metadata to resources, which you can use to categorize these resources. For example, you can categorize resources by purpose, owner, environment, or team. Each tag consists of a key and a value, which you define. You can add tags to the following Storage Gateway resources:

   

  
  * Storage gateways of all types
   
  * Storage volumes
   
  * Virtual tapes
   
  * NFS and SMB file shares
   
  * File System associations
  

   

  You can create a maximum of 50 tags for each resource. Virtual tapes and storage volumes that are recovered to a new gateway maintain their tags.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/AddTagsToResource>`_  


  **Request Syntax**
  ::

    response = client.add_tags_to_resource(
        ResourceARN='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ResourceARN: string
  :param ResourceARN: **[REQUIRED]** 

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

    

  
  :type Tags: list
  :param Tags: **[REQUIRED]** 

    The key-value pair that represents the tag you want to add to the resource. The value can be an empty string.

     

    .. note::

      

      Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.

      

    

  
    - *(dict) --* 

      A key-value pair that helps you manage, filter, and search for your resource. Allowed characters: letters, white space, and numbers, representable in UTF-8, and the following characters: + - = . _ : /.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        Tag key. The key can't start with aws:.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        Value of the tag key.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ResourceARN': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      AddTagsToResourceOutput

      
      

      - **ResourceARN** *(string) --* 

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

        
  
  **Exceptions**
  
  *   :py:class:`StorageGateway.Client.exceptions.InvalidGatewayRequestException`

  
  *   :py:class:`StorageGateway.Client.exceptions.InternalServerError`

  

  **Examples**

  Adds one or more tags to the specified resource.
  ::

    response = client.add_tags_to_resource(
        ResourceARN='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-11A2222B',
        Tags=[
            {
                'Key': 'Dev Gatgeway Region',
                'Value': 'East Coast',
            },
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResourceARN': 'arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-11A2222B',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  