From 5b6c0db870e79fd1b282b79d5b6a7e3510d9a320 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 20 Sep 2024 18:17:07 +0000 Subject: [PATCH] feat(client-sagemaker-metrics): This release introduces support for the SageMaker Metrics BatchGetMetrics API. --- clients/client-sagemaker-metrics/README.md | 22 +- .../src/SageMakerMetrics.ts | 20 ++ .../src/SageMakerMetricsClient.ts | 5 +- .../src/commands/BatchGetMetricsCommand.ts | 113 ++++++ .../src/commands/BatchPutMetricsCommand.ts | 3 +- .../src/commands/index.ts | 1 + .../src/models/models_0.ts | 166 ++++++++- .../src/protocols/Aws_restJson1.ts | 90 ++++- .../aws-models/sagemaker-metrics.json | 329 +++++++++++++++++- 9 files changed, 733 insertions(+), 16 deletions(-) create mode 100644 clients/client-sagemaker-metrics/src/commands/BatchGetMetricsCommand.ts diff --git a/clients/client-sagemaker-metrics/README.md b/clients/client-sagemaker-metrics/README.md index b5d7ebb1ce20..a9568a1d6480 100644 --- a/clients/client-sagemaker-metrics/README.md +++ b/clients/client-sagemaker-metrics/README.md @@ -31,16 +31,16 @@ using your favorite package manager: The AWS SDK is modulized by clients and commands. To send a request, you only need to import the `SageMakerMetricsClient` and -the commands you need, for example `BatchPutMetricsCommand`: +the commands you need, for example `BatchGetMetricsCommand`: ```js // ES5 example -const { SageMakerMetricsClient, BatchPutMetricsCommand } = require("@aws-sdk/client-sagemaker-metrics"); +const { SageMakerMetricsClient, BatchGetMetricsCommand } = require("@aws-sdk/client-sagemaker-metrics"); ``` ```ts // ES6+ example -import { SageMakerMetricsClient, BatchPutMetricsCommand } from "@aws-sdk/client-sagemaker-metrics"; +import { SageMakerMetricsClient, BatchGetMetricsCommand } from "@aws-sdk/client-sagemaker-metrics"; ``` ### Usage @@ -59,7 +59,7 @@ const client = new SageMakerMetricsClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new BatchPutMetricsCommand(params); +const command = new BatchGetMetricsCommand(params); ``` #### Async/await @@ -138,7 +138,7 @@ const client = new AWS.SageMakerMetrics({ region: "REGION" }); // async/await. try { - const data = await client.batchPutMetrics(params); + const data = await client.batchGetMetrics(params); // process data. } catch (error) { // error handling. @@ -146,7 +146,7 @@ try { // Promises. client - .batchPutMetrics(params) + .batchGetMetrics(params) .then((data) => { // process data. }) @@ -155,7 +155,7 @@ client }); // callbacks. -client.batchPutMetrics(params, (err, data) => { +client.batchGetMetrics(params, (err, data) => { // process err and data. }); ``` @@ -211,6 +211,14 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +BatchGetMetrics + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker-metrics/command/BatchGetMetricsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker-metrics/Interface/BatchGetMetricsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker-metrics/Interface/BatchGetMetricsCommandOutput/) + +
BatchPutMetrics diff --git a/clients/client-sagemaker-metrics/src/SageMakerMetrics.ts b/clients/client-sagemaker-metrics/src/SageMakerMetrics.ts index 5f092f21c7ed..e27cc188a275 100644 --- a/clients/client-sagemaker-metrics/src/SageMakerMetrics.ts +++ b/clients/client-sagemaker-metrics/src/SageMakerMetrics.ts @@ -2,6 +2,11 @@ import { createAggregatedClient } from "@smithy/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; +import { + BatchGetMetricsCommand, + BatchGetMetricsCommandInput, + BatchGetMetricsCommandOutput, +} from "./commands/BatchGetMetricsCommand"; import { BatchPutMetricsCommand, BatchPutMetricsCommandInput, @@ -10,10 +15,25 @@ import { import { SageMakerMetricsClient, SageMakerMetricsClientConfig } from "./SageMakerMetricsClient"; const commands = { + BatchGetMetricsCommand, BatchPutMetricsCommand, }; export interface SageMakerMetrics { + /** + * @see {@link BatchGetMetricsCommand} + */ + batchGetMetrics( + args: BatchGetMetricsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + batchGetMetrics(args: BatchGetMetricsCommandInput, cb: (err: any, data?: BatchGetMetricsCommandOutput) => void): void; + batchGetMetrics( + args: BatchGetMetricsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchGetMetricsCommandOutput) => void + ): void; + /** * @see {@link BatchPutMetricsCommand} */ diff --git a/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts b/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts index 787aa52ed44a..c08bfec16107 100644 --- a/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts +++ b/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts @@ -53,6 +53,7 @@ import { HttpAuthSchemeResolvedConfig, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider"; +import { BatchGetMetricsCommandInput, BatchGetMetricsCommandOutput } from "./commands/BatchGetMetricsCommand"; import { BatchPutMetricsCommandInput, BatchPutMetricsCommandOutput } from "./commands/BatchPutMetricsCommand"; import { ClientInputEndpointParameters, @@ -68,12 +69,12 @@ export { __Client }; /** * @public */ -export type ServiceInputTypes = BatchPutMetricsCommandInput; +export type ServiceInputTypes = BatchGetMetricsCommandInput | BatchPutMetricsCommandInput; /** * @public */ -export type ServiceOutputTypes = BatchPutMetricsCommandOutput; +export type ServiceOutputTypes = BatchGetMetricsCommandOutput | BatchPutMetricsCommandOutput; /** * @public diff --git a/clients/client-sagemaker-metrics/src/commands/BatchGetMetricsCommand.ts b/clients/client-sagemaker-metrics/src/commands/BatchGetMetricsCommand.ts new file mode 100644 index 000000000000..cd1516a2b4bd --- /dev/null +++ b/clients/client-sagemaker-metrics/src/commands/BatchGetMetricsCommand.ts @@ -0,0 +1,113 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { BatchGetMetricsRequest, BatchGetMetricsResponse } from "../models/models_0"; +import { de_BatchGetMetricsCommand, se_BatchGetMetricsCommand } from "../protocols/Aws_restJson1"; +import { SageMakerMetricsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerMetricsClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link BatchGetMetricsCommand}. + */ +export interface BatchGetMetricsCommandInput extends BatchGetMetricsRequest {} +/** + * @public + * + * The output of {@link BatchGetMetricsCommand}. + */ +export interface BatchGetMetricsCommandOutput extends BatchGetMetricsResponse, __MetadataBearer {} + +/** + *

Used to retrieve training metrics from SageMaker.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SageMakerMetricsClient, BatchGetMetricsCommand } from "@aws-sdk/client-sagemaker-metrics"; // ES Modules import + * // const { SageMakerMetricsClient, BatchGetMetricsCommand } = require("@aws-sdk/client-sagemaker-metrics"); // CommonJS import + * const client = new SageMakerMetricsClient(config); + * const input = { // BatchGetMetricsRequest + * MetricQueries: [ // MetricQueryList // required + * { // MetricQuery + * MetricName: "STRING_VALUE", // required + * ResourceArn: "STRING_VALUE", // required + * MetricStat: "Min" || "Max" || "Avg" || "Count" || "StdDev" || "Last", // required + * Period: "OneMinute" || "FiveMinute" || "OneHour" || "IterationNumber", // required + * XAxisType: "IterationNumber" || "Timestamp", // required + * Start: Number("long"), + * End: Number("long"), + * }, + * ], + * }; + * const command = new BatchGetMetricsCommand(input); + * const response = await client.send(command); + * // { // BatchGetMetricsResponse + * // MetricQueryResults: [ // MetricQueryResultList + * // { // MetricQueryResult + * // Status: "Complete" || "Truncated" || "InternalError" || "ValidationError", // required + * // Message: "STRING_VALUE", + * // XAxisValues: [ // XAxisValues // required + * // Number("long"), + * // ], + * // MetricValues: [ // MetricValues // required + * // Number("double"), + * // ], + * // }, + * // ], + * // }; + * + * ``` + * + * @param BatchGetMetricsCommandInput - {@link BatchGetMetricsCommandInput} + * @returns {@link BatchGetMetricsCommandOutput} + * @see {@link BatchGetMetricsCommandInput} for command's `input` shape. + * @see {@link BatchGetMetricsCommandOutput} for command's `response` shape. + * @see {@link SageMakerMetricsClientResolvedConfig | config} for SageMakerMetricsClient's `config` shape. + * + * @throws {@link SageMakerMetricsServiceException} + *

Base exception class for all service exceptions from SageMakerMetrics service.

+ * + * @public + */ +export class BatchGetMetricsCommand extends $Command + .classBuilder< + BatchGetMetricsCommandInput, + BatchGetMetricsCommandOutput, + SageMakerMetricsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SageMakerMetricsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SageMakerMetricsService", "BatchGetMetrics", {}) + .n("SageMakerMetricsClient", "BatchGetMetricsCommand") + .f(void 0, void 0) + .ser(se_BatchGetMetricsCommand) + .de(de_BatchGetMetricsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: BatchGetMetricsRequest; + output: BatchGetMetricsResponse; + }; + sdk: { + input: BatchGetMetricsCommandInput; + output: BatchGetMetricsCommandOutput; + }; + }; +} diff --git a/clients/client-sagemaker-metrics/src/commands/BatchPutMetricsCommand.ts b/clients/client-sagemaker-metrics/src/commands/BatchPutMetricsCommand.ts index ec89c3d9901e..73b359fb8008 100644 --- a/clients/client-sagemaker-metrics/src/commands/BatchPutMetricsCommand.ts +++ b/clients/client-sagemaker-metrics/src/commands/BatchPutMetricsCommand.ts @@ -28,8 +28,7 @@ export interface BatchPutMetricsCommandInput extends BatchPutMetricsRequest {} export interface BatchPutMetricsCommandOutput extends BatchPutMetricsResponse, __MetadataBearer {} /** - *

Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio and - * retrieved with the GetMetrics API. + *

Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio. *

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-sagemaker-metrics/src/commands/index.ts b/clients/client-sagemaker-metrics/src/commands/index.ts index 593de5f9f754..b9d5c0499779 100644 --- a/clients/client-sagemaker-metrics/src/commands/index.ts +++ b/clients/client-sagemaker-metrics/src/commands/index.ts @@ -1,2 +1,3 @@ // smithy-typescript generated code +export * from "./BatchGetMetricsCommand"; export * from "./BatchPutMetricsCommand"; diff --git a/clients/client-sagemaker-metrics/src/models/models_0.ts b/clients/client-sagemaker-metrics/src/models/models_0.ts index d868d93ae86a..c3127acc5a10 100644 --- a/clients/client-sagemaker-metrics/src/models/models_0.ts +++ b/clients/client-sagemaker-metrics/src/models/models_0.ts @@ -1,4 +1,168 @@ // smithy-typescript generated code +/** + * @public + * @enum + */ +export const MetricStatistic = { + AVG: "Avg", + COUNT: "Count", + LAST: "Last", + MAX: "Max", + MIN: "Min", + STD_DEV: "StdDev", +} as const; + +/** + * @public + */ +export type MetricStatistic = (typeof MetricStatistic)[keyof typeof MetricStatistic]; + +/** + * @public + * @enum + */ +export const Period = { + FIVE_MINUTE: "FiveMinute", + ITERATION_NUMBER: "IterationNumber", + ONE_HOUR: "OneHour", + ONE_MINUTE: "OneMinute", +} as const; + +/** + * @public + */ +export type Period = (typeof Period)[keyof typeof Period]; + +/** + * @public + * @enum + */ +export const XAxisType = { + ITERATION_NUMBER: "IterationNumber", + TIMESTAMP: "Timestamp", +} as const; + +/** + * @public + */ +export type XAxisType = (typeof XAxisType)[keyof typeof XAxisType]; + +/** + *

Specifies a query to retrieve training metrics from SageMaker.

+ * @public + */ +export interface MetricQuery { + /** + *

The name of the metric to retrieve.

+ * @public + */ + MetricName: string | undefined; + + /** + *

The ARN of the SageMaker resource to retrieve metrics for.

+ * @public + */ + ResourceArn: string | undefined; + + /** + *

The metrics stat type of metrics to retrieve.

+ * @public + */ + MetricStat: MetricStatistic | undefined; + + /** + *

The time period of metrics to retrieve.

+ * @public + */ + Period: Period | undefined; + + /** + *

The x-axis type of metrics to retrieve.

+ * @public + */ + XAxisType: XAxisType | undefined; + + /** + *

The start time of metrics to retrieve.

+ * @public + */ + Start?: number; + + /** + *

The end time of metrics to retrieve.

+ * @public + */ + End?: number; +} + +/** + * @public + */ +export interface BatchGetMetricsRequest { + /** + *

Queries made to retrieve training metrics from SageMaker.

+ * @public + */ + MetricQueries: MetricQuery[] | undefined; +} + +/** + * @public + * @enum + */ +export const MetricQueryResultStatus = { + COMPLETE: "Complete", + INTERNAL_ERROR: "InternalError", + TRUNCATED: "Truncated", + VALIDATION_ERROR: "ValidationError", +} as const; + +/** + * @public + */ +export type MetricQueryResultStatus = (typeof MetricQueryResultStatus)[keyof typeof MetricQueryResultStatus]; + +/** + *

The result of a query to retrieve training metrics from SageMaker.

+ * @public + */ +export interface MetricQueryResult { + /** + *

The status of the metric query.

+ * @public + */ + Status: MetricQueryResultStatus | undefined; + + /** + *

A message describing the status of the metric query.

+ * @public + */ + Message?: string; + + /** + *

The values for the x-axis of the metrics.

+ * @public + */ + XAxisValues: number[] | undefined; + + /** + *

The metric values retrieved by the query.

+ * @public + */ + MetricValues: number[] | undefined; +} + +/** + * @public + */ +export interface BatchGetMetricsResponse { + /** + *

The results of a query to retrieve training metrics from SageMaker.

+ * @public + */ + MetricQueryResults?: MetricQueryResult[]; +} + /** *

The raw metric data to associate with the resource.

* @public @@ -35,7 +199,7 @@ export interface RawMetricData { */ export interface BatchPutMetricsRequest { /** - *

The name of the Trial Component to associate with the metrics.

+ *

The name of the Trial Component to associate with the metrics. The Trial Component name must be entirely lowercase.

* @public */ TrialComponentName: string | undefined; diff --git a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts index 236aa51fb816..947bfb507a16 100644 --- a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts @@ -7,6 +7,8 @@ import { collectBody, expectNonNull as __expectNonNull, expectObject as __expectObject, + expectString as __expectString, + limitedParseDouble as __limitedParseDouble, map, serializeFloat as __serializeFloat, take, @@ -18,10 +20,33 @@ import { SerdeContext as __SerdeContext, } from "@smithy/types"; +import { BatchGetMetricsCommandInput, BatchGetMetricsCommandOutput } from "../commands/BatchGetMetricsCommand"; import { BatchPutMetricsCommandInput, BatchPutMetricsCommandOutput } from "../commands/BatchPutMetricsCommand"; -import { RawMetricData } from "../models/models_0"; +import { MetricQuery, MetricQueryResult, RawMetricData } from "../models/models_0"; import { SageMakerMetricsServiceException as __BaseException } from "../models/SageMakerMetricsServiceException"; +/** + * serializeAws_restJson1BatchGetMetricsCommand + */ +export const se_BatchGetMetricsCommand = async ( + input: BatchGetMetricsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/BatchGetMetrics"); + let body: any; + body = JSON.stringify( + take(input, { + MetricQueries: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1BatchPutMetricsCommand */ @@ -45,6 +70,27 @@ export const se_BatchPutMetricsCommand = async ( return b.build(); }; +/** + * deserializeAws_restJson1BatchGetMetricsCommand + */ +export const de_BatchGetMetricsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MetricQueryResults: (_) => de_MetricQueryResultList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1BatchPutMetricsCommand */ @@ -84,6 +130,10 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): }; const throwDefaultError = withBaseException(__BaseException); +// se_MetricQuery omitted. + +// se_MetricQueryList omitted. + /** * serializeAws_restJson1RawMetricData */ @@ -111,6 +161,44 @@ const se_RawMetricDataList = (input: RawMetricData[], context: __SerdeContext): // de_BatchPutMetricsErrorList omitted. +/** + * deserializeAws_restJson1MetricQueryResult + */ +const de_MetricQueryResult = (output: any, context: __SerdeContext): MetricQueryResult => { + return take(output, { + Message: __expectString, + MetricValues: (_: any) => de_MetricValues(_, context), + Status: __expectString, + XAxisValues: _json, + }) as any; +}; + +/** + * deserializeAws_restJson1MetricQueryResultList + */ +const de_MetricQueryResultList = (output: any, context: __SerdeContext): MetricQueryResult[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_MetricQueryResult(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1MetricValues + */ +const de_MetricValues = (output: any, context: __SerdeContext): number[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __limitedParseDouble(entry) as any; + }); + return retVal; +}; + +// de_XAxisValues omitted. + const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ httpStatusCode: output.statusCode, requestId: diff --git a/codegen/sdk-codegen/aws-models/sagemaker-metrics.json b/codegen/sdk-codegen/aws-models/sagemaker-metrics.json index ebf762bdb3a3..e9d562d3c552 100644 --- a/codegen/sdk-codegen/aws-models/sagemaker-metrics.json +++ b/codegen/sdk-codegen/aws-models/sagemaker-metrics.json @@ -29,6 +29,53 @@ ] }, "shapes": { + "com.amazonaws.sagemakermetrics#BatchGetMetrics": { + "type": "operation", + "input": { + "target": "com.amazonaws.sagemakermetrics#BatchGetMetricsRequest" + }, + "output": { + "target": "com.amazonaws.sagemakermetrics#BatchGetMetricsResponse" + }, + "traits": { + "smithy.api#documentation": "

Used to retrieve training metrics from SageMaker.

", + "smithy.api#http": { + "method": "POST", + "uri": "/BatchGetMetrics", + "code": 200 + } + } + }, + "com.amazonaws.sagemakermetrics#BatchGetMetricsRequest": { + "type": "structure", + "members": { + "MetricQueries": { + "target": "com.amazonaws.sagemakermetrics#MetricQueryList", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

Queries made to retrieve training metrics from SageMaker.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.sagemakermetrics#BatchGetMetricsResponse": { + "type": "structure", + "members": { + "MetricQueryResults": { + "target": "com.amazonaws.sagemakermetrics#MetricQueryResultList", + "traits": { + "smithy.api#documentation": "

The results of a query to retrieve training metrics from SageMaker.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.sagemakermetrics#BatchPutMetrics": { "type": "operation", "input": { @@ -38,7 +85,7 @@ "target": "com.amazonaws.sagemakermetrics#BatchPutMetricsResponse" }, "traits": { - "smithy.api#documentation": "

Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio and\n retrieved with the GetMetrics API.\n

", + "smithy.api#documentation": "

Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio.\n

", "smithy.api#http": { "method": "PUT", "uri": "/BatchPutMetrics", @@ -85,7 +132,7 @@ "target": "com.amazonaws.sagemakermetrics#ExperimentEntityName", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The name of the Trial Component to associate with the metrics.

", + "smithy.api#documentation": "

The name of the Trial Component to associate with the metrics. The Trial Component name must be entirely lowercase.

", "smithy.api#required": {} } }, @@ -126,12 +173,25 @@ "min": 1, "max": 120 }, - "smithy.api#pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,119}$" + "smithy.api#pattern": "^[a-z0-9](-*[a-z0-9]){0,119}$" } }, "com.amazonaws.sagemakermetrics#Integer": { "type": "integer" }, + "com.amazonaws.sagemakermetrics#Long": { + "type": "long" + }, + "com.amazonaws.sagemakermetrics#Message": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2048 + }, + "smithy.api#pattern": ".*" + } + }, "com.amazonaws.sagemakermetrics#MetricName": { "type": "string", "traits": { @@ -142,6 +202,233 @@ "smithy.api#pattern": "^.+$" } }, + "com.amazonaws.sagemakermetrics#MetricQuery": { + "type": "structure", + "members": { + "MetricName": { + "target": "com.amazonaws.sagemakermetrics#MetricName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name of the metric to retrieve.

", + "smithy.api#required": {} + } + }, + "ResourceArn": { + "target": "com.amazonaws.sagemakermetrics#SageMakerResourceArn", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The ARN of the SageMaker resource to retrieve metrics for.

", + "smithy.api#required": {} + } + }, + "MetricStat": { + "target": "com.amazonaws.sagemakermetrics#MetricStatistic", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The metrics stat type of metrics to retrieve.

", + "smithy.api#required": {} + } + }, + "Period": { + "target": "com.amazonaws.sagemakermetrics#Period", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The time period of metrics to retrieve.

", + "smithy.api#required": {} + } + }, + "XAxisType": { + "target": "com.amazonaws.sagemakermetrics#XAxisType", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The x-axis type of metrics to retrieve.

", + "smithy.api#required": {} + } + }, + "Start": { + "target": "com.amazonaws.sagemakermetrics#Long", + "traits": { + "smithy.api#documentation": "

The start time of metrics to retrieve.

" + } + }, + "End": { + "target": "com.amazonaws.sagemakermetrics#Long", + "traits": { + "smithy.api#documentation": "

The end time of metrics to retrieve.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Specifies a query to retrieve training metrics from SageMaker.

" + } + }, + "com.amazonaws.sagemakermetrics#MetricQueryList": { + "type": "list", + "member": { + "target": "com.amazonaws.sagemakermetrics#MetricQuery" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.sagemakermetrics#MetricQueryResult": { + "type": "structure", + "members": { + "Status": { + "target": "com.amazonaws.sagemakermetrics#MetricQueryResultStatus", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The status of the metric query.

", + "smithy.api#required": {} + } + }, + "Message": { + "target": "com.amazonaws.sagemakermetrics#Message", + "traits": { + "smithy.api#documentation": "

A message describing the status of the metric query.

" + } + }, + "XAxisValues": { + "target": "com.amazonaws.sagemakermetrics#XAxisValues", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The values for the x-axis of the metrics.

", + "smithy.api#required": {} + } + }, + "MetricValues": { + "target": "com.amazonaws.sagemakermetrics#MetricValues", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The metric values retrieved by the query.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The result of a query to retrieve training metrics from SageMaker.

" + } + }, + "com.amazonaws.sagemakermetrics#MetricQueryResultList": { + "type": "list", + "member": { + "target": "com.amazonaws.sagemakermetrics#MetricQueryResult" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.sagemakermetrics#MetricQueryResultStatus": { + "type": "enum", + "members": { + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Complete" + } + }, + "TRUNCATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Truncated" + } + }, + "INTERNAL_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "InternalError" + } + }, + "VALIDATION_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ValidationError" + } + } + } + }, + "com.amazonaws.sagemakermetrics#MetricStatistic": { + "type": "enum", + "members": { + "MIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Min" + } + }, + "MAX": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Max" + } + }, + "AVG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Avg" + } + }, + "COUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Count" + } + }, + "STD_DEV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "StdDev" + } + }, + "LAST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Last" + } + } + } + }, + "com.amazonaws.sagemakermetrics#MetricValues": { + "type": "list", + "member": { + "target": "com.amazonaws.sagemakermetrics#Double" + } + }, + "com.amazonaws.sagemakermetrics#Period": { + "type": "enum", + "members": { + "ONE_MINUTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OneMinute" + } + }, + "FIVE_MINUTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FiveMinute" + } + }, + "ONE_HOUR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OneHour" + } + }, + "ITERATION_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IterationNumber" + } + } + } + }, "com.amazonaws.sagemakermetrics#PutMetricsErrorCode": { "type": "enum", "members": { @@ -225,6 +512,9 @@ "type": "service", "version": "2022-09-30", "operations": [ + { + "target": "com.amazonaws.sagemakermetrics#BatchGetMetrics" + }, { "target": "com.amazonaws.sagemakermetrics#BatchPutMetrics" } @@ -909,6 +1199,16 @@ } } }, + "com.amazonaws.sagemakermetrics#SageMakerResourceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:[a-z\\-].*/" + } + }, "com.amazonaws.sagemakermetrics#Step": { "type": "integer", "traits": { @@ -919,6 +1219,29 @@ }, "com.amazonaws.sagemakermetrics#Timestamp": { "type": "timestamp" + }, + "com.amazonaws.sagemakermetrics#XAxisType": { + "type": "enum", + "members": { + "ITERATION_NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IterationNumber" + } + }, + "TIMESTAMP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Timestamp" + } + } + } + }, + "com.amazonaws.sagemakermetrics#XAxisValues": { + "type": "list", + "member": { + "target": "com.amazonaws.sagemakermetrics#Long" + } } } }