Skip to content

Commit d8ee980

Browse files
author
awstools
committed
feat(client-lookoutmetrics): This release is to make GetDataQualityMetrics API publicly available.
1 parent 66a1950 commit d8ee980

File tree

7 files changed

+670
-6
lines changed

7 files changed

+670
-6
lines changed

clients/client-lookoutmetrics/src/LookoutMetrics.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ import {
6363
GetAnomalyGroupCommandInput,
6464
GetAnomalyGroupCommandOutput,
6565
} from "./commands/GetAnomalyGroupCommand";
66+
import {
67+
GetDataQualityMetricsCommand,
68+
GetDataQualityMetricsCommandInput,
69+
GetDataQualityMetricsCommandOutput,
70+
} from "./commands/GetDataQualityMetricsCommand";
6671
import { GetFeedbackCommand, GetFeedbackCommandInput, GetFeedbackCommandOutput } from "./commands/GetFeedbackCommand";
6772
import {
6873
GetSampleDataCommand,
@@ -569,6 +574,38 @@ export class LookoutMetrics extends LookoutMetricsClient {
569574
}
570575
}
571576

577+
/**
578+
* <p>Returns details about the requested data quality metrics.</p>
579+
*/
580+
public getDataQualityMetrics(
581+
args: GetDataQualityMetricsCommandInput,
582+
options?: __HttpHandlerOptions
583+
): Promise<GetDataQualityMetricsCommandOutput>;
584+
public getDataQualityMetrics(
585+
args: GetDataQualityMetricsCommandInput,
586+
cb: (err: any, data?: GetDataQualityMetricsCommandOutput) => void
587+
): void;
588+
public getDataQualityMetrics(
589+
args: GetDataQualityMetricsCommandInput,
590+
options: __HttpHandlerOptions,
591+
cb: (err: any, data?: GetDataQualityMetricsCommandOutput) => void
592+
): void;
593+
public getDataQualityMetrics(
594+
args: GetDataQualityMetricsCommandInput,
595+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetDataQualityMetricsCommandOutput) => void),
596+
cb?: (err: any, data?: GetDataQualityMetricsCommandOutput) => void
597+
): Promise<GetDataQualityMetricsCommandOutput> | void {
598+
const command = new GetDataQualityMetricsCommand(args);
599+
if (typeof optionsOrCb === "function") {
600+
this.send(command, optionsOrCb);
601+
} else if (typeof cb === "function") {
602+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
603+
this.send(command, optionsOrCb || {}, cb);
604+
} else {
605+
return this.send(command, optionsOrCb);
606+
}
607+
}
608+
572609
/**
573610
* <p>Get feedback for an anomaly group.</p>
574611
*/

clients/client-lookoutmetrics/src/LookoutMetricsClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ import {
9191
DetectMetricSetConfigCommandOutput,
9292
} from "./commands/DetectMetricSetConfigCommand";
9393
import { GetAnomalyGroupCommandInput, GetAnomalyGroupCommandOutput } from "./commands/GetAnomalyGroupCommand";
94+
import {
95+
GetDataQualityMetricsCommandInput,
96+
GetDataQualityMetricsCommandOutput,
97+
} from "./commands/GetDataQualityMetricsCommand";
9498
import { GetFeedbackCommandInput, GetFeedbackCommandOutput } from "./commands/GetFeedbackCommand";
9599
import { GetSampleDataCommandInput, GetSampleDataCommandOutput } from "./commands/GetSampleDataCommand";
96100
import { ListAlertsCommandInput, ListAlertsCommandOutput } from "./commands/ListAlertsCommand";
@@ -141,6 +145,7 @@ export type ServiceInputTypes =
141145
| DescribeMetricSetCommandInput
142146
| DetectMetricSetConfigCommandInput
143147
| GetAnomalyGroupCommandInput
148+
| GetDataQualityMetricsCommandInput
144149
| GetFeedbackCommandInput
145150
| GetSampleDataCommandInput
146151
| ListAlertsCommandInput
@@ -172,6 +177,7 @@ export type ServiceOutputTypes =
172177
| DescribeMetricSetCommandOutput
173178
| DetectMetricSetConfigCommandOutput
174179
| GetAnomalyGroupCommandOutput
180+
| GetDataQualityMetricsCommandOutput
175181
| GetFeedbackCommandOutput
176182
| GetSampleDataCommandOutput
177183
| ListAlertsCommandOutput
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { LookoutMetricsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LookoutMetricsClient";
16+
import {
17+
GetDataQualityMetricsRequest,
18+
GetDataQualityMetricsRequestFilterSensitiveLog,
19+
GetDataQualityMetricsResponse,
20+
GetDataQualityMetricsResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_restJson1GetDataQualityMetricsCommand,
24+
serializeAws_restJson1GetDataQualityMetricsCommand,
25+
} from "../protocols/Aws_restJson1";
26+
27+
export interface GetDataQualityMetricsCommandInput extends GetDataQualityMetricsRequest {}
28+
export interface GetDataQualityMetricsCommandOutput extends GetDataQualityMetricsResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns details about the requested data quality metrics.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { LookoutMetricsClient, GetDataQualityMetricsCommand } from "@aws-sdk/client-lookoutmetrics"; // ES Modules import
36+
* // const { LookoutMetricsClient, GetDataQualityMetricsCommand } = require("@aws-sdk/client-lookoutmetrics"); // CommonJS import
37+
* const client = new LookoutMetricsClient(config);
38+
* const command = new GetDataQualityMetricsCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link GetDataQualityMetricsCommandInput} for command's `input` shape.
43+
* @see {@link GetDataQualityMetricsCommandOutput} for command's `response` shape.
44+
* @see {@link LookoutMetricsClientResolvedConfig | config} for LookoutMetricsClient's `config` shape.
45+
*
46+
*/
47+
export class GetDataQualityMetricsCommand extends $Command<
48+
GetDataQualityMetricsCommandInput,
49+
GetDataQualityMetricsCommandOutput,
50+
LookoutMetricsClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: GetDataQualityMetricsCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: LookoutMetricsClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<GetDataQualityMetricsCommandInput, GetDataQualityMetricsCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "LookoutMetricsClient";
75+
const commandName = "GetDataQualityMetricsCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: GetDataQualityMetricsRequestFilterSensitiveLog,
81+
outputFilterSensitiveLog: GetDataQualityMetricsResponseFilterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(input: GetDataQualityMetricsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
92+
return serializeAws_restJson1GetDataQualityMetricsCommand(input, context);
93+
}
94+
95+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetDataQualityMetricsCommandOutput> {
96+
return deserializeAws_restJson1GetDataQualityMetricsCommand(output, context);
97+
}
98+
99+
// Start section: command_body_extra
100+
// End section: command_body_extra
101+
}

clients/client-lookoutmetrics/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export * from "./DescribeAnomalyDetectorCommand";
1313
export * from "./DescribeMetricSetCommand";
1414
export * from "./DetectMetricSetConfigCommand";
1515
export * from "./GetAnomalyGroupCommand";
16+
export * from "./GetDataQualityMetricsCommand";
1617
export * from "./GetFeedbackCommand";
1718
export * from "./GetSampleDataCommand";
1819
export * from "./ListAlertsCommand";

clients/client-lookoutmetrics/src/models/models_0.ts

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,74 @@ export interface AnomalyDetectorConfigSummary {
455455
AnomalyDetectorFrequency?: Frequency | string;
456456
}
457457

458+
export enum DataQualityMetricType {
459+
BACKTEST_INFERENCE_DATA_END_TIME_STAMP = "BACKTEST_INFERENCE_DATA_END_TIME_STAMP",
460+
BACKTEST_INFERENCE_DATA_START_TIME_STAMP = "BACKTEST_INFERENCE_DATA_START_TIME_STAMP",
461+
BACKTEST_TRAINING_DATA_END_TIME_STAMP = "BACKTEST_TRAINING_DATA_END_TIME_STAMP",
462+
BACKTEST_TRAINING_DATA_START_TIME_STAMP = "BACKTEST_TRAINING_DATA_START_TIME_STAMP",
463+
COLUMN_COMPLETENESS = "COLUMN_COMPLETENESS",
464+
DIMENSION_UNIQUENESS = "DIMENSION_UNIQUENESS",
465+
INVALID_ROWS_COMPLIANCE = "INVALID_ROWS_COMPLIANCE",
466+
ROWS_PARTIAL_COMPLIANCE = "ROWS_PARTIAL_COMPLIANCE",
467+
ROWS_PROCESSED = "ROWS_PROCESSED",
468+
TIME_SERIES_COUNT = "TIME_SERIES_COUNT",
469+
}
470+
471+
/**
472+
* <p>An array that describes a data quality metric. Each <code>DataQualityMetric</code> object contains the data quality metric name, its value, a description of the metric, and the affected column.</p>
473+
*/
474+
export interface DataQualityMetric {
475+
/**
476+
* <p>The name of the data quality metric.</p>
477+
*/
478+
MetricType?: DataQualityMetricType | string;
479+
480+
/**
481+
* <p>A description of the data quality metric.</p>
482+
*/
483+
MetricDescription?: string;
484+
485+
/**
486+
* <p>The column that is being monitored.</p>
487+
*/
488+
RelatedColumnName?: string;
489+
490+
/**
491+
* <p>The value of the data quality metric.</p>
492+
*/
493+
MetricValue?: number;
494+
}
495+
496+
/**
497+
* <p>An array of <code>DataQualityMetric</code> objects that describes one or more data quality metrics.</p>
498+
*/
499+
export interface MetricSetDataQualityMetric {
500+
/**
501+
* <p>The Amazon Resource Name (ARN) of the data quality metric array.</p>
502+
*/
503+
MetricSetArn?: string;
504+
505+
/**
506+
* <p>The array of data quality metrics contained in the data quality metric set.</p>
507+
*/
508+
DataQualityMetricList?: DataQualityMetric[];
509+
}
510+
511+
/**
512+
* <p>Aggregated details about the data quality metrics collected for the <code>AnomalyDetectorArn</code> provided in the <a>GetDataQualityMetrics</a> object.</p>
513+
*/
514+
export interface AnomalyDetectorDataQualityMetric {
515+
/**
516+
* <p>The start time for the data quality metrics collection.</p>
517+
*/
518+
StartTimestamp?: Date;
519+
520+
/**
521+
* <p>An array of <code>DataQualityMetricList</code> objects. Each object in the array contains information about a data quality metric.</p>
522+
*/
523+
MetricSetDataQualityMetricList?: MetricSetDataQualityMetric[];
524+
}
525+
458526
export enum AnomalyDetectorFailureType {
459527
ACTIVATION_FAILURE = "ACTIVATION_FAILURE",
460528
BACK_TEST_ACTIVATION_FAILURE = "BACK_TEST_ACTIVATION_FAILURE",
@@ -1285,7 +1353,7 @@ export interface CreateMetricSetRequest {
12851353
MetricList: Metric[] | undefined;
12861354

12871355
/**
1288-
* <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3 and Redshift datasources.</p>
1356+
* <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
12891357
*/
12901358
Offset?: number;
12911359

@@ -1520,7 +1588,7 @@ export interface DescribeMetricSetResponse {
15201588
LastModificationTime?: Date;
15211589

15221590
/**
1523-
* <p>The offset in seconds. Only supported for S3 and Redshift datasources.</p>
1591+
* <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
15241592
*/
15251593
Offset?: number;
15261594

@@ -1733,6 +1801,25 @@ export interface GetAnomalyGroupResponse {
17331801
AnomalyGroup?: AnomalyGroup;
17341802
}
17351803

1804+
export interface GetDataQualityMetricsRequest {
1805+
/**
1806+
* <p>The Amazon Resource Name (ARN) of the anomaly detector that you want to investigate.</p>
1807+
*/
1808+
AnomalyDetectorArn: string | undefined;
1809+
1810+
/**
1811+
* <p>The Amazon Resource Name (ARN) of a specific data quality metric set.</p>
1812+
*/
1813+
MetricSetArn?: string;
1814+
}
1815+
1816+
export interface GetDataQualityMetricsResponse {
1817+
/**
1818+
* <p>A list of the data quality metrics for the <code>AnomalyDetectorArn</code> that you requested.</p>
1819+
*/
1820+
AnomalyDetectorDataQualityMetricList?: AnomalyDetectorDataQualityMetric[];
1821+
}
1822+
17361823
export interface GetFeedbackRequest {
17371824
/**
17381825
* <p>The Amazon Resource Name (ARN) of the anomaly detector.</p>
@@ -2284,7 +2371,7 @@ export interface UpdateMetricSetRequest {
22842371
MetricList?: Metric[];
22852372

22862373
/**
2287-
* <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3 and Redshift datasources.</p>
2374+
* <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
22882375
*/
22892376
Offset?: number;
22902377

@@ -2400,6 +2487,27 @@ export const AnomalyDetectorConfigSummaryFilterSensitiveLog = (obj: AnomalyDetec
24002487
...obj,
24012488
});
24022489

2490+
/**
2491+
* @internal
2492+
*/
2493+
export const DataQualityMetricFilterSensitiveLog = (obj: DataQualityMetric): any => ({
2494+
...obj,
2495+
});
2496+
2497+
/**
2498+
* @internal
2499+
*/
2500+
export const MetricSetDataQualityMetricFilterSensitiveLog = (obj: MetricSetDataQualityMetric): any => ({
2501+
...obj,
2502+
});
2503+
2504+
/**
2505+
* @internal
2506+
*/
2507+
export const AnomalyDetectorDataQualityMetricFilterSensitiveLog = (obj: AnomalyDetectorDataQualityMetric): any => ({
2508+
...obj,
2509+
});
2510+
24032511
/**
24042512
* @internal
24052513
*/
@@ -2845,6 +2953,20 @@ export const GetAnomalyGroupResponseFilterSensitiveLog = (obj: GetAnomalyGroupRe
28452953
...obj,
28462954
});
28472955

2956+
/**
2957+
* @internal
2958+
*/
2959+
export const GetDataQualityMetricsRequestFilterSensitiveLog = (obj: GetDataQualityMetricsRequest): any => ({
2960+
...obj,
2961+
});
2962+
2963+
/**
2964+
* @internal
2965+
*/
2966+
export const GetDataQualityMetricsResponseFilterSensitiveLog = (obj: GetDataQualityMetricsResponse): any => ({
2967+
...obj,
2968+
});
2969+
28482970
/**
28492971
* @internal
28502972
*/

0 commit comments

Comments
 (0)