ListTagsForResource
Lists all of the tags associated with the Amazon Resource Name (ARN) that you specify. The resource can be a user, server, or role.
Request Syntax
{
"Arn": "string
",
"MaxResults": number
,
"NextToken": "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.
- Arn
-
Requests the tags associated with a particular Amazon Resource Name (ARN). An ARN is an identifier for a specific AWS resource, such as a server, user, or role.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 1600.
Pattern:
arn:.*
Required: Yes
- MaxResults
-
Specifies the number of tags to return as a response to the
ListTagsForResource
request.Type: Integer
Valid Range: Minimum value of 1. Maximum value of 1000.
Required: No
- NextToken
-
When you request additional results from the
ListTagsForResource
operation, aNextToken
parameter is returned in the input. You can then pass in a subsequent command to theNextToken
parameter to continue listing additional tags.Type: String
Length Constraints: Minimum length of 1. Maximum length of 6144.
Required: No
Response Syntax
{
"Arn": "string",
"NextToken": "string",
"Tags": [
{
"Key": "string",
"Value": "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.
- Arn
-
The ARN you specified to list the tags of.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 1600.
Pattern:
arn:.*
- NextToken
-
When you can get additional results from the
ListTagsForResource
call, aNextToken
parameter is returned in the output. You can then pass in a subsequent command to theNextToken
parameter to continue listing additional tags.Type: String
Length Constraints: Minimum length of 1. Maximum length of 6144.
- Tags
-
Key-value pairs that are assigned to a resource, usually for the purpose of grouping and searching for items. Tags are metadata that you define.
Type: Array of Tag objects
Array Members: Minimum number of 1 item. Maximum number of 50 items.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServiceError
-
This exception is thrown when an error occurs in the AWS Transfer Family service.
HTTP Status Code: 500
- InvalidNextTokenException
-
The
NextToken
parameter that was passed is invalid.HTTP Status Code: 400
- InvalidRequestException
-
This exception is thrown when the client submits a malformed request.
HTTP Status Code: 400
- ServiceUnavailableException
-
The request has failed because the AWSTransfer Family service is not available.
HTTP Status Code: 500
Examples
Example
The following example lists the tags for the resource with the ARN you specified.
Sample Request
{
"Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef"
}
Example
This example illustrates one usage of ListTagsForResource.
Sample Response
{
"Tags": [
{
"Key": "Name",
"Value": "MyServer"
}
]
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: