Skip to content

Commit 41aa257

Browse files
author
awstools
committed
feat(client-lookoutmetrics): Adding AthenaSourceConfig for MetricSet APIs to support Athena as a data source.
1 parent 7bd32c7 commit 41aa257

File tree

3 files changed

+260
-13
lines changed

3 files changed

+260
-13
lines changed

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

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export interface SNSConfiguration {
7070
SnsTopicArn: string | undefined;
7171

7272
/**
73-
* <p>The text format for alerts.</p>
73+
* <p>The format of the SNS topic.</p>
7474
*/
7575
SnsFormat?: SnsFormat | string;
7676
}
@@ -875,6 +875,74 @@ export namespace AppFlowConfig {
875875
});
876876
}
877877

878+
/**
879+
* <p>Settings for backtest mode.</p>
880+
*/
881+
export interface BackTestConfiguration {
882+
/**
883+
* <p>Run a backtest instead of monitoring new data.</p>
884+
*/
885+
RunBackTestMode: boolean | undefined;
886+
}
887+
888+
export namespace BackTestConfiguration {
889+
/**
890+
* @internal
891+
*/
892+
export const filterSensitiveLog = (obj: BackTestConfiguration): any => ({
893+
...obj,
894+
});
895+
}
896+
897+
/**
898+
* <p>Details about an Amazon Athena datasource.</p>
899+
*/
900+
export interface AthenaSourceConfig {
901+
/**
902+
* <p>An IAM role that gives Amazon Lookout for Metrics permission to access the data.</p>
903+
*/
904+
RoleArn?: string;
905+
906+
/**
907+
* <p>The database's name.</p>
908+
*/
909+
DatabaseName?: string;
910+
911+
/**
912+
* <p>The database's data catalog.</p>
913+
*/
914+
DataCatalog?: string;
915+
916+
/**
917+
* <p>The database's table name.</p>
918+
*/
919+
TableName?: string;
920+
921+
/**
922+
* <p>The database's work group name.</p>
923+
*/
924+
WorkGroupName?: string;
925+
926+
/**
927+
* <p>The database's results path.</p>
928+
*/
929+
S3ResultsPath?: string;
930+
931+
/**
932+
* <p>Settings for backtest mode.</p>
933+
*/
934+
BackTestConfiguration?: BackTestConfiguration;
935+
}
936+
937+
export namespace AthenaSourceConfig {
938+
/**
939+
* @internal
940+
*/
941+
export const filterSensitiveLog = (obj: AthenaSourceConfig): any => ({
942+
...obj,
943+
});
944+
}
945+
878946
/**
879947
* <p>An attribute value.</p>
880948
*/
@@ -1465,7 +1533,7 @@ export namespace S3SourceConfig {
14651533
}
14661534

14671535
/**
1468-
* <p>Contains information about source data used to generate a metric.</p>
1536+
* <p>Contains information about source data used to generate metrics.</p>
14691537
*/
14701538
export interface MetricSource {
14711539
/**
@@ -1474,24 +1542,29 @@ export interface MetricSource {
14741542
S3SourceConfig?: S3SourceConfig;
14751543

14761544
/**
1477-
* <p>An object containing information about the AppFlow configuration.</p>
1545+
* <p>Details about an AppFlow datasource.</p>
14781546
*/
14791547
AppFlowConfig?: AppFlowConfig;
14801548

14811549
/**
1482-
* <p>An object containing information about the Amazon CloudWatch monitoring configuration.</p>
1550+
* <p>Details about an Amazon CloudWatch monitoring datasource.</p>
14831551
*/
14841552
CloudWatchConfig?: CloudWatchConfig;
14851553

14861554
/**
1487-
* <p>An object containing information about the Amazon Relational Database Service (RDS) configuration.</p>
1555+
* <p>Details about an Amazon Relational Database Service (RDS) datasource.</p>
14881556
*/
14891557
RDSSourceConfig?: RDSSourceConfig;
14901558

14911559
/**
1492-
* <p>An object containing information about the Amazon Redshift database configuration.</p>
1560+
* <p>Details about an Amazon Redshift database datasource.</p>
14931561
*/
14941562
RedshiftSourceConfig?: RedshiftSourceConfig;
1563+
1564+
/**
1565+
* <p>Details about an Amazon Athena datasource.</p>
1566+
*/
1567+
AthenaSourceConfig?: AthenaSourceConfig;
14951568
}
14961569

14971570
export namespace MetricSource {
@@ -3074,7 +3147,7 @@ export interface UpdateMetricSetRequest {
30743147
MetricSetFrequency?: Frequency | string;
30753148

30763149
/**
3077-
* <p>Contains information about source data used to generate a metric.</p>
3150+
* <p>Contains information about source data used to generate metrics.</p>
30783151
*/
30793152
MetricSource?: MetricSource;
30803153
}

clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ import {
103103
AnomalyGroupTimeSeries,
104104
AnomalyGroupTimeSeriesFeedback,
105105
AppFlowConfig,
106+
AthenaSourceConfig,
106107
AttributeValue,
107108
AutoDetectionMetricSource,
108109
AutoDetectionS3SourceConfig,
110+
BackTestConfiguration,
109111
CloudWatchConfig,
110112
ConflictException,
111113
ContributionMatrix,
@@ -2866,6 +2868,21 @@ const serializeAws_restJson1AppFlowConfig = (input: AppFlowConfig, context: __Se
28662868
};
28672869
};
28682870

2871+
const serializeAws_restJson1AthenaSourceConfig = (input: AthenaSourceConfig, context: __SerdeContext): any => {
2872+
return {
2873+
...(input.BackTestConfiguration !== undefined &&
2874+
input.BackTestConfiguration !== null && {
2875+
BackTestConfiguration: serializeAws_restJson1BackTestConfiguration(input.BackTestConfiguration, context),
2876+
}),
2877+
...(input.DataCatalog !== undefined && input.DataCatalog !== null && { DataCatalog: input.DataCatalog }),
2878+
...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }),
2879+
...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
2880+
...(input.S3ResultsPath !== undefined && input.S3ResultsPath !== null && { S3ResultsPath: input.S3ResultsPath }),
2881+
...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }),
2882+
...(input.WorkGroupName !== undefined && input.WorkGroupName !== null && { WorkGroupName: input.WorkGroupName }),
2883+
};
2884+
};
2885+
28692886
const serializeAws_restJson1AutoDetectionMetricSource = (
28702887
input: AutoDetectionMetricSource,
28712888
context: __SerdeContext
@@ -2894,6 +2911,13 @@ const serializeAws_restJson1AutoDetectionS3SourceConfig = (
28942911
};
28952912
};
28962913

2914+
const serializeAws_restJson1BackTestConfiguration = (input: BackTestConfiguration, context: __SerdeContext): any => {
2915+
return {
2916+
...(input.RunBackTestMode !== undefined &&
2917+
input.RunBackTestMode !== null && { RunBackTestMode: input.RunBackTestMode }),
2918+
};
2919+
};
2920+
28972921
const serializeAws_restJson1CloudWatchConfig = (input: CloudWatchConfig, context: __SerdeContext): any => {
28982922
return {
28992923
...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
@@ -3001,6 +3025,10 @@ const serializeAws_restJson1MetricSource = (input: MetricSource, context: __Serd
30013025
input.AppFlowConfig !== null && {
30023026
AppFlowConfig: serializeAws_restJson1AppFlowConfig(input.AppFlowConfig, context),
30033027
}),
3028+
...(input.AthenaSourceConfig !== undefined &&
3029+
input.AthenaSourceConfig !== null && {
3030+
AthenaSourceConfig: serializeAws_restJson1AthenaSourceConfig(input.AthenaSourceConfig, context),
3031+
}),
30043032
...(input.CloudWatchConfig !== undefined &&
30053033
input.CloudWatchConfig !== null && {
30063034
CloudWatchConfig: serializeAws_restJson1CloudWatchConfig(input.CloudWatchConfig, context),
@@ -3346,6 +3374,21 @@ const deserializeAws_restJson1AppFlowConfig = (output: any, context: __SerdeCont
33463374
} as any;
33473375
};
33483376

3377+
const deserializeAws_restJson1AthenaSourceConfig = (output: any, context: __SerdeContext): AthenaSourceConfig => {
3378+
return {
3379+
BackTestConfiguration:
3380+
output.BackTestConfiguration !== undefined && output.BackTestConfiguration !== null
3381+
? deserializeAws_restJson1BackTestConfiguration(output.BackTestConfiguration, context)
3382+
: undefined,
3383+
DataCatalog: __expectString(output.DataCatalog),
3384+
DatabaseName: __expectString(output.DatabaseName),
3385+
RoleArn: __expectString(output.RoleArn),
3386+
S3ResultsPath: __expectString(output.S3ResultsPath),
3387+
TableName: __expectString(output.TableName),
3388+
WorkGroupName: __expectString(output.WorkGroupName),
3389+
} as any;
3390+
};
3391+
33493392
const deserializeAws_restJson1AttributeValue = (output: any, context: __SerdeContext): AttributeValue => {
33503393
return {
33513394
B: __expectString(output.B),
@@ -3366,6 +3409,12 @@ const deserializeAws_restJson1AttributeValue = (output: any, context: __SerdeCon
33663409
} as any;
33673410
};
33683411

3412+
const deserializeAws_restJson1BackTestConfiguration = (output: any, context: __SerdeContext): BackTestConfiguration => {
3413+
return {
3414+
RunBackTestMode: __expectBoolean(output.RunBackTestMode),
3415+
} as any;
3416+
};
3417+
33693418
const deserializeAws_restJson1BinaryListAttributeValue = (output: any, context: __SerdeContext): string[] => {
33703419
const retVal = (output || [])
33713420
.filter((e: any) => e != null)
@@ -3818,6 +3867,10 @@ const deserializeAws_restJson1MetricSource = (output: any, context: __SerdeConte
38183867
output.AppFlowConfig !== undefined && output.AppFlowConfig !== null
38193868
? deserializeAws_restJson1AppFlowConfig(output.AppFlowConfig, context)
38203869
: undefined,
3870+
AthenaSourceConfig:
3871+
output.AthenaSourceConfig !== undefined && output.AthenaSourceConfig !== null
3872+
? deserializeAws_restJson1AthenaSourceConfig(output.AthenaSourceConfig, context)
3873+
: undefined,
38213874
CloudWatchConfig:
38223875
output.CloudWatchConfig !== undefined && output.CloudWatchConfig !== null
38233876
? deserializeAws_restJson1CloudWatchConfig(output.CloudWatchConfig, context)

0 commit comments

Comments
 (0)