CreateDimension - AWS IoT

CreateDimension

Create a dimension that you can use to limit the scope of a metric used in a security profile for AWS IoT Device Defender. For example, using a TOPIC_FILTER dimension, you can narrow down the scope of the metric only to MQTT topics whose name match the pattern specified in the dimension.

Request Syntax

POST /dimensions/name HTTP/1.1 Content-type: application/json { "clientRequestToken": "string", "stringValues": [ "string" ], "tags": [ { "Key": "string", "Value": "string" } ], "type": "string" }

URI Request Parameters

The request uses the following URI parameters.

name

A unique identifier for the dimension. Choose something that describes the type and value to make it easy to remember what it does.

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

Pattern: [a-zA-Z0-9:_-]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

clientRequestToken

Each dimension must have a unique client request token. If you try to create a new dimension with the same token as a dimension that already exists, an exception occurs. If you omit this value, AWS SDKs will automatically generate a unique client request.

Type: String

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

Pattern: ^[a-zA-Z0-9-_]+$

Required: Yes

stringValues

Specifies the value or list of values for the dimension. For TOPIC_FILTER dimensions, this is a pattern used to match the MQTT topic (for example, "admin/#").

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 100 items.

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

Required: Yes

tags

Metadata that can be used to manage the dimension.

Type: Array of Tag objects

Required: No

type

Specifies the type of dimension. Supported types: TOPIC_FILTER.

Type: String

Valid Values: TOPIC_FILTER

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "arn": "string", "name": "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 (Amazon resource name) of the created dimension.

Type: String

name

A unique identifier for the dimension.

Type: String

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

Pattern: [a-zA-Z0-9:_-]+

Errors

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

LimitExceededException

A limit has been exceeded.

HTTP Status Code: 410

ResourceAlreadyExistsException

The resource already exists.

HTTP Status Code: 409

ThrottlingException

The rate exceeds the limit.

HTTP Status Code: 400

See Also

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