ListTagsForResource - Amazon Kinesis Data Streams Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ListTagsForResource

List all tags added to the specified Kinesis resource. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.

For more information about tagging Kinesis resources, see Tag your Amazon Kinesis Data Streams resources.

Request Syntax

{ "ResourceARN": "string", "StreamId": "string" }

Request Parameters

The request accepts the following data in JSON format.

ResourceARN

The Amazon Resource Name (ARN) of the Kinesis resource for which to list tags.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: arn:aws.*:kinesis:.*:\d{12}:.*stream/\S+

Required: Yes

StreamId

Not Implemented. Reserved for future use.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 24.

Pattern: [a-z0-9]{20}-[a-z0-9]{3}

Required: No

Response Syntax

{ "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.

Tags

An array of tags associated with the specified Kinesis resource.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 200 items.

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

Specifies that you do not have the permissions required to perform this operation.

HTTP Status Code: 400

InvalidArgumentException

A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

message

A message that provides information about the error.

HTTP Status Code: 400

LimitExceededException

The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

message

A message that provides information about the error.

HTTP Status Code: 400

ResourceInUseException

The resource is not available for this operation. For successful operation, the resource must be in the ACTIVE state.

message

A message that provides information about the error.

HTTP Status Code: 400

ResourceNotFoundException

The requested resource could not be found. The stream might not be specified correctly.

message

A message that provides information about the error.

HTTP Status Code: 400

Examples

To list all tags added to a resource

The following JSON example lists all the tags for a specific consumer.

Sample Request

POST / HTTP/1.1 Host: kinesis.<region>.<domain> Content-Length: <PayloadSizeBytes> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Authorization: <AuthParams> Connection: Keep-Alive X-Amz-Date: <Date> X-Amz-Target: Kinesis_20131202.ListTagsForResource { "ResourceARN": "arn:aws:kinesis:us-east-1:123456789012:/stream/myStream/consumer/myConsumer:174353308" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "Tags" : [ { "Key": "Project", "Value": "myProject" }, { "Key": "Environment", "Value": "Production" } ] }

See Also

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