Skip to content

Commit 9875d03

Browse files
author
awstools
committed
feat(client-emr): This release introduces a new Amazon EMR EPI called ListSupportedInstanceTypes that returns a list of all instance types supported by a given EMR release.
1 parent 20391b1 commit 9875d03

File tree

10 files changed

+645
-5
lines changed

10 files changed

+645
-5
lines changed

clients/client-emr/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@ ListStudioSessionMappings
476476

477477
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/classes/liststudiosessionmappingscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/interfaces/liststudiosessionmappingscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/interfaces/liststudiosessionmappingscommandoutput.html)
478478

479+
</details>
480+
<details>
481+
<summary>
482+
ListSupportedInstanceTypes
483+
</summary>
484+
485+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/classes/listsupportedinstancetypescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/interfaces/listsupportedinstancetypescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-emr/interfaces/listsupportedinstancetypescommandoutput.html)
486+
479487
</details>
480488
<details>
481489
<summary>

clients/client-emr/src/EMR.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ import {
156156
ListStudioSessionMappingsCommandInput,
157157
ListStudioSessionMappingsCommandOutput,
158158
} from "./commands/ListStudioSessionMappingsCommand";
159+
import {
160+
ListSupportedInstanceTypesCommand,
161+
ListSupportedInstanceTypesCommandInput,
162+
ListSupportedInstanceTypesCommandOutput,
163+
} from "./commands/ListSupportedInstanceTypesCommand";
159164
import {
160165
ModifyClusterCommand,
161166
ModifyClusterCommandInput,
@@ -280,6 +285,7 @@ const commands = {
280285
ListStepsCommand,
281286
ListStudiosCommand,
282287
ListStudioSessionMappingsCommand,
288+
ListSupportedInstanceTypesCommand,
283289
ModifyClusterCommand,
284290
ModifyInstanceFleetCommand,
285291
ModifyInstanceGroupsCommand,
@@ -817,6 +823,23 @@ export interface EMR {
817823
cb: (err: any, data?: ListStudioSessionMappingsCommandOutput) => void
818824
): void;
819825

826+
/**
827+
* @see {@link ListSupportedInstanceTypesCommand}
828+
*/
829+
listSupportedInstanceTypes(
830+
args: ListSupportedInstanceTypesCommandInput,
831+
options?: __HttpHandlerOptions
832+
): Promise<ListSupportedInstanceTypesCommandOutput>;
833+
listSupportedInstanceTypes(
834+
args: ListSupportedInstanceTypesCommandInput,
835+
cb: (err: any, data?: ListSupportedInstanceTypesCommandOutput) => void
836+
): void;
837+
listSupportedInstanceTypes(
838+
args: ListSupportedInstanceTypesCommandInput,
839+
options: __HttpHandlerOptions,
840+
cb: (err: any, data?: ListSupportedInstanceTypesCommandOutput) => void
841+
): void;
842+
820843
/**
821844
* @see {@link ModifyClusterCommand}
822845
*/

clients/client-emr/src/EMRClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ import {
133133
ListStudioSessionMappingsCommandInput,
134134
ListStudioSessionMappingsCommandOutput,
135135
} from "./commands/ListStudioSessionMappingsCommand";
136+
import {
137+
ListSupportedInstanceTypesCommandInput,
138+
ListSupportedInstanceTypesCommandOutput,
139+
} from "./commands/ListSupportedInstanceTypesCommand";
136140
import { ModifyClusterCommandInput, ModifyClusterCommandOutput } from "./commands/ModifyClusterCommand";
137141
import {
138142
ModifyInstanceFleetCommandInput,
@@ -242,6 +246,7 @@ export type ServiceInputTypes =
242246
| ListStepsCommandInput
243247
| ListStudioSessionMappingsCommandInput
244248
| ListStudiosCommandInput
249+
| ListSupportedInstanceTypesCommandInput
245250
| ModifyClusterCommandInput
246251
| ModifyInstanceFleetCommandInput
247252
| ModifyInstanceGroupsCommandInput
@@ -300,6 +305,7 @@ export type ServiceOutputTypes =
300305
| ListStepsCommandOutput
301306
| ListStudioSessionMappingsCommandOutput
302307
| ListStudiosCommandOutput
308+
| ListSupportedInstanceTypesCommandOutput
303309
| ModifyClusterCommandOutput
304310
| ModifyInstanceFleetCommandOutput
305311
| ModifyInstanceGroupsCommandOutput
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
} from "@aws-sdk/types";
13+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
14+
import { SerdeContext as __SerdeContext } from "@smithy/types";
15+
16+
import { EMRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EMRClient";
17+
import { ListSupportedInstanceTypesInput, ListSupportedInstanceTypesOutput } from "../models/models_0";
18+
import { de_ListSupportedInstanceTypesCommand, se_ListSupportedInstanceTypesCommand } from "../protocols/Aws_json1_1";
19+
20+
/**
21+
* @public
22+
*/
23+
export { __MetadataBearer, $Command };
24+
/**
25+
* @public
26+
*
27+
* The input for {@link ListSupportedInstanceTypesCommand}.
28+
*/
29+
export interface ListSupportedInstanceTypesCommandInput extends ListSupportedInstanceTypesInput {}
30+
/**
31+
* @public
32+
*
33+
* The output of {@link ListSupportedInstanceTypesCommand}.
34+
*/
35+
export interface ListSupportedInstanceTypesCommandOutput extends ListSupportedInstanceTypesOutput, __MetadataBearer {}
36+
37+
/**
38+
* @public
39+
* <p>A list of the instance types that Amazon EMR supports. You can filter the
40+
* list by Amazon Web Services Region and Amazon EMR release. </p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { EMRClient, ListSupportedInstanceTypesCommand } from "@aws-sdk/client-emr"; // ES Modules import
45+
* // const { EMRClient, ListSupportedInstanceTypesCommand } = require("@aws-sdk/client-emr"); // CommonJS import
46+
* const client = new EMRClient(config);
47+
* const input = { // ListSupportedInstanceTypesInput
48+
* ReleaseLabel: "STRING_VALUE", // required
49+
* Marker: "STRING_VALUE",
50+
* };
51+
* const command = new ListSupportedInstanceTypesCommand(input);
52+
* const response = await client.send(command);
53+
* // { // ListSupportedInstanceTypesOutput
54+
* // SupportedInstanceTypes: [ // SupportedInstanceTypesList
55+
* // { // SupportedInstanceType
56+
* // Type: "STRING_VALUE",
57+
* // MemoryGB: Number("float"),
58+
* // StorageGB: Number("int"),
59+
* // VCPU: Number("int"),
60+
* // Is64BitsOnly: true || false,
61+
* // InstanceFamilyId: "STRING_VALUE",
62+
* // EbsOptimizedAvailable: true || false,
63+
* // EbsOptimizedByDefault: true || false,
64+
* // NumberOfDisks: Number("int"),
65+
* // EbsStorageOnly: true || false,
66+
* // Architecture: "STRING_VALUE",
67+
* // },
68+
* // ],
69+
* // Marker: "STRING_VALUE",
70+
* // };
71+
*
72+
* ```
73+
*
74+
* @param ListSupportedInstanceTypesCommandInput - {@link ListSupportedInstanceTypesCommandInput}
75+
* @returns {@link ListSupportedInstanceTypesCommandOutput}
76+
* @see {@link ListSupportedInstanceTypesCommandInput} for command's `input` shape.
77+
* @see {@link ListSupportedInstanceTypesCommandOutput} for command's `response` shape.
78+
* @see {@link EMRClientResolvedConfig | config} for EMRClient's `config` shape.
79+
*
80+
* @throws {@link InternalServerException} (server fault)
81+
* <p>This exception occurs when there is an internal failure in the Amazon EMR
82+
* service.</p>
83+
*
84+
* @throws {@link InvalidRequestException} (client fault)
85+
* <p>This exception occurs when there is something wrong with user input.</p>
86+
*
87+
* @throws {@link EMRServiceException}
88+
* <p>Base exception class for all service exceptions from EMR service.</p>
89+
*
90+
*/
91+
export class ListSupportedInstanceTypesCommand extends $Command<
92+
ListSupportedInstanceTypesCommandInput,
93+
ListSupportedInstanceTypesCommandOutput,
94+
EMRClientResolvedConfig
95+
> {
96+
// Start section: command_properties
97+
// End section: command_properties
98+
99+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
100+
return {
101+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
102+
Endpoint: { type: "builtInParams", name: "endpoint" },
103+
Region: { type: "builtInParams", name: "region" },
104+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
105+
};
106+
}
107+
108+
/**
109+
* @public
110+
*/
111+
constructor(readonly input: ListSupportedInstanceTypesCommandInput) {
112+
// Start section: command_constructor
113+
super();
114+
// End section: command_constructor
115+
}
116+
117+
/**
118+
* @internal
119+
*/
120+
resolveMiddleware(
121+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
122+
configuration: EMRClientResolvedConfig,
123+
options?: __HttpHandlerOptions
124+
): Handler<ListSupportedInstanceTypesCommandInput, ListSupportedInstanceTypesCommandOutput> {
125+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
126+
this.middlewareStack.use(
127+
getEndpointPlugin(configuration, ListSupportedInstanceTypesCommand.getEndpointParameterInstructions())
128+
);
129+
130+
const stack = clientStack.concat(this.middlewareStack);
131+
132+
const { logger } = configuration;
133+
const clientName = "EMRClient";
134+
const commandName = "ListSupportedInstanceTypesCommand";
135+
const handlerExecutionContext: HandlerExecutionContext = {
136+
logger,
137+
clientName,
138+
commandName,
139+
inputFilterSensitiveLog: (_: any) => _,
140+
outputFilterSensitiveLog: (_: any) => _,
141+
};
142+
const { requestHandler } = configuration;
143+
return stack.resolve(
144+
(request: FinalizeHandlerArguments<any>) =>
145+
requestHandler.handle(request.request as __HttpRequest, options || {}),
146+
handlerExecutionContext
147+
);
148+
}
149+
150+
/**
151+
* @internal
152+
*/
153+
private serialize(input: ListSupportedInstanceTypesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
154+
return se_ListSupportedInstanceTypesCommand(input, context);
155+
}
156+
157+
/**
158+
* @internal
159+
*/
160+
private deserialize(
161+
output: __HttpResponse,
162+
context: __SerdeContext
163+
): Promise<ListSupportedInstanceTypesCommandOutput> {
164+
return de_ListSupportedInstanceTypesCommand(output, context);
165+
}
166+
167+
// Start section: command_body_extra
168+
// End section: command_body_extra
169+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export * from "./ListSecurityConfigurationsCommand";
3333
export * from "./ListStepsCommand";
3434
export * from "./ListStudioSessionMappingsCommand";
3535
export * from "./ListStudiosCommand";
36+
export * from "./ListSupportedInstanceTypesCommand";
3637
export * from "./ModifyClusterCommand";
3738
export * from "./ModifyInstanceFleetCommand";
3839
export * from "./ModifyInstanceGroupsCommand";

clients/client-emr/src/models/models_0.ts

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@ export interface SpotProvisioningSpecification {
300300
BlockDurationMinutes?: number;
301301

302302
/**
303-
* <p>Specifies one of the following strategies to launch Spot Instance fleets: <code>price-capacity-optimized</code>, <code>capacity-optimized</code>, <code>lowest-price</code>, or <code>diversified</code>. For more information on the provisioning strategies, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html">Allocation strategies for Spot Instances</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p>
304-
* <note>
305-
* <p>When you launch a Spot Instance fleet with the old console, it automatically launches with the <code>capacity-optimized</code> strategy. You can't change the allocation strategy from the old console.</p>
306-
* </note>
303+
* <p> Specifies the strategy to use in launching Spot Instance fleets. Currently, the only
304+
* option is capacity-optimized (the default), which launches instances from Spot Instance
305+
* pools with optimal capacity for the number of instances that are launching. </p>
307306
*/
308307
AllocationStrategy?: SpotProvisioningAllocationStrategy | string;
309308
}
@@ -4725,6 +4724,115 @@ export interface ListStudioSessionMappingsOutput {
47254724
Marker?: string;
47264725
}
47274726

4727+
/**
4728+
* @public
4729+
*/
4730+
export interface ListSupportedInstanceTypesInput {
4731+
/**
4732+
* <p>The Amazon EMR release label determines the <a href="https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-release-app-versions-6.x.html">versions of open-source
4733+
* application packages</a> that Amazon EMR has installed on the cluster.
4734+
* Release labels are in the format <code>emr-x.x.x</code>, where x.x.x is an Amazon EMR release number such as <code>emr-6.10.0</code>. For more information about Amazon EMR releases and their included application versions and features, see the
4735+
* <i>
4736+
* <a href="https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-release-components.html">Amazon EMR Release
4737+
* Guide</a>
4738+
* </i>.</p>
4739+
*/
4740+
ReleaseLabel: string | undefined;
4741+
4742+
/**
4743+
* <p>The pagination token that marks the next set of results to retrieve.</p>
4744+
*/
4745+
Marker?: string;
4746+
}
4747+
4748+
/**
4749+
* @public
4750+
* <p>An instance type that the specified Amazon EMR release supports.</p>
4751+
*/
4752+
export interface SupportedInstanceType {
4753+
/**
4754+
* <p>The <a href="http://aws.amazon.com/ec2/instance-types/">Amazon EC2 instance
4755+
* type</a>, for example <code>m5.xlarge</code>, of the
4756+
* <code>SupportedInstanceType</code>.</p>
4757+
*/
4758+
Type?: string;
4759+
4760+
/**
4761+
* <p>The amount of memory that is available to Amazon EMR from the <code>SupportedInstanceType</code>. The kernel and hypervisor
4762+
* software consume some memory, so this value might be lower than the overall memory for the
4763+
* instance type.</p>
4764+
*/
4765+
MemoryGB?: number;
4766+
4767+
/**
4768+
* <p>
4769+
* <code>StorageGB</code> represents the storage capacity of the
4770+
* <code>SupportedInstanceType</code>. This value is <code>0</code> for Amazon EBS-only instance types.</p>
4771+
*/
4772+
StorageGB?: number;
4773+
4774+
/**
4775+
* <p>The number of vCPUs available for the <code>SupportedInstanceType</code>.</p>
4776+
*/
4777+
VCPU?: number;
4778+
4779+
/**
4780+
* <p>Indicates whether the <code>SupportedInstanceType</code> only supports 64-bit
4781+
* architecture.</p>
4782+
*/
4783+
Is64BitsOnly?: boolean;
4784+
4785+
/**
4786+
* <p>The Amazon EC2 family and generation for the
4787+
* <code>SupportedInstanceType</code>.</p>
4788+
*/
4789+
InstanceFamilyId?: string;
4790+
4791+
/**
4792+
* <p>Indicates whether the <code>SupportedInstanceType</code> supports Amazon EBS
4793+
* optimization.</p>
4794+
*/
4795+
EbsOptimizedAvailable?: boolean;
4796+
4797+
/**
4798+
* <p>Indicates whether the <code>SupportedInstanceType</code> uses Amazon EBS
4799+
* optimization by default.</p>
4800+
*/
4801+
EbsOptimizedByDefault?: boolean;
4802+
4803+
/**
4804+
* <p>Number of disks for the <code>SupportedInstanceType</code>. This value is <code>0</code>
4805+
* for Amazon EBS-only instance types.</p>
4806+
*/
4807+
NumberOfDisks?: number;
4808+
4809+
/**
4810+
* <p>Indicates whether the <code>SupportedInstanceType</code> only supports Amazon EBS.</p>
4811+
*/
4812+
EbsStorageOnly?: boolean;
4813+
4814+
/**
4815+
* <p>The CPU architecture, for example <code>X86_64</code> or <code>AARCH64</code>.</p>
4816+
*/
4817+
Architecture?: string;
4818+
}
4819+
4820+
/**
4821+
* @public
4822+
*/
4823+
export interface ListSupportedInstanceTypesOutput {
4824+
/**
4825+
* <p>The list of instance types that the release specified in
4826+
* <code>ListSupportedInstanceTypesInput$ReleaseLabel</code> supports, filtered by Amazon Web Services Region.</p>
4827+
*/
4828+
SupportedInstanceTypes?: SupportedInstanceType[];
4829+
4830+
/**
4831+
* <p>The pagination token that marks the next set of results to retrieve.</p>
4832+
*/
4833+
Marker?: string;
4834+
}
4835+
47284836
/**
47294837
* @public
47304838
*/

0 commit comments

Comments
 (0)