Skip to content

Commit 92883b1

Browse files
author
awstools
committed
feat(client-sagemaker): Amazon SageMaker now supports deleting training and processing jobs in a terminal status.
1 parent 9f89671 commit 92883b1

20 files changed

+614
-164
lines changed

clients/client-sagemaker/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,14 @@ DeletePipeline
11541154

11551155
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeletePipelineCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeletePipelineCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeletePipelineCommandOutput/)
11561156

1157+
</details>
1158+
<details>
1159+
<summary>
1160+
DeleteProcessingJob
1161+
</summary>
1162+
1163+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeleteProcessingJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteProcessingJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteProcessingJobCommandOutput/)
1164+
11571165
</details>
11581166
<details>
11591167
<summary>
@@ -1186,6 +1194,14 @@ DeleteTags
11861194

11871195
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeleteTagsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteTagsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteTagsCommandOutput/)
11881196

1197+
</details>
1198+
<details>
1199+
<summary>
1200+
DeleteTrainingJob
1201+
</summary>
1202+
1203+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/DeleteTrainingJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteTrainingJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/DeleteTrainingJobCommandOutput/)
1204+
11891205
</details>
11901206
<details>
11911207
<summary>

clients/client-sagemaker/src/SageMaker.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ import {
553553
DeletePipelineCommandInput,
554554
DeletePipelineCommandOutput,
555555
} from "./commands/DeletePipelineCommand";
556+
import {
557+
DeleteProcessingJobCommand,
558+
DeleteProcessingJobCommandInput,
559+
DeleteProcessingJobCommandOutput,
560+
} from "./commands/DeleteProcessingJobCommand";
556561
import {
557562
DeleteProjectCommand,
558563
DeleteProjectCommandInput,
@@ -565,6 +570,11 @@ import {
565570
DeleteStudioLifecycleConfigCommandOutput,
566571
} from "./commands/DeleteStudioLifecycleConfigCommand";
567572
import { DeleteTagsCommand, DeleteTagsCommandInput, DeleteTagsCommandOutput } from "./commands/DeleteTagsCommand";
573+
import {
574+
DeleteTrainingJobCommand,
575+
DeleteTrainingJobCommandInput,
576+
DeleteTrainingJobCommandOutput,
577+
} from "./commands/DeleteTrainingJobCommand";
568578
import { DeleteTrialCommand, DeleteTrialCommandInput, DeleteTrialCommandOutput } from "./commands/DeleteTrialCommand";
569579
import {
570580
DeleteTrialComponentCommand,
@@ -1841,10 +1851,12 @@ const commands = {
18411851
DeleteOptimizationJobCommand,
18421852
DeletePartnerAppCommand,
18431853
DeletePipelineCommand,
1854+
DeleteProcessingJobCommand,
18441855
DeleteProjectCommand,
18451856
DeleteSpaceCommand,
18461857
DeleteStudioLifecycleConfigCommand,
18471858
DeleteTagsCommand,
1859+
DeleteTrainingJobCommand,
18481860
DeleteTrialCommand,
18491861
DeleteTrialComponentCommand,
18501862
DeleteUserProfileCommand,
@@ -3957,6 +3969,23 @@ export interface SageMaker {
39573969
cb: (err: any, data?: DeletePipelineCommandOutput) => void
39583970
): void;
39593971

3972+
/**
3973+
* @see {@link DeleteProcessingJobCommand}
3974+
*/
3975+
deleteProcessingJob(
3976+
args: DeleteProcessingJobCommandInput,
3977+
options?: __HttpHandlerOptions
3978+
): Promise<DeleteProcessingJobCommandOutput>;
3979+
deleteProcessingJob(
3980+
args: DeleteProcessingJobCommandInput,
3981+
cb: (err: any, data?: DeleteProcessingJobCommandOutput) => void
3982+
): void;
3983+
deleteProcessingJob(
3984+
args: DeleteProcessingJobCommandInput,
3985+
options: __HttpHandlerOptions,
3986+
cb: (err: any, data?: DeleteProcessingJobCommandOutput) => void
3987+
): void;
3988+
39603989
/**
39613990
* @see {@link DeleteProjectCommand}
39623991
*/
@@ -4007,6 +4036,23 @@ export interface SageMaker {
40074036
cb: (err: any, data?: DeleteTagsCommandOutput) => void
40084037
): void;
40094038

4039+
/**
4040+
* @see {@link DeleteTrainingJobCommand}
4041+
*/
4042+
deleteTrainingJob(
4043+
args: DeleteTrainingJobCommandInput,
4044+
options?: __HttpHandlerOptions
4045+
): Promise<DeleteTrainingJobCommandOutput>;
4046+
deleteTrainingJob(
4047+
args: DeleteTrainingJobCommandInput,
4048+
cb: (err: any, data?: DeleteTrainingJobCommandOutput) => void
4049+
): void;
4050+
deleteTrainingJob(
4051+
args: DeleteTrainingJobCommandInput,
4052+
options: __HttpHandlerOptions,
4053+
cb: (err: any, data?: DeleteTrainingJobCommandOutput) => void
4054+
): void;
4055+
40104056
/**
40114057
* @see {@link DeleteTrialCommand}
40124058
*/

clients/client-sagemaker/src/SageMakerClient.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,18 @@ import {
355355
} from "./commands/DeleteOptimizationJobCommand";
356356
import { DeletePartnerAppCommandInput, DeletePartnerAppCommandOutput } from "./commands/DeletePartnerAppCommand";
357357
import { DeletePipelineCommandInput, DeletePipelineCommandOutput } from "./commands/DeletePipelineCommand";
358+
import {
359+
DeleteProcessingJobCommandInput,
360+
DeleteProcessingJobCommandOutput,
361+
} from "./commands/DeleteProcessingJobCommand";
358362
import { DeleteProjectCommandInput, DeleteProjectCommandOutput } from "./commands/DeleteProjectCommand";
359363
import { DeleteSpaceCommandInput, DeleteSpaceCommandOutput } from "./commands/DeleteSpaceCommand";
360364
import {
361365
DeleteStudioLifecycleConfigCommandInput,
362366
DeleteStudioLifecycleConfigCommandOutput,
363367
} from "./commands/DeleteStudioLifecycleConfigCommand";
364368
import { DeleteTagsCommandInput, DeleteTagsCommandOutput } from "./commands/DeleteTagsCommand";
369+
import { DeleteTrainingJobCommandInput, DeleteTrainingJobCommandOutput } from "./commands/DeleteTrainingJobCommand";
365370
import { DeleteTrialCommandInput, DeleteTrialCommandOutput } from "./commands/DeleteTrialCommand";
366371
import {
367372
DeleteTrialComponentCommandInput,
@@ -1153,10 +1158,12 @@ export type ServiceInputTypes =
11531158
| DeleteOptimizationJobCommandInput
11541159
| DeletePartnerAppCommandInput
11551160
| DeletePipelineCommandInput
1161+
| DeleteProcessingJobCommandInput
11561162
| DeleteProjectCommandInput
11571163
| DeleteSpaceCommandInput
11581164
| DeleteStudioLifecycleConfigCommandInput
11591165
| DeleteTagsCommandInput
1166+
| DeleteTrainingJobCommandInput
11601167
| DeleteTrialCommandInput
11611168
| DeleteTrialComponentCommandInput
11621169
| DeleteUserProfileCommandInput
@@ -1527,10 +1534,12 @@ export type ServiceOutputTypes =
15271534
| DeleteOptimizationJobCommandOutput
15281535
| DeletePartnerAppCommandOutput
15291536
| DeletePipelineCommandOutput
1537+
| DeleteProcessingJobCommandOutput
15301538
| DeleteProjectCommandOutput
15311539
| DeleteSpaceCommandOutput
15321540
| DeleteStudioLifecycleConfigCommandOutput
15331541
| DeleteTagsCommandOutput
1542+
| DeleteTrainingJobCommandOutput
15341543
| DeleteTrialCommandOutput
15351544
| DeleteTrialComponentCommandOutput
15361545
| DeleteUserProfileCommandOutput
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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 { DeleteProcessingJobRequest } from "../models/models_2";
9+
import { de_DeleteProcessingJobCommand, se_DeleteProcessingJobCommand } from "../protocols/Aws_json1_1";
10+
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DeleteProcessingJobCommand}.
21+
*/
22+
export interface DeleteProcessingJobCommandInput extends DeleteProcessingJobRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteProcessingJobCommand}.
27+
*/
28+
export interface DeleteProcessingJobCommandOutput extends __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes a processing job. After Amazon SageMaker deletes a processing job, all of the metadata for the processing job is lost. You can delete only processing jobs that are in a terminal state (<code>Stopped</code>, <code>Failed</code>, or <code>Completed</code>). You cannot delete a job that is in the <code>InProgress</code> or <code>Stopping</code> state. After deleting the job, you can reuse its name to create another processing job.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { SageMakerClient, DeleteProcessingJobCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
36+
* // const { SageMakerClient, DeleteProcessingJobCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
37+
* // import type { SageMakerClientConfig } from "@aws-sdk/client-sagemaker";
38+
* const config = {}; // type is SageMakerClientConfig
39+
* const client = new SageMakerClient(config);
40+
* const input = { // DeleteProcessingJobRequest
41+
* ProcessingJobName: "STRING_VALUE", // required
42+
* };
43+
* const command = new DeleteProcessingJobCommand(input);
44+
* const response = await client.send(command);
45+
* // {};
46+
*
47+
* ```
48+
*
49+
* @param DeleteProcessingJobCommandInput - {@link DeleteProcessingJobCommandInput}
50+
* @returns {@link DeleteProcessingJobCommandOutput}
51+
* @see {@link DeleteProcessingJobCommandInput} for command's `input` shape.
52+
* @see {@link DeleteProcessingJobCommandOutput} for command's `response` shape.
53+
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
54+
*
55+
* @throws {@link ResourceInUse} (client fault)
56+
* <p>Resource being accessed is in use.</p>
57+
*
58+
* @throws {@link ResourceNotFound} (client fault)
59+
* <p>Resource being access is not found.</p>
60+
*
61+
* @throws {@link SageMakerServiceException}
62+
* <p>Base exception class for all service exceptions from SageMaker service.</p>
63+
*
64+
*
65+
* @public
66+
*/
67+
export class DeleteProcessingJobCommand extends $Command
68+
.classBuilder<
69+
DeleteProcessingJobCommandInput,
70+
DeleteProcessingJobCommandOutput,
71+
SageMakerClientResolvedConfig,
72+
ServiceInputTypes,
73+
ServiceOutputTypes
74+
>()
75+
.ep(commonParams)
76+
.m(function (this: any, Command: any, cs: any, config: SageMakerClientResolvedConfig, o: any) {
77+
return [
78+
getSerdePlugin(config, this.serialize, this.deserialize),
79+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
80+
];
81+
})
82+
.s("SageMaker", "DeleteProcessingJob", {})
83+
.n("SageMakerClient", "DeleteProcessingJobCommand")
84+
.f(void 0, void 0)
85+
.ser(se_DeleteProcessingJobCommand)
86+
.de(de_DeleteProcessingJobCommand)
87+
.build() {
88+
/** @internal type navigation helper, not in runtime. */
89+
protected declare static __types: {
90+
api: {
91+
input: DeleteProcessingJobRequest;
92+
output: {};
93+
};
94+
sdk: {
95+
input: DeleteProcessingJobCommandInput;
96+
output: DeleteProcessingJobCommandOutput;
97+
};
98+
};
99+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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 { DeleteTrainingJobRequest } from "../models/models_2";
9+
import { de_DeleteTrainingJobCommand, se_DeleteTrainingJobCommand } from "../protocols/Aws_json1_1";
10+
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DeleteTrainingJobCommand}.
21+
*/
22+
export interface DeleteTrainingJobCommandInput extends DeleteTrainingJobRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteTrainingJobCommand}.
27+
*/
28+
export interface DeleteTrainingJobCommandOutput extends __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes a training job. After SageMaker deletes a training job, all of the metadata for the training job is lost. You can delete only training jobs that are in a terminal state (<code>Stopped</code>, <code>Failed</code>, or <code>Completed</code>) and don't retain an <code>Available</code> <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-warm-pools.html">managed warm pool</a>. You cannot delete a job that is in the <code>InProgress</code> or <code>Stopping</code> state. After deleting the job, you can reuse its name to create another training job.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { SageMakerClient, DeleteTrainingJobCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
36+
* // const { SageMakerClient, DeleteTrainingJobCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
37+
* // import type { SageMakerClientConfig } from "@aws-sdk/client-sagemaker";
38+
* const config = {}; // type is SageMakerClientConfig
39+
* const client = new SageMakerClient(config);
40+
* const input = { // DeleteTrainingJobRequest
41+
* TrainingJobName: "STRING_VALUE", // required
42+
* };
43+
* const command = new DeleteTrainingJobCommand(input);
44+
* const response = await client.send(command);
45+
* // {};
46+
*
47+
* ```
48+
*
49+
* @param DeleteTrainingJobCommandInput - {@link DeleteTrainingJobCommandInput}
50+
* @returns {@link DeleteTrainingJobCommandOutput}
51+
* @see {@link DeleteTrainingJobCommandInput} for command's `input` shape.
52+
* @see {@link DeleteTrainingJobCommandOutput} for command's `response` shape.
53+
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
54+
*
55+
* @throws {@link ResourceInUse} (client fault)
56+
* <p>Resource being accessed is in use.</p>
57+
*
58+
* @throws {@link ResourceNotFound} (client fault)
59+
* <p>Resource being access is not found.</p>
60+
*
61+
* @throws {@link SageMakerServiceException}
62+
* <p>Base exception class for all service exceptions from SageMaker service.</p>
63+
*
64+
*
65+
* @public
66+
*/
67+
export class DeleteTrainingJobCommand extends $Command
68+
.classBuilder<
69+
DeleteTrainingJobCommandInput,
70+
DeleteTrainingJobCommandOutput,
71+
SageMakerClientResolvedConfig,
72+
ServiceInputTypes,
73+
ServiceOutputTypes
74+
>()
75+
.ep(commonParams)
76+
.m(function (this: any, Command: any, cs: any, config: SageMakerClientResolvedConfig, o: any) {
77+
return [
78+
getSerdePlugin(config, this.serialize, this.deserialize),
79+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
80+
];
81+
})
82+
.s("SageMaker", "DeleteTrainingJob", {})
83+
.n("SageMakerClient", "DeleteTrainingJobCommand")
84+
.f(void 0, void 0)
85+
.ser(se_DeleteTrainingJobCommand)
86+
.de(de_DeleteTrainingJobCommand)
87+
.build() {
88+
/** @internal type navigation helper, not in runtime. */
89+
protected declare static __types: {
90+
api: {
91+
input: DeleteTrainingJobRequest;
92+
output: {};
93+
};
94+
sdk: {
95+
input: DeleteTrainingJobCommandInput;
96+
output: DeleteTrainingJobCommandOutput;
97+
};
98+
};
99+
}

clients/client-sagemaker/src/commands/DescribeClusterEventCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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 { DescribeClusterEventRequest, DescribeClusterEventResponse } from "../models/models_2";
8+
import { DescribeClusterEventRequest, DescribeClusterEventResponse } from "../models/models_3";
99
import { de_DescribeClusterEventCommand, se_DescribeClusterEventCommand } from "../protocols/Aws_json1_1";
1010
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1111

clients/client-sagemaker/src/commands/DescribeHyperParameterTuningJobCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export interface DescribeHyperParameterTuningJobCommandOutput
457457
* // CreationTime: new Date("TIMESTAMP"), // required
458458
* // TrainingStartTime: new Date("TIMESTAMP"),
459459
* // TrainingEndTime: new Date("TIMESTAMP"),
460-
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped", // required
460+
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped" || "Deleting", // required
461461
* // TunedHyperParameters: { // required
462462
* // "<keys>": "STRING_VALUE",
463463
* // },
@@ -477,7 +477,7 @@ export interface DescribeHyperParameterTuningJobCommandOutput
477477
* // CreationTime: new Date("TIMESTAMP"), // required
478478
* // TrainingStartTime: new Date("TIMESTAMP"),
479479
* // TrainingEndTime: new Date("TIMESTAMP"),
480-
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped", // required
480+
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped" || "Deleting", // required
481481
* // TunedHyperParameters: { // required
482482
* // "<keys>": "STRING_VALUE",
483483
* // },

clients/client-sagemaker/src/commands/DescribeTrainingJobCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface DescribeTrainingJobCommandOutput extends DescribeTrainingJobRes
5151
* // ModelArtifacts: { // ModelArtifacts
5252
* // S3ModelArtifacts: "STRING_VALUE", // required
5353
* // },
54-
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped", // required
54+
* // TrainingJobStatus: "InProgress" || "Completed" || "Failed" || "Stopping" || "Stopped" || "Deleting", // required
5555
* // SecondaryStatus: "Starting" || "LaunchingMLInstances" || "PreparingTrainingStack" || "Downloading" || "DownloadingTrainingImage" || "Training" || "Uploading" || "Stopping" || "Stopped" || "MaxRuntimeExceeded" || "Completed" || "Failed" || "Interrupted" || "MaxWaitTimeExceeded" || "Updating" || "Restarting" || "Pending", // required
5656
* // FailureReason: "STRING_VALUE",
5757
* // HyperParameters: { // HyperParameters

0 commit comments

Comments
 (0)