Skip to content

Commit

Permalink
feat(client-sagemaker): Amazon SageMaker Automatic Model Tuning now p…
Browse files Browse the repository at this point in the history
…rovides an API to programmatically delete tuning jobs.
  • Loading branch information
awstools committed Jan 26, 2024
1 parent 8f7e28a commit 1462147
Show file tree
Hide file tree
Showing 16 changed files with 543 additions and 299 deletions.
8 changes: 8 additions & 0 deletions clients/client-sagemaker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,14 @@ DeleteHumanTaskUi

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeleteHumanTaskUiCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteHumanTaskUiCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteHumanTaskUiCommandOutput/)

</details>
<details>
<summary>
DeleteHyperParameterTuningJob
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeleteHyperParameterTuningJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteHyperParameterTuningJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteHyperParameterTuningJobCommandOutput/)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-sagemaker/src/SageMaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ import {
DeleteHumanTaskUiCommandInput,
DeleteHumanTaskUiCommandOutput,
} from "./commands/DeleteHumanTaskUiCommand";
import {
DeleteHyperParameterTuningJobCommand,
DeleteHyperParameterTuningJobCommandInput,
DeleteHyperParameterTuningJobCommandOutput,
} from "./commands/DeleteHyperParameterTuningJobCommand";
import { DeleteImageCommand, DeleteImageCommandInput, DeleteImageCommandOutput } from "./commands/DeleteImageCommand";
import {
DeleteImageVersionCommand,
Expand Down Expand Up @@ -1550,6 +1555,7 @@ const commands = {
DeleteHubCommand,
DeleteHubContentCommand,
DeleteHumanTaskUiCommand,
DeleteHyperParameterTuningJobCommand,
DeleteImageCommand,
DeleteImageVersionCommand,
DeleteInferenceComponentCommand,
Expand Down Expand Up @@ -3055,6 +3061,23 @@ export interface SageMaker {
cb: (err: any, data?: DeleteHumanTaskUiCommandOutput) => void
): void;

/**
* @see {@link DeleteHyperParameterTuningJobCommand}
*/
deleteHyperParameterTuningJob(
args: DeleteHyperParameterTuningJobCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteHyperParameterTuningJobCommandOutput>;
deleteHyperParameterTuningJob(
args: DeleteHyperParameterTuningJobCommandInput,
cb: (err: any, data?: DeleteHyperParameterTuningJobCommandOutput) => void
): void;
deleteHyperParameterTuningJob(
args: DeleteHyperParameterTuningJobCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteHyperParameterTuningJobCommandOutput) => void
): void;

/**
* @see {@link DeleteImageCommand}
*/
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 @@ -239,6 +239,10 @@ import {
import { DeleteHubCommandInput, DeleteHubCommandOutput } from "./commands/DeleteHubCommand";
import { DeleteHubContentCommandInput, DeleteHubContentCommandOutput } from "./commands/DeleteHubContentCommand";
import { DeleteHumanTaskUiCommandInput, DeleteHumanTaskUiCommandOutput } from "./commands/DeleteHumanTaskUiCommand";
import {
DeleteHyperParameterTuningJobCommandInput,
DeleteHyperParameterTuningJobCommandOutput,
} from "./commands/DeleteHyperParameterTuningJobCommand";
import { DeleteImageCommandInput, DeleteImageCommandOutput } from "./commands/DeleteImageCommand";
import { DeleteImageVersionCommandInput, DeleteImageVersionCommandOutput } from "./commands/DeleteImageVersionCommand";
import {
Expand Down Expand Up @@ -950,6 +954,7 @@ export type ServiceInputTypes =
| DeleteHubCommandInput
| DeleteHubContentCommandInput
| DeleteHumanTaskUiCommandInput
| DeleteHyperParameterTuningJobCommandInput
| DeleteImageCommandInput
| DeleteImageVersionCommandInput
| DeleteInferenceComponentCommandInput
Expand Down Expand Up @@ -1273,6 +1278,7 @@ export type ServiceOutputTypes =
| DeleteHubCommandOutput
| DeleteHubContentCommandOutput
| DeleteHumanTaskUiCommandOutput
| DeleteHyperParameterTuningJobCommandOutput
| DeleteImageCommandOutput
| DeleteImageVersionCommandOutput
| DeleteInferenceComponentCommandOutput
Expand Down
51 changes: 25 additions & 26 deletions clients/client-sagemaker/src/commands/CreateDomainCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,50 @@ export interface CreateDomainCommandOutput extends CreateDomainResponse, __Metad

/**
* @public
* <p>Creates a <code>Domain</code>. A domain consists of an associated
* Amazon Elastic File System (EFS) volume, a list of authorized users, and a variety of security, application,
* policy, and Amazon Virtual Private Cloud (VPC) configurations.
* Users within a domain can share notebook files and other artifacts with each other.</p>
* <p>Creates a <code>Domain</code>. A domain consists of an associated Amazon Elastic File System volume, a list
* of authorized users, and a variety of security, application, policy, and Amazon Virtual Private Cloud (VPC)
* configurations. Users within a domain can share notebook files and other artifacts with each
* other.</p>
* <p>
* <b>EFS storage</b>
* </p>
* <p>When a domain is created, an EFS volume is created for use by all of the users within the
* domain. Each user receives a private home directory within the EFS volume for notebooks,
* Git repositories, and data files.</p>
* <p>SageMaker uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with
* an Amazon Web Services managed key by default. For more control, you can specify a
* customer managed key. For more information, see
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html">Protect Data at
* Rest Using Encryption</a>.</p>
* domain. Each user receives a private home directory within the EFS volume for notebooks, Git
* repositories, and data files.</p>
* <p>SageMaker uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to
* encrypt the EFS volume attached to the domain with an Amazon Web Services managed key by
* default. For more control, you can specify a customer managed key. For more information, see
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html">Protect Data
* at Rest Using Encryption</a>.</p>
* <p>
* <b>VPC configuration</b>
* </p>
* <p>All traffic between the domain and the EFS volume is through the specified
* VPC and subnets. For other traffic, you can specify the <code>AppNetworkAccessType</code>
* parameter. <code>AppNetworkAccessType</code> corresponds to the network access type that you
* choose when you onboard to the domain. The following options are available:</p>
* <p>All traffic between the domain and the Amazon EFS volume is through the specified VPC and
* subnets. For other traffic, you can specify the <code>AppNetworkAccessType</code> parameter.
* <code>AppNetworkAccessType</code> corresponds to the network access type that you choose
* when you onboard to the domain. The following options are available:</p>
* <ul>
* <li>
* <p>
* <code>PublicInternetOnly</code> - Non-EFS traffic goes through a VPC managed by
* Amazon SageMaker, which allows internet access. This is the default value.</p>
* Amazon SageMaker, which allows internet access. This is the default value.</p>
* </li>
* <li>
* <p>
* <code>VpcOnly</code> - All traffic is through the specified VPC and subnets.
* Internet access is disabled by default. To allow internet access, you must specify a
* NAT gateway.</p>
* <p>When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook or to
* train or host models unless your VPC has an interface endpoint to the SageMaker API and runtime
* or a NAT gateway and your security groups allow outbound connections.</p>
* <code>VpcOnly</code> - All traffic is through the specified VPC and subnets. Internet
* access is disabled by default. To allow internet access, you must specify a NAT
* gateway.</p>
* <p>When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook
* or to train or host models unless your VPC has an interface endpoint to the SageMaker API and
* runtime or a NAT gateway and your security groups allow outbound connections.</p>
* </li>
* </ul>
* <important>
* <p>NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules
* in order to launch a Amazon SageMaker Studio app successfully.</p>
* in order to launch a Amazon SageMaker Studio app successfully.</p>
* </important>
* <p>For more information, see
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html">Connect
* Amazon SageMaker Studio Notebooks to Resources in a VPC</a>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html">Connect Amazon SageMaker Studio
* Notebooks to Resources in a VPC</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
9 changes: 4 additions & 5 deletions clients/client-sagemaker/src/commands/DeleteDomainCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ export interface DeleteDomainCommandOutput extends __MetadataBearer {}

/**
* @public
* <p>Used to delete a domain.
* If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center.
* Use with caution. All of the members of the domain will lose access to their EFS volume,
* including data, notebooks, and other artifacts.
* </p>
* <p>Used to delete a domain. If you onboarded with IAM mode, you will need to delete your
* domain to onboard again using IAM Identity Center. Use with caution. All of the members of the
* domain will lose access to their EFS volume, including data, notebooks, and other artifacts.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// 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 { DeleteHyperParameterTuningJobRequest } from "../models/models_2";
import {
de_DeleteHyperParameterTuningJobCommand,
se_DeleteHyperParameterTuningJobCommand,
} from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link DeleteHyperParameterTuningJobCommand}.
*/
export interface DeleteHyperParameterTuningJobCommandInput extends DeleteHyperParameterTuningJobRequest {}
/**
* @public
*
* The output of {@link DeleteHyperParameterTuningJobCommand}.
*/
export interface DeleteHyperParameterTuningJobCommandOutput extends __MetadataBearer {}

/**
* @public
* <p>Deletes a hyperparameter tuning job. The <code>DeleteHyperParameterTuningJob</code>
* API deletes only the tuning job entry that was created in SageMaker when you called the
* <code>CreateHyperParameterTuningJob</code> API. It does not delete training jobs,
* artifacts, or the IAM role that you specified when creating the model.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SageMakerClient, DeleteHyperParameterTuningJobCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
* // const { SageMakerClient, DeleteHyperParameterTuningJobCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
* const client = new SageMakerClient(config);
* const input = { // DeleteHyperParameterTuningJobRequest
* HyperParameterTuningJobName: "STRING_VALUE", // required
* };
* const command = new DeleteHyperParameterTuningJobCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param DeleteHyperParameterTuningJobCommandInput - {@link DeleteHyperParameterTuningJobCommandInput}
* @returns {@link DeleteHyperParameterTuningJobCommandOutput}
* @see {@link DeleteHyperParameterTuningJobCommandInput} for command's `input` shape.
* @see {@link DeleteHyperParameterTuningJobCommandOutput} for command's `response` shape.
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
*
* @throws {@link SageMakerServiceException}
* <p>Base exception class for all service exceptions from SageMaker service.</p>
*
*/
export class DeleteHyperParameterTuningJobCommand extends $Command
.classBuilder<
DeleteHyperParameterTuningJobCommandInput,
DeleteHyperParameterTuningJobCommandOutput,
SageMakerClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: SageMakerClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("SageMaker", "DeleteHyperParameterTuningJob", {})
.n("SageMakerClient", "DeleteHyperParameterTuningJobCommand")
.f(void 0, void 0)
.ser(se_DeleteHyperParameterTuningJobCommand)
.de(de_DeleteHyperParameterTuningJobCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { DescribeStudioLifecycleConfigRequest, DescribeStudioLifecycleConfigResponse } from "../models/models_2";
import { DescribeStudioLifecycleConfigRequest } from "../models/models_2";
import { DescribeStudioLifecycleConfigResponse } from "../models/models_3";
import {
de_DescribeStudioLifecycleConfigCommand,
se_DescribeStudioLifecycleConfigCommand,
Expand Down
10 changes: 7 additions & 3 deletions clients/client-sagemaker/src/commands/UpdateEndpointCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ export interface UpdateEndpointCommandOutput extends UpdateEndpointOutput, __Met

/**
* @public
* <p>Deploys the new <code>EndpointConfig</code> specified in the request, switches to
* using newly created endpoint, and then deletes resources provisioned for the endpoint
* using the previous <code>EndpointConfig</code> (there is no availability loss). </p>
* <p>Deploys the <code>EndpointConfig</code> specified in the request
* to a new fleet of instances. SageMaker shifts endpoint traffic to the new instances
* with the updated endpoint configuration and then deletes the old instances
* using the previous <code>EndpointConfig</code> (there is no availability loss).
* For more information about how to control the update and traffic shifting process, see
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails.html">
* Update models in production</a>.</p>
* <p>When SageMaker receives the request, it sets the endpoint status to
* <code>Updating</code>. After updating the endpoint, it sets the status to
* <code>InService</code>. To check the status of an endpoint, use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpoint.html">DescribeEndpoint</a> API.
Expand Down
1 change: 1 addition & 0 deletions clients/client-sagemaker/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export * from "./DeleteFlowDefinitionCommand";
export * from "./DeleteHubCommand";
export * from "./DeleteHubContentCommand";
export * from "./DeleteHumanTaskUiCommand";
export * from "./DeleteHyperParameterTuningJobCommand";
export * from "./DeleteImageCommand";
export * from "./DeleteImageVersionCommand";
export * from "./DeleteInferenceComponentCommand";
Expand Down

0 comments on commit 1462147

Please sign in to comment.