Skip to content

Commit

Permalink
feat(client-sagemaker): AWS Sagemaker - Sagemaker Images now supports…
Browse files Browse the repository at this point in the history
… Aliases as secondary identifiers for ImageVersions. SageMaker Images now supports additional metadata for ImageVersions for better images management.
  • Loading branch information
awstools committed Dec 19, 2022
1 parent 48b6c2a commit 4390e08
Show file tree
Hide file tree
Showing 22 changed files with 1,814 additions and 462 deletions.
64 changes: 64 additions & 0 deletions clients/client-sagemaker/src/SageMaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ import {
ListAlgorithmsCommandInput,
ListAlgorithmsCommandOutput,
} from "./commands/ListAlgorithmsCommand";
import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand";
import {
ListAppImageConfigsCommand,
ListAppImageConfigsCommandInput,
Expand Down Expand Up @@ -1290,6 +1291,11 @@ import {
} from "./commands/UpdateFeatureMetadataCommand";
import { UpdateHubCommand, UpdateHubCommandInput, UpdateHubCommandOutput } from "./commands/UpdateHubCommand";
import { UpdateImageCommand, UpdateImageCommandInput, UpdateImageCommandOutput } from "./commands/UpdateImageCommand";
import {
UpdateImageVersionCommand,
UpdateImageVersionCommandInput,
UpdateImageVersionCommandOutput,
} from "./commands/UpdateImageVersionCommand";
import {
UpdateInferenceExperimentCommand,
UpdateInferenceExperimentCommandInput,
Expand Down Expand Up @@ -7502,6 +7508,32 @@ export class SageMaker extends SageMakerClient {
}
}

/**
* <p>Lists the aliases of a specified image or image version.</p>
*/
public listAliases(args: ListAliasesCommandInput, options?: __HttpHandlerOptions): Promise<ListAliasesCommandOutput>;
public listAliases(args: ListAliasesCommandInput, cb: (err: any, data?: ListAliasesCommandOutput) => void): void;
public listAliases(
args: ListAliasesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAliasesCommandOutput) => void
): void;
public listAliases(
args: ListAliasesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAliasesCommandOutput) => void),
cb?: (err: any, data?: ListAliasesCommandOutput) => void
): Promise<ListAliasesCommandOutput> | void {
const command = new ListAliasesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Lists the AppImageConfigs in your account and their properties. The list can be
* filtered by creation time or modified time, and whether the AppImageConfig name contains
Expand Down Expand Up @@ -11098,6 +11130,38 @@ export class SageMaker extends SageMakerClient {
}
}

/**
* <p>Updates the properties of a SageMaker image version.</p>
*/
public updateImageVersion(
args: UpdateImageVersionCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateImageVersionCommandOutput>;
public updateImageVersion(
args: UpdateImageVersionCommandInput,
cb: (err: any, data?: UpdateImageVersionCommandOutput) => void
): void;
public updateImageVersion(
args: UpdateImageVersionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateImageVersionCommandOutput) => void
): void;
public updateImageVersion(
args: UpdateImageVersionCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateImageVersionCommandOutput) => void),
cb?: (err: any, data?: UpdateImageVersionCommandOutput) => void
): Promise<UpdateImageVersionCommandOutput> | void {
const command = new UpdateImageVersionCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>
* Updates an inference experiment that you created. The status of the inference experiment has to be either
Expand Down
6 changes: 6 additions & 0 deletions clients/client-sagemaker/src/SageMakerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ import {
import { ImportHubContentCommandInput, ImportHubContentCommandOutput } from "./commands/ImportHubContentCommand";
import { ListActionsCommandInput, ListActionsCommandOutput } from "./commands/ListActionsCommand";
import { ListAlgorithmsCommandInput, ListAlgorithmsCommandOutput } from "./commands/ListAlgorithmsCommand";
import { ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand";
import {
ListAppImageConfigsCommandInput,
ListAppImageConfigsCommandOutput,
Expand Down Expand Up @@ -760,6 +761,7 @@ import {
} from "./commands/UpdateFeatureMetadataCommand";
import { UpdateHubCommandInput, UpdateHubCommandOutput } from "./commands/UpdateHubCommand";
import { UpdateImageCommandInput, UpdateImageCommandOutput } from "./commands/UpdateImageCommand";
import { UpdateImageVersionCommandInput, UpdateImageVersionCommandOutput } from "./commands/UpdateImageVersionCommand";
import {
UpdateInferenceExperimentCommandInput,
UpdateInferenceExperimentCommandOutput,
Expand Down Expand Up @@ -978,6 +980,7 @@ export type ServiceInputTypes =
| ImportHubContentCommandInput
| ListActionsCommandInput
| ListAlgorithmsCommandInput
| ListAliasesCommandInput
| ListAppImageConfigsCommandInput
| ListAppsCommandInput
| ListArtifactsCommandInput
Expand Down Expand Up @@ -1088,6 +1091,7 @@ export type ServiceInputTypes =
| UpdateFeatureMetadataCommandInput
| UpdateHubCommandInput
| UpdateImageCommandInput
| UpdateImageVersionCommandInput
| UpdateInferenceExperimentCommandInput
| UpdateModelCardCommandInput
| UpdateModelPackageCommandInput
Expand Down Expand Up @@ -1278,6 +1282,7 @@ export type ServiceOutputTypes =
| ImportHubContentCommandOutput
| ListActionsCommandOutput
| ListAlgorithmsCommandOutput
| ListAliasesCommandOutput
| ListAppImageConfigsCommandOutput
| ListAppsCommandOutput
| ListArtifactsCommandOutput
Expand Down Expand Up @@ -1388,6 +1393,7 @@ export type ServiceOutputTypes =
| UpdateFeatureMetadataCommandOutput
| UpdateHubCommandOutput
| UpdateImageCommandOutput
| UpdateImageVersionCommandOutput
| UpdateInferenceExperimentCommandOutput
| UpdateModelCardCommandOutput
| UpdateModelPackageCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
DescribeAlgorithmInputFilterSensitiveLog,
DescribeAlgorithmOutput,
DescribeAlgorithmOutputFilterSensitiveLog,
} from "../models/models_1";
} from "../models/models_2";
import {
deserializeAws_json1_1DescribeAlgorithmCommand,
serializeAws_json1_1DescribeAlgorithmCommand,
Expand Down
8 changes: 6 additions & 2 deletions clients/client-sagemaker/src/commands/DescribeAppCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { DescribeAppRequest, DescribeAppRequestFilterSensitiveLog } from "../models/models_1";
import { DescribeAppResponse, DescribeAppResponseFilterSensitiveLog } from "../models/models_2";
import {
DescribeAppRequest,
DescribeAppRequestFilterSensitiveLog,
DescribeAppResponse,
DescribeAppResponseFilterSensitiveLog,
} from "../models/models_2";
import {
deserializeAws_json1_1DescribeAppCommand,
serializeAws_json1_1DescribeAppCommand,
Expand Down
112 changes: 112 additions & 0 deletions clients/client-sagemaker/src/commands/ListAliasesCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import {
ListAliasesRequest,
ListAliasesRequestFilterSensitiveLog,
ListAliasesResponse,
ListAliasesResponseFilterSensitiveLog,
} from "../models/models_2";
import {
deserializeAws_json1_1ListAliasesCommand,
serializeAws_json1_1ListAliasesCommand,
} from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

export interface ListAliasesCommandInput extends ListAliasesRequest {}
export interface ListAliasesCommandOutput extends ListAliasesResponse, __MetadataBearer {}

/**
* <p>Lists the aliases of a specified image or image version.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SageMakerClient, ListAliasesCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
* // const { SageMakerClient, ListAliasesCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
* const client = new SageMakerClient(config);
* const command = new ListAliasesCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAliasesCommandInput} for command's `input` shape.
* @see {@link ListAliasesCommandOutput} for command's `response` shape.
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
*
*/
export class ListAliasesCommand extends $Command<
ListAliasesCommandInput,
ListAliasesCommandOutput,
SageMakerClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: ListAliasesCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: SageMakerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListAliasesCommandInput, ListAliasesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getEndpointPlugin(configuration, ListAliasesCommand.getEndpointParameterInstructions()));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "SageMakerClient";
const commandName = "ListAliasesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListAliasesRequestFilterSensitiveLog,
outputFilterSensitiveLog: ListAliasesResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: ListAliasesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1ListAliasesCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListAliasesCommandOutput> {
return deserializeAws_json1_1ListAliasesCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import {
ListAssociationsRequest,
ListAssociationsRequestFilterSensitiveLog,
ListAssociationsResponse,
ListAssociationsResponseFilterSensitiveLog,
} from "../models/models_2";
import { ListAssociationsRequest, ListAssociationsRequestFilterSensitiveLog } from "../models/models_2";
import { ListAssociationsResponse, ListAssociationsResponseFilterSensitiveLog } from "../models/models_3";
import {
deserializeAws_json1_1ListAssociationsCommand,
serializeAws_json1_1ListAssociationsCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
ListAutoMLJobsRequestFilterSensitiveLog,
ListAutoMLJobsResponse,
ListAutoMLJobsResponseFilterSensitiveLog,
} from "../models/models_2";
} from "../models/models_3";
import {
deserializeAws_json1_1ListAutoMLJobsCommand,
serializeAws_json1_1ListAutoMLJobsCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
ListCandidatesForAutoMLJobRequestFilterSensitiveLog,
ListCandidatesForAutoMLJobResponse,
ListCandidatesForAutoMLJobResponseFilterSensitiveLog,
} from "../models/models_2";
} from "../models/models_3";
import {
deserializeAws_json1_1ListCandidatesForAutoMLJobCommand,
serializeAws_json1_1ListCandidatesForAutoMLJobCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import {
UpdateFeatureGroupRequest,
UpdateFeatureGroupRequestFilterSensitiveLog,
UpdateFeatureGroupResponse,
UpdateFeatureGroupResponseFilterSensitiveLog,
} from "../models/models_3";
import { UpdateFeatureGroupRequest, UpdateFeatureGroupRequestFilterSensitiveLog } from "../models/models_3";
import { UpdateFeatureGroupResponse, UpdateFeatureGroupResponseFilterSensitiveLog } from "../models/models_4";
import {
deserializeAws_json1_1UpdateFeatureGroupCommand,
serializeAws_json1_1UpdateFeatureGroupCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { UpdateFeatureMetadataRequest, UpdateFeatureMetadataRequestFilterSensitiveLog } from "../models/models_3";
import { UpdateFeatureMetadataRequest, UpdateFeatureMetadataRequestFilterSensitiveLog } from "../models/models_4";
import {
deserializeAws_json1_1UpdateFeatureMetadataCommand,
serializeAws_json1_1UpdateFeatureMetadataCommand,
Expand Down
2 changes: 1 addition & 1 deletion clients/client-sagemaker/src/commands/UpdateHubCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
UpdateHubRequestFilterSensitiveLog,
UpdateHubResponse,
UpdateHubResponseFilterSensitiveLog,
} from "../models/models_3";
} from "../models/models_4";
import { deserializeAws_json1_1UpdateHubCommand, serializeAws_json1_1UpdateHubCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
8 changes: 6 additions & 2 deletions clients/client-sagemaker/src/commands/UpdateImageCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { UpdateImageRequest, UpdateImageRequestFilterSensitiveLog } from "../models/models_3";
import { UpdateImageResponse, UpdateImageResponseFilterSensitiveLog } from "../models/models_4";
import {
UpdateImageRequest,
UpdateImageRequestFilterSensitiveLog,
UpdateImageResponse,
UpdateImageResponseFilterSensitiveLog,
} from "../models/models_4";
import {
deserializeAws_json1_1UpdateImageCommand,
serializeAws_json1_1UpdateImageCommand,
Expand Down

0 comments on commit 4390e08

Please sign in to comment.