CreateMetricSet - Amazon Lookout for Metrics

CreateMetricSet

Creates a dataset.

Request Syntax

POST /CreateMetricSet HTTP/1.1 Content-type: application/json { "AnomalyDetectorArn": "string", "DimensionList": [ "string" ], "MetricList": [ { "AggregationFunction": "string", "MetricName": "string", "Namespace": "string" } ], "MetricSetDescription": "string", "MetricSetFrequency": "string", "MetricSetName": "string", "MetricSource": { "AppFlowConfig": { "FlowName": "string", "RoleArn": "string" }, "CloudWatchConfig": { "RoleArn": "string" }, "RDSSourceConfig": { "DatabaseHost": "string", "DatabaseName": "string", "DatabasePort": number, "DBInstanceIdentifier": "string", "RoleArn": "string", "SecretManagerArn": "string", "TableName": "string", "VpcConfiguration": { "SecurityGroupIdList": [ "string" ], "SubnetIdList": [ "string" ] } }, "RedshiftSourceConfig": { "ClusterIdentifier": "string", "DatabaseHost": "string", "DatabaseName": "string", "DatabasePort": number, "RoleArn": "string", "SecretManagerArn": "string", "TableName": "string", "VpcConfiguration": { "SecurityGroupIdList": [ "string" ], "SubnetIdList": [ "string" ] } }, "S3SourceConfig": { "FileFormatDescriptor": { "CsvFormatDescriptor": { "Charset": "string", "ContainsHeader": boolean, "Delimiter": "string", "FileCompression": "string", "HeaderList": [ "string" ], "QuoteSymbol": "string" }, "JsonFormatDescriptor": { "Charset": "string", "FileCompression": "string" } }, "HistoricalDataPathList": [ "string" ], "RoleArn": "string", "TemplatedPathList": [ "string" ] } }, "Offset": number, "Tags": { "string" : "string" }, "TimestampColumn": { "ColumnFormat": "string", "ColumnName": "string" }, "Timezone": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

AnomalyDetectorArn

The ARN of the anomaly detector that will use the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:([a-z\d-]+):.*:.*:.*:.+

Required: Yes

DimensionList

A list of the fields you want to treat as dimensions.

Type: Array of strings

Array Members: Minimum number of 1 item.

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

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*

Required: No

MetricList

A list of metrics that the dataset will contain.

Type: Array of Metric objects

Array Members: Minimum number of 1 item.

Required: Yes

MetricSetDescription

A description of the dataset you are creating.

Type: String

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

Pattern: .*\S.*

Required: No

MetricSetFrequency

The frequency with which the source data will be analyzed for anomalies.

Type: String

Valid Values: P1D | PT1H | PT10M | PT5M

Required: No

MetricSetName

The name of the dataset.

Type: String

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

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*

Required: Yes

MetricSource

Contains information about how the source data should be interpreted.

Type: MetricSource object

Required: Yes

Offset

After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3 and Redshift datasources.

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 432000.

Required: No

Tags

A list of tags to apply to the dataset.

Type: String to string map

Map Entries: Maximum number of 50 items.

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

Value Length Constraints: Maximum length of 256.

Required: No

TimestampColumn

Contains information about the column used for tracking time in your source data.

Type: TimestampColumn object

Required: No

Timezone

The time zone in which your source data was recorded.

Type: String

Length Constraints: Maximum length of 60.

Pattern: .*\S.*

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "MetricSetArn": "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.

MetricSetArn

The ARN of the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:([a-z\d-]+):.*:.*:.*:.+

Errors

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

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

ConflictException

There was a conflict processing the request. Try your request again.

HTTP Status Code: 409

InternalServerException

The request processing has failed because of an unknown error, exception, or failure.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource cannot be found. Check the ARN of the resource and try again.

HTTP Status Code: 400

ServiceQuotaExceededException

The request exceeded the service's quotas. Check the service quotas and try again.

HTTP Status Code: 402

TooManyRequestsException

The request was denied due to too many requests being submitted at the same time.

HTTP Status Code: 429

ValidationException

The input fails to satisfy the constraints specified by the AWS service. Check your input values and try again.

HTTP Status Code: 400

See Also

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