Skip to content

Commit 1462147

Browse files
author
awstools
committedJan 26, 2024
feat(client-sagemaker): Amazon SageMaker Automatic Model Tuning now provides an API to programmatically delete tuning jobs.
1 parent 8f7e28a commit 1462147

16 files changed

+543
-299
lines changed
 

‎clients/client-sagemaker/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,14 @@ DeleteHumanTaskUi
881881

882882
[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/)
883883

884+
</details>
885+
<details>
886+
<summary>
887+
DeleteHyperParameterTuningJob
888+
</summary>
889+
890+
[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/)
891+
884892
</details>
885893
<details>
886894
<summary>

‎clients/client-sagemaker/src/SageMaker.ts

+23
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ import {
381381
DeleteHumanTaskUiCommandInput,
382382
DeleteHumanTaskUiCommandOutput,
383383
} from "./commands/DeleteHumanTaskUiCommand";
384+
import {
385+
DeleteHyperParameterTuningJobCommand,
386+
DeleteHyperParameterTuningJobCommandInput,
387+
DeleteHyperParameterTuningJobCommandOutput,
388+
} from "./commands/DeleteHyperParameterTuningJobCommand";
384389
import { DeleteImageCommand, DeleteImageCommandInput, DeleteImageCommandOutput } from "./commands/DeleteImageCommand";
385390
import {
386391
DeleteImageVersionCommand,
@@ -1550,6 +1555,7 @@ const commands = {
15501555
DeleteHubCommand,
15511556
DeleteHubContentCommand,
15521557
DeleteHumanTaskUiCommand,
1558+
DeleteHyperParameterTuningJobCommand,
15531559
DeleteImageCommand,
15541560
DeleteImageVersionCommand,
15551561
DeleteInferenceComponentCommand,
@@ -3055,6 +3061,23 @@ export interface SageMaker {
30553061
cb: (err: any, data?: DeleteHumanTaskUiCommandOutput) => void
30563062
): void;
30573063

3064+
/**
3065+
* @see {@link DeleteHyperParameterTuningJobCommand}
3066+
*/
3067+
deleteHyperParameterTuningJob(
3068+
args: DeleteHyperParameterTuningJobCommandInput,
3069+
options?: __HttpHandlerOptions
3070+
): Promise<DeleteHyperParameterTuningJobCommandOutput>;
3071+
deleteHyperParameterTuningJob(
3072+
args: DeleteHyperParameterTuningJobCommandInput,
3073+
cb: (err: any, data?: DeleteHyperParameterTuningJobCommandOutput) => void
3074+
): void;
3075+
deleteHyperParameterTuningJob(
3076+
args: DeleteHyperParameterTuningJobCommandInput,
3077+
options: __HttpHandlerOptions,
3078+
cb: (err: any, data?: DeleteHyperParameterTuningJobCommandOutput) => void
3079+
): void;
3080+
30583081
/**
30593082
* @see {@link DeleteImageCommand}
30603083
*/

‎clients/client-sagemaker/src/SageMakerClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ import {
239239
import { DeleteHubCommandInput, DeleteHubCommandOutput } from "./commands/DeleteHubCommand";
240240
import { DeleteHubContentCommandInput, DeleteHubContentCommandOutput } from "./commands/DeleteHubContentCommand";
241241
import { DeleteHumanTaskUiCommandInput, DeleteHumanTaskUiCommandOutput } from "./commands/DeleteHumanTaskUiCommand";
242+
import {
243+
DeleteHyperParameterTuningJobCommandInput,
244+
DeleteHyperParameterTuningJobCommandOutput,
245+
} from "./commands/DeleteHyperParameterTuningJobCommand";
242246
import { DeleteImageCommandInput, DeleteImageCommandOutput } from "./commands/DeleteImageCommand";
243247
import { DeleteImageVersionCommandInput, DeleteImageVersionCommandOutput } from "./commands/DeleteImageVersionCommand";
244248
import {
@@ -950,6 +954,7 @@ export type ServiceInputTypes =
950954
| DeleteHubCommandInput
951955
| DeleteHubContentCommandInput
952956
| DeleteHumanTaskUiCommandInput
957+
| DeleteHyperParameterTuningJobCommandInput
953958
| DeleteImageCommandInput
954959
| DeleteImageVersionCommandInput
955960
| DeleteInferenceComponentCommandInput
@@ -1273,6 +1278,7 @@ export type ServiceOutputTypes =
12731278
| DeleteHubCommandOutput
12741279
| DeleteHubContentCommandOutput
12751280
| DeleteHumanTaskUiCommandOutput
1281+
| DeleteHyperParameterTuningJobCommandOutput
12761282
| DeleteImageCommandOutput
12771283
| DeleteImageVersionCommandOutput
12781284
| DeleteInferenceComponentCommandOutput

‎clients/client-sagemaker/src/commands/CreateDomainCommand.ts

+25-26
Original file line numberDiff line numberDiff line change
@@ -28,51 +28,50 @@ export interface CreateDomainCommandOutput extends CreateDomainResponse, __Metad
2828

2929
/**
3030
* @public
31-
* <p>Creates a <code>Domain</code>. A domain consists of an associated
32-
* Amazon Elastic File System (EFS) volume, a list of authorized users, and a variety of security, application,
33-
* policy, and Amazon Virtual Private Cloud (VPC) configurations.
34-
* Users within a domain can share notebook files and other artifacts with each other.</p>
31+
* <p>Creates a <code>Domain</code>. A domain consists of an associated Amazon Elastic File System volume, a list
32+
* of authorized users, and a variety of security, application, policy, and Amazon Virtual Private Cloud (VPC)
33+
* configurations. Users within a domain can share notebook files and other artifacts with each
34+
* other.</p>
3535
* <p>
3636
* <b>EFS storage</b>
3737
* </p>
3838
* <p>When a domain is created, an EFS volume is created for use by all of the users within the
39-
* domain. Each user receives a private home directory within the EFS volume for notebooks,
40-
* Git repositories, and data files.</p>
41-
* <p>SageMaker uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with
42-
* an Amazon Web Services managed key by default. For more control, you can specify a
43-
* customer managed key. For more information, see
44-
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html">Protect Data at
45-
* Rest Using Encryption</a>.</p>
39+
* domain. Each user receives a private home directory within the EFS volume for notebooks, Git
40+
* repositories, and data files.</p>
41+
* <p>SageMaker uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to
42+
* encrypt the EFS volume attached to the domain with an Amazon Web Services managed key by
43+
* default. For more control, you can specify a customer managed key. For more information, see
44+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/encryption-at-rest.html">Protect Data
45+
* at Rest Using Encryption</a>.</p>
4646
* <p>
4747
* <b>VPC configuration</b>
4848
* </p>
49-
* <p>All traffic between the domain and the EFS volume is through the specified
50-
* VPC and subnets. For other traffic, you can specify the <code>AppNetworkAccessType</code>
51-
* parameter. <code>AppNetworkAccessType</code> corresponds to the network access type that you
52-
* choose when you onboard to the domain. The following options are available:</p>
49+
* <p>All traffic between the domain and the Amazon EFS volume is through the specified VPC and
50+
* subnets. For other traffic, you can specify the <code>AppNetworkAccessType</code> parameter.
51+
* <code>AppNetworkAccessType</code> corresponds to the network access type that you choose
52+
* when you onboard to the domain. The following options are available:</p>
5353
* <ul>
5454
* <li>
5555
* <p>
5656
* <code>PublicInternetOnly</code> - Non-EFS traffic goes through a VPC managed by
57-
* Amazon SageMaker, which allows internet access. This is the default value.</p>
57+
* Amazon SageMaker, which allows internet access. This is the default value.</p>
5858
* </li>
5959
* <li>
6060
* <p>
61-
* <code>VpcOnly</code> - All traffic is through the specified VPC and subnets.
62-
* Internet access is disabled by default. To allow internet access, you must specify a
63-
* NAT gateway.</p>
64-
* <p>When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook or to
65-
* train or host models unless your VPC has an interface endpoint to the SageMaker API and runtime
66-
* or a NAT gateway and your security groups allow outbound connections.</p>
61+
* <code>VpcOnly</code> - All traffic is through the specified VPC and subnets. Internet
62+
* access is disabled by default. To allow internet access, you must specify a NAT
63+
* gateway.</p>
64+
* <p>When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook
65+
* or to train or host models unless your VPC has an interface endpoint to the SageMaker API and
66+
* runtime or a NAT gateway and your security groups allow outbound connections.</p>
6767
* </li>
6868
* </ul>
6969
* <important>
7070
* <p>NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules
71-
* in order to launch a Amazon SageMaker Studio app successfully.</p>
71+
* in order to launch a Amazon SageMaker Studio app successfully.</p>
7272
* </important>
73-
* <p>For more information, see
74-
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html">Connect
75-
* Amazon SageMaker Studio Notebooks to Resources in a VPC</a>.</p>
73+
* <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
74+
* Notebooks to Resources in a VPC</a>.</p>
7675
* @example
7776
* Use a bare-bones client and the command you need to make an API call.
7877
* ```javascript

‎clients/client-sagemaker/src/commands/DeleteDomainCommand.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ export interface DeleteDomainCommandOutput extends __MetadataBearer {}
2828

2929
/**
3030
* @public
31-
* <p>Used to delete a domain.
32-
* If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center.
33-
* Use with caution. All of the members of the domain will lose access to their EFS volume,
34-
* including data, notebooks, and other artifacts.
35-
* </p>
31+
* <p>Used to delete a domain. If you onboarded with IAM mode, you will need to delete your
32+
* domain to onboard again using IAM Identity Center. Use with caution. All of the members of the
33+
* domain will lose access to their EFS volume, including data, notebooks, and other artifacts.
34+
* </p>
3635
* @example
3736
* Use a bare-bones client and the command you need to make an API call.
3837
* ```javascript
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { DeleteHyperParameterTuningJobRequest } from "../models/models_2";
9+
import {
10+
de_DeleteHyperParameterTuningJobCommand,
11+
se_DeleteHyperParameterTuningJobCommand,
12+
} from "../protocols/Aws_json1_1";
13+
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
14+
15+
/**
16+
* @public
17+
*/
18+
export { __MetadataBearer, $Command };
19+
/**
20+
* @public
21+
*
22+
* The input for {@link DeleteHyperParameterTuningJobCommand}.
23+
*/
24+
export interface DeleteHyperParameterTuningJobCommandInput extends DeleteHyperParameterTuningJobRequest {}
25+
/**
26+
* @public
27+
*
28+
* The output of {@link DeleteHyperParameterTuningJobCommand}.
29+
*/
30+
export interface DeleteHyperParameterTuningJobCommandOutput extends __MetadataBearer {}
31+
32+
/**
33+
* @public
34+
* <p>Deletes a hyperparameter tuning job. The <code>DeleteHyperParameterTuningJob</code>
35+
* API deletes only the tuning job entry that was created in SageMaker when you called the
36+
* <code>CreateHyperParameterTuningJob</code> API. It does not delete training jobs,
37+
* artifacts, or the IAM role that you specified when creating the model.</p>
38+
* @example
39+
* Use a bare-bones client and the command you need to make an API call.
40+
* ```javascript
41+
* import { SageMakerClient, DeleteHyperParameterTuningJobCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
42+
* // const { SageMakerClient, DeleteHyperParameterTuningJobCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
43+
* const client = new SageMakerClient(config);
44+
* const input = { // DeleteHyperParameterTuningJobRequest
45+
* HyperParameterTuningJobName: "STRING_VALUE", // required
46+
* };
47+
* const command = new DeleteHyperParameterTuningJobCommand(input);
48+
* const response = await client.send(command);
49+
* // {};
50+
*
51+
* ```
52+
*
53+
* @param DeleteHyperParameterTuningJobCommandInput - {@link DeleteHyperParameterTuningJobCommandInput}
54+
* @returns {@link DeleteHyperParameterTuningJobCommandOutput}
55+
* @see {@link DeleteHyperParameterTuningJobCommandInput} for command's `input` shape.
56+
* @see {@link DeleteHyperParameterTuningJobCommandOutput} for command's `response` shape.
57+
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
58+
*
59+
* @throws {@link SageMakerServiceException}
60+
* <p>Base exception class for all service exceptions from SageMaker service.</p>
61+
*
62+
*/
63+
export class DeleteHyperParameterTuningJobCommand extends $Command
64+
.classBuilder<
65+
DeleteHyperParameterTuningJobCommandInput,
66+
DeleteHyperParameterTuningJobCommandOutput,
67+
SageMakerClientResolvedConfig,
68+
ServiceInputTypes,
69+
ServiceOutputTypes
70+
>()
71+
.ep({
72+
...commonParams,
73+
})
74+
.m(function (this: any, Command: any, cs: any, config: SageMakerClientResolvedConfig, o: any) {
75+
return [
76+
getSerdePlugin(config, this.serialize, this.deserialize),
77+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
78+
];
79+
})
80+
.s("SageMaker", "DeleteHyperParameterTuningJob", {})
81+
.n("SageMakerClient", "DeleteHyperParameterTuningJobCommand")
82+
.f(void 0, void 0)
83+
.ser(se_DeleteHyperParameterTuningJobCommand)
84+
.de(de_DeleteHyperParameterTuningJobCommand)
85+
.build() {}

‎clients/client-sagemaker/src/commands/DescribeStudioLifecycleConfigCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Command as $Command } from "@smithy/smithy-client";
55
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
8-
import { DescribeStudioLifecycleConfigRequest, DescribeStudioLifecycleConfigResponse } from "../models/models_2";
8+
import { DescribeStudioLifecycleConfigRequest } from "../models/models_2";
9+
import { DescribeStudioLifecycleConfigResponse } from "../models/models_3";
910
import {
1011
de_DescribeStudioLifecycleConfigCommand,
1112
se_DescribeStudioLifecycleConfigCommand,

‎clients/client-sagemaker/src/commands/UpdateEndpointCommand.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ export interface UpdateEndpointCommandOutput extends UpdateEndpointOutput, __Met
2828

2929
/**
3030
* @public
31-
* <p>Deploys the new <code>EndpointConfig</code> specified in the request, switches to
32-
* using newly created endpoint, and then deletes resources provisioned for the endpoint
33-
* using the previous <code>EndpointConfig</code> (there is no availability loss). </p>
31+
* <p>Deploys the <code>EndpointConfig</code> specified in the request
32+
* to a new fleet of instances. SageMaker shifts endpoint traffic to the new instances
33+
* with the updated endpoint configuration and then deletes the old instances
34+
* using the previous <code>EndpointConfig</code> (there is no availability loss).
35+
* For more information about how to control the update and traffic shifting process, see
36+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails.html">
37+
* Update models in production</a>.</p>
3438
* <p>When SageMaker receives the request, it sets the endpoint status to
3539
* <code>Updating</code>. After updating the endpoint, it sets the status to
3640
* <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.

‎clients/client-sagemaker/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export * from "./DeleteFlowDefinitionCommand";
8282
export * from "./DeleteHubCommand";
8383
export * from "./DeleteHubContentCommand";
8484
export * from "./DeleteHumanTaskUiCommand";
85+
export * from "./DeleteHyperParameterTuningJobCommand";
8586
export * from "./DeleteImageCommand";
8687
export * from "./DeleteImageVersionCommand";
8788
export * from "./DeleteInferenceComponentCommand";

0 commit comments

Comments
 (0)
Please sign in to comment.