Skip to content

Commit 54b8be8

Browse files
author
awstools
committed
feat(client-sagemaker): SageMaker Inference Recommender introduces a new API GetScalingConfigurationRecommendation to recommend auto scaling policies based on completed Inference Recommender jobs.
1 parent e4fee3f commit 54b8be8

19 files changed

+61378
-60322
lines changed

clients/client-sagemaker/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,14 @@ GetSagemakerServicecatalogPortfolioStatus
15691569

15701570
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/classes/getsagemakerservicecatalogportfoliostatuscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/getsagemakerservicecatalogportfoliostatuscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/getsagemakerservicecatalogportfoliostatuscommandoutput.html)
15711571

1572+
</details>
1573+
<details>
1574+
<summary>
1575+
GetScalingConfigurationRecommendation
1576+
</summary>
1577+
1578+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/classes/getscalingconfigurationrecommendationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/getscalingconfigurationrecommendationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker/interfaces/getscalingconfigurationrecommendationcommandoutput.html)
1579+
15721580
</details>
15731581
<details>
15741582
<summary>

clients/client-sagemaker/src/SageMaker.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,11 @@ import {
783783
GetSagemakerServicecatalogPortfolioStatusCommandInput,
784784
GetSagemakerServicecatalogPortfolioStatusCommandOutput,
785785
} from "./commands/GetSagemakerServicecatalogPortfolioStatusCommand";
786+
import {
787+
GetScalingConfigurationRecommendationCommand,
788+
GetScalingConfigurationRecommendationCommandInput,
789+
GetScalingConfigurationRecommendationCommandOutput,
790+
} from "./commands/GetScalingConfigurationRecommendationCommand";
786791
import {
787792
GetSearchSuggestionsCommand,
788793
GetSearchSuggestionsCommandInput,
@@ -1561,6 +1566,7 @@ const commands = {
15611566
GetLineageGroupPolicyCommand,
15621567
GetModelPackageGroupPolicyCommand,
15631568
GetSagemakerServicecatalogPortfolioStatusCommand,
1569+
GetScalingConfigurationRecommendationCommand,
15641570
GetSearchSuggestionsCommand,
15651571
ImportHubContentCommand,
15661572
ListActionsCommand,
@@ -4340,6 +4346,23 @@ export interface SageMaker {
43404346
cb: (err: any, data?: GetSagemakerServicecatalogPortfolioStatusCommandOutput) => void
43414347
): void;
43424348

4349+
/**
4350+
* @see {@link GetScalingConfigurationRecommendationCommand}
4351+
*/
4352+
getScalingConfigurationRecommendation(
4353+
args: GetScalingConfigurationRecommendationCommandInput,
4354+
options?: __HttpHandlerOptions
4355+
): Promise<GetScalingConfigurationRecommendationCommandOutput>;
4356+
getScalingConfigurationRecommendation(
4357+
args: GetScalingConfigurationRecommendationCommandInput,
4358+
cb: (err: any, data?: GetScalingConfigurationRecommendationCommandOutput) => void
4359+
): void;
4360+
getScalingConfigurationRecommendation(
4361+
args: GetScalingConfigurationRecommendationCommandInput,
4362+
options: __HttpHandlerOptions,
4363+
cb: (err: any, data?: GetScalingConfigurationRecommendationCommandOutput) => void
4364+
): void;
4365+
43434366
/**
43444367
* @see {@link GetSearchSuggestionsCommand}
43454368
*/

clients/client-sagemaker/src/SageMakerClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ import {
485485
GetSagemakerServicecatalogPortfolioStatusCommandInput,
486486
GetSagemakerServicecatalogPortfolioStatusCommandOutput,
487487
} from "./commands/GetSagemakerServicecatalogPortfolioStatusCommand";
488+
import {
489+
GetScalingConfigurationRecommendationCommandInput,
490+
GetScalingConfigurationRecommendationCommandOutput,
491+
} from "./commands/GetScalingConfigurationRecommendationCommand";
488492
import {
489493
GetSearchSuggestionsCommandInput,
490494
GetSearchSuggestionsCommandOutput,
@@ -994,6 +998,7 @@ export type ServiceInputTypes =
994998
| GetLineageGroupPolicyCommandInput
995999
| GetModelPackageGroupPolicyCommandInput
9961000
| GetSagemakerServicecatalogPortfolioStatusCommandInput
1001+
| GetScalingConfigurationRecommendationCommandInput
9971002
| GetSearchSuggestionsCommandInput
9981003
| ImportHubContentCommandInput
9991004
| ListActionsCommandInput
@@ -1302,6 +1307,7 @@ export type ServiceOutputTypes =
13021307
| GetLineageGroupPolicyCommandOutput
13031308
| GetModelPackageGroupPolicyCommandOutput
13041309
| GetSagemakerServicecatalogPortfolioStatusCommandOutput
1310+
| GetScalingConfigurationRecommendationCommandOutput
13051311
| GetSearchSuggestionsCommandOutput
13061312
| ImportHubContentCommandOutput
13071313
| ListActionsCommandOutput

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { DeleteFlowDefinitionRequest, DeleteFlowDefinitionResponse } from "../models/models_1";
16+
import { DeleteFlowDefinitionRequest, DeleteFlowDefinitionResponse } from "../models/models_2";
1717
import { de_DeleteFlowDefinitionCommand, se_DeleteFlowDefinitionCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { GetDeviceFleetReportRequest, GetDeviceFleetReportResponse } from "../models/models_2";
16+
import { GetDeviceFleetReportRequest, GetDeviceFleetReportResponse } from "../models/models_3";
1717
import { de_GetDeviceFleetReportCommand, se_GetDeviceFleetReportCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { GetLineageGroupPolicyRequest, GetLineageGroupPolicyResponse } from "../models/models_2";
16+
import { GetLineageGroupPolicyRequest, GetLineageGroupPolicyResponse } from "../models/models_3";
1717
import { de_GetLineageGroupPolicyCommand, se_GetLineageGroupPolicyCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { GetModelPackageGroupPolicyInput, GetModelPackageGroupPolicyOutput } from "../models/models_2";
16+
import { GetModelPackageGroupPolicyInput, GetModelPackageGroupPolicyOutput } from "../models/models_3";
1717
import { de_GetModelPackageGroupPolicyCommand, se_GetModelPackageGroupPolicyCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@smithy/types";
15+
16+
import {
17+
GetScalingConfigurationRecommendationRequest,
18+
GetScalingConfigurationRecommendationResponse,
19+
} from "../models/models_3";
20+
import {
21+
de_GetScalingConfigurationRecommendationCommand,
22+
se_GetScalingConfigurationRecommendationCommand,
23+
} from "../protocols/Aws_json1_1";
24+
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
25+
26+
/**
27+
* @public
28+
*/
29+
export { __MetadataBearer, $Command };
30+
/**
31+
* @public
32+
*
33+
* The input for {@link GetScalingConfigurationRecommendationCommand}.
34+
*/
35+
export interface GetScalingConfigurationRecommendationCommandInput
36+
extends GetScalingConfigurationRecommendationRequest {}
37+
/**
38+
* @public
39+
*
40+
* The output of {@link GetScalingConfigurationRecommendationCommand}.
41+
*/
42+
export interface GetScalingConfigurationRecommendationCommandOutput
43+
extends GetScalingConfigurationRecommendationResponse,
44+
__MetadataBearer {}
45+
46+
/**
47+
* @public
48+
* <p>Starts an Amazon SageMaker Inference Recommender autoscaling recommendation job. Returns recommendations for autoscaling policies
49+
* that you can apply to your SageMaker endpoint.</p>
50+
* @example
51+
* Use a bare-bones client and the command you need to make an API call.
52+
* ```javascript
53+
* import { SageMakerClient, GetScalingConfigurationRecommendationCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
54+
* // const { SageMakerClient, GetScalingConfigurationRecommendationCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
55+
* const client = new SageMakerClient(config);
56+
* const input = { // GetScalingConfigurationRecommendationRequest
57+
* InferenceRecommendationsJobName: "STRING_VALUE", // required
58+
* RecommendationId: "STRING_VALUE",
59+
* EndpointName: "STRING_VALUE",
60+
* TargetCpuUtilizationPerCore: Number("int"),
61+
* ScalingPolicyObjective: { // ScalingPolicyObjective
62+
* MinInvocationsPerMinute: Number("int"),
63+
* MaxInvocationsPerMinute: Number("int"),
64+
* },
65+
* };
66+
* const command = new GetScalingConfigurationRecommendationCommand(input);
67+
* const response = await client.send(command);
68+
* // { // GetScalingConfigurationRecommendationResponse
69+
* // InferenceRecommendationsJobName: "STRING_VALUE",
70+
* // RecommendationId: "STRING_VALUE",
71+
* // EndpointName: "STRING_VALUE",
72+
* // TargetCpuUtilizationPerCore: Number("int"),
73+
* // ScalingPolicyObjective: { // ScalingPolicyObjective
74+
* // MinInvocationsPerMinute: Number("int"),
75+
* // MaxInvocationsPerMinute: Number("int"),
76+
* // },
77+
* // Metric: { // ScalingPolicyMetric
78+
* // InvocationsPerInstance: Number("int"),
79+
* // ModelLatency: Number("int"),
80+
* // },
81+
* // DynamicScalingConfiguration: { // DynamicScalingConfiguration
82+
* // MinCapacity: Number("int"),
83+
* // MaxCapacity: Number("int"),
84+
* // ScaleInCooldown: Number("int"),
85+
* // ScaleOutCooldown: Number("int"),
86+
* // ScalingPolicies: [ // ScalingPolicies
87+
* // { // ScalingPolicy Union: only one key present
88+
* // TargetTracking: { // TargetTrackingScalingPolicyConfiguration
89+
* // MetricSpecification: { // MetricSpecification Union: only one key present
90+
* // Predefined: { // PredefinedMetricSpecification
91+
* // PredefinedMetricType: "STRING_VALUE",
92+
* // },
93+
* // Customized: { // CustomizedMetricSpecification
94+
* // MetricName: "STRING_VALUE",
95+
* // Namespace: "STRING_VALUE",
96+
* // Statistic: "Average" || "Minimum" || "Maximum" || "SampleCount" || "Sum",
97+
* // },
98+
* // },
99+
* // TargetValue: Number("double"),
100+
* // },
101+
* // },
102+
* // ],
103+
* // },
104+
* // };
105+
*
106+
* ```
107+
*
108+
* @param GetScalingConfigurationRecommendationCommandInput - {@link GetScalingConfigurationRecommendationCommandInput}
109+
* @returns {@link GetScalingConfigurationRecommendationCommandOutput}
110+
* @see {@link GetScalingConfigurationRecommendationCommandInput} for command's `input` shape.
111+
* @see {@link GetScalingConfigurationRecommendationCommandOutput} for command's `response` shape.
112+
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
113+
*
114+
* @throws {@link ResourceNotFound} (client fault)
115+
* <p>Resource being access is not found.</p>
116+
*
117+
* @throws {@link SageMakerServiceException}
118+
* <p>Base exception class for all service exceptions from SageMaker service.</p>
119+
*
120+
*/
121+
export class GetScalingConfigurationRecommendationCommand extends $Command<
122+
GetScalingConfigurationRecommendationCommandInput,
123+
GetScalingConfigurationRecommendationCommandOutput,
124+
SageMakerClientResolvedConfig
125+
> {
126+
// Start section: command_properties
127+
// End section: command_properties
128+
129+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
130+
return {
131+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
132+
Endpoint: { type: "builtInParams", name: "endpoint" },
133+
Region: { type: "builtInParams", name: "region" },
134+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
135+
};
136+
}
137+
138+
/**
139+
* @public
140+
*/
141+
constructor(readonly input: GetScalingConfigurationRecommendationCommandInput) {
142+
// Start section: command_constructor
143+
super();
144+
// End section: command_constructor
145+
}
146+
147+
/**
148+
* @internal
149+
*/
150+
resolveMiddleware(
151+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
152+
configuration: SageMakerClientResolvedConfig,
153+
options?: __HttpHandlerOptions
154+
): Handler<GetScalingConfigurationRecommendationCommandInput, GetScalingConfigurationRecommendationCommandOutput> {
155+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
156+
this.middlewareStack.use(
157+
getEndpointPlugin(configuration, GetScalingConfigurationRecommendationCommand.getEndpointParameterInstructions())
158+
);
159+
160+
const stack = clientStack.concat(this.middlewareStack);
161+
162+
const { logger } = configuration;
163+
const clientName = "SageMakerClient";
164+
const commandName = "GetScalingConfigurationRecommendationCommand";
165+
const handlerExecutionContext: HandlerExecutionContext = {
166+
logger,
167+
clientName,
168+
commandName,
169+
inputFilterSensitiveLog: (_: any) => _,
170+
outputFilterSensitiveLog: (_: any) => _,
171+
};
172+
const { requestHandler } = configuration;
173+
return stack.resolve(
174+
(request: FinalizeHandlerArguments<any>) =>
175+
requestHandler.handle(request.request as __HttpRequest, options || {}),
176+
handlerExecutionContext
177+
);
178+
}
179+
180+
/**
181+
* @internal
182+
*/
183+
private serialize(
184+
input: GetScalingConfigurationRecommendationCommandInput,
185+
context: __SerdeContext
186+
): Promise<__HttpRequest> {
187+
return se_GetScalingConfigurationRecommendationCommand(input, context);
188+
}
189+
190+
/**
191+
* @internal
192+
*/
193+
private deserialize(
194+
output: __HttpResponse,
195+
context: __SerdeContext
196+
): Promise<GetScalingConfigurationRecommendationCommandOutput> {
197+
return de_GetScalingConfigurationRecommendationCommand(output, context);
198+
}
199+
200+
// Start section: command_body_extra
201+
// End section: command_body_extra
202+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { PutModelPackageGroupPolicyInput, PutModelPackageGroupPolicyOutput } from "../models/models_3";
16+
import { PutModelPackageGroupPolicyInput, PutModelPackageGroupPolicyOutput } from "../models/models_4";
1717
import { de_PutModelPackageGroupPolicyCommand, se_PutModelPackageGroupPolicyCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { QueryLineageRequest, QueryLineageResponse } from "../models/models_3";
16+
import { QueryLineageRequest, QueryLineageResponse } from "../models/models_4";
1717
import { de_QueryLineageCommand, se_QueryLineageCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { RegisterDevicesRequest } from "../models/models_3";
16+
import { RegisterDevicesRequest } from "../models/models_4";
1717
import { de_RegisterDevicesCommand, se_RegisterDevicesCommand } from "../protocols/Aws_json1_1";
1818
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
1919

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
SerdeContext as __SerdeContext,
1414
} from "@smithy/types";
1515

16-
import { RenderUiTemplateRequest } from "../models/models_3";
17-
import { RenderUiTemplateResponse } from "../models/models_4";
16+
import { RenderUiTemplateRequest, RenderUiTemplateResponse } from "../models/models_4";
1817
import { de_RenderUiTemplateCommand, se_RenderUiTemplateCommand } from "../protocols/Aws_json1_1";
1918
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
2019

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export * from "./GetDeviceFleetReportCommand";
168168
export * from "./GetLineageGroupPolicyCommand";
169169
export * from "./GetModelPackageGroupPolicyCommand";
170170
export * from "./GetSagemakerServicecatalogPortfolioStatusCommand";
171+
export * from "./GetScalingConfigurationRecommendationCommand";
171172
export * from "./GetSearchSuggestionsCommand";
172173
export * from "./ImportHubContentCommand";
173174
export * from "./ListActionsCommand";

0 commit comments

Comments
 (0)