Menu
AWS CloudHSM V2
API Reference (API Version 2017-04-28)

ListTags

Gets a list of tags for the specified AWS CloudHSM cluster.

This is a paginated operation, which means that each response might contain only a subset of all the tags. When the response contains only a subset of tags, it includes a NextToken value. Use this value in a subsequent ListTags request to get more tags. When you receive a response with no NextToken (or an empty or null value), that means there are no more tags to get.

Request Syntax

{
   "MaxResults": number,
   "NextToken": "string",
   "ResourceId": "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.

MaxResults

The maximum number of tags to return in the response. When there are more tags than the number you specify, the response contains a NextToken value.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

NextToken

The NextToken value that you received in the previous response. Use this value to get more tags.

Type: String

Length Constraints: Maximum length of 256.

Pattern: .*

Required: No

ResourceId

The cluster identifier (ID) for the cluster whose tags you are getting. To find the cluster ID, use DescribeClusters.

Type: String

Pattern: cluster-[2-7a-zA-Z]{11,16}

Required: Yes

Response Syntax

{
   "NextToken": "string",
   "TagList": [ 
      { 
         "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.

NextToken

An opaque string that indicates that the response contains only a subset of tags. Use this value in a subsequent ListTags request to get more tags.

Type: String

Length Constraints: Maximum length of 256.

Pattern: .*

TagList

A list of tags.

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.

CloudHsmAccessDeniedException

The request was rejected because the requester does not have permission to perform the requested operation.

HTTP Status Code: 400

CloudHsmInternalFailureException

The request was rejected because of an AWS CloudHSM internal failure. The request can be retried.

HTTP Status Code: 500

CloudHsmInvalidRequestException

The request was rejected because it is not a valid request.

HTTP Status Code: 400

CloudHsmResourceNotFoundException

The request was rejected because it refers to a resource that cannot be found.

HTTP Status Code: 400

CloudHsmServiceException

The request was rejected because an error occurred.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: