|
| 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 | +} |
0 commit comments