AddTagsToResource
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.
Request Syntax
{
"ResourceARN": "string
",
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ResourceARN
-
The Amazon Resource Name (ARN) of the resource you want to add tags to.
Type: String
Length Constraints: Minimum length of 50. Maximum length of 500.
Required: Yes
- Tags
-
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.
Type: Array of Tag objects
Required: Yes
Response Syntax
{
"ResourceARN": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ResourceARN
-
The Amazon Resource Name (ARN) of the resource you want to add tags to.
Type: String
Length Constraints: Minimum length of 50. Maximum length of 500.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerError
-
An internal server error has occurred during the request. For more information, see the error and message fields.
HTTP Status Code: 400
- InvalidGatewayRequestException
-
An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: