Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class ListTagsForResourceCommandProtected

Lists tags for Amazon FSx resources.

When retrieving all tags, you can optionally specify the MaxResults parameter to limit the number of tags in a response. If more tags remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of NextToken from the last response.

This action is used in an iterative process to retrieve a list of your tags. ListTagsForResource is called first without a NextTokenvalue. Then the action continues to be called with the NextToken parameter set to the value of the last NextToken value until a response has no NextToken.

When using this action, keep the following in mind:

  • The implementation might return fewer than MaxResults file system descriptions while still including a NextToken value.

  • The order of tags returned in the response of one ListTagsForResource call and the order of tags returned across the responses of a multi-call iteration is unspecified.

Example

Use a bare-bones client and the command you need to make an API call.

import { FSxClient, ListTagsForResourceCommand } from "@aws-sdk/client-fsx"; // ES Modules import
// const { FSxClient, ListTagsForResourceCommand } = require("@aws-sdk/client-fsx"); // CommonJS import
const client = new FSxClient(config);
const input = { // ListTagsForResourceRequest
ResourceARN: "STRING_VALUE", // required
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new ListTagsForResourceCommand(input);
const response = await client.send(command);
// { // ListTagsForResourceResponse
// Tags: [ // Tags
// { // Tag
// Key: "STRING_VALUE", // required
// Value: "STRING_VALUE", // required
// },
// ],
// NextToken: "STRING_VALUE",
// };

Param

ListTagsForResourceCommandInput

Returns

ListTagsForResourceCommandOutput

See

Throws

BadRequest (client fault)

A generic error indicating a failure with a client request.

Throws

InternalServerError (server fault)

A generic error indicating a server-side failure.

Throws

NotServiceResourceError (client fault)

The resource specified for the tagging operation is not a resource type owned by Amazon FSx. Use the API of the relevant service to perform the operation.

Throws

ResourceDoesNotSupportTagging (client fault)

The resource specified does not support tagging.

Throws

ResourceNotFound (client fault)

The resource specified by the Amazon Resource Name (ARN) can't be found.

Throws

FSxServiceException

Base exception class for all service exceptions from FSx service.

Example

To list tags for a resource

// This operation lists tags for an Amazon FSx resource.
const input = {
"ResourceARN": "arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec"
};
const command = new ListTagsForResourceCommand(input);
const response = await client.send(command);
/* response ==
{
"Tags": [
{
"Key": "Name",
"Value": "MyFileSystem"
}
]
}
*/
// example id: to-list-tags-for-a-fsx-resource-1481847318372

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods