Skip to content

Commit

Permalink
feat(client-emr): This release introduces a new Amazon EMR EPI called…
Browse files Browse the repository at this point in the history
… ListSupportedInstanceTypes that returns a list of all instance types supported by a given EMR release.
  • Loading branch information
awstools committed Jun 21, 2023
1 parent 20391b1 commit 9875d03
Show file tree
Hide file tree
Showing 10 changed files with 645 additions and 5 deletions.
8 changes: 8 additions & 0 deletions clients/client-emr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,14 @@ ListStudioSessionMappings

[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)

</details>
<details>
<summary>
ListSupportedInstanceTypes
</summary>

[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)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-emr/src/EMR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ import {
ListStudioSessionMappingsCommandInput,
ListStudioSessionMappingsCommandOutput,
} from "./commands/ListStudioSessionMappingsCommand";
import {
ListSupportedInstanceTypesCommand,
ListSupportedInstanceTypesCommandInput,
ListSupportedInstanceTypesCommandOutput,
} from "./commands/ListSupportedInstanceTypesCommand";
import {
ModifyClusterCommand,
ModifyClusterCommandInput,
Expand Down Expand Up @@ -280,6 +285,7 @@ const commands = {
ListStepsCommand,
ListStudiosCommand,
ListStudioSessionMappingsCommand,
ListSupportedInstanceTypesCommand,
ModifyClusterCommand,
ModifyInstanceFleetCommand,
ModifyInstanceGroupsCommand,
Expand Down Expand Up @@ -817,6 +823,23 @@ export interface EMR {
cb: (err: any, data?: ListStudioSessionMappingsCommandOutput) => void
): void;

/**
* @see {@link ListSupportedInstanceTypesCommand}
*/
listSupportedInstanceTypes(
args: ListSupportedInstanceTypesCommandInput,
options?: __HttpHandlerOptions
): Promise<ListSupportedInstanceTypesCommandOutput>;
listSupportedInstanceTypes(
args: ListSupportedInstanceTypesCommandInput,
cb: (err: any, data?: ListSupportedInstanceTypesCommandOutput) => void
): void;
listSupportedInstanceTypes(
args: ListSupportedInstanceTypesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListSupportedInstanceTypesCommandOutput) => void
): void;

/**
* @see {@link ModifyClusterCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-emr/src/EMRClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ import {
ListStudioSessionMappingsCommandInput,
ListStudioSessionMappingsCommandOutput,
} from "./commands/ListStudioSessionMappingsCommand";
import {
ListSupportedInstanceTypesCommandInput,
ListSupportedInstanceTypesCommandOutput,
} from "./commands/ListSupportedInstanceTypesCommand";
import { ModifyClusterCommandInput, ModifyClusterCommandOutput } from "./commands/ModifyClusterCommand";
import {
ModifyInstanceFleetCommandInput,
Expand Down Expand Up @@ -242,6 +246,7 @@ export type ServiceInputTypes =
| ListStepsCommandInput
| ListStudioSessionMappingsCommandInput
| ListStudiosCommandInput
| ListSupportedInstanceTypesCommandInput
| ModifyClusterCommandInput
| ModifyInstanceFleetCommandInput
| ModifyInstanceGroupsCommandInput
Expand Down Expand Up @@ -300,6 +305,7 @@ export type ServiceOutputTypes =
| ListStepsCommandOutput
| ListStudioSessionMappingsCommandOutput
| ListStudiosCommandOutput
| ListSupportedInstanceTypesCommandOutput
| ModifyClusterCommandOutput
| ModifyInstanceFleetCommandOutput
| ModifyInstanceGroupsCommandOutput
Expand Down
169 changes: 169 additions & 0 deletions clients/client-emr/src/commands/ListSupportedInstanceTypesCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
} from "@aws-sdk/types";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { EMRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EMRClient";
import { ListSupportedInstanceTypesInput, ListSupportedInstanceTypesOutput } from "../models/models_0";
import { de_ListSupportedInstanceTypesCommand, se_ListSupportedInstanceTypesCommand } from "../protocols/Aws_json1_1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link ListSupportedInstanceTypesCommand}.
*/
export interface ListSupportedInstanceTypesCommandInput extends ListSupportedInstanceTypesInput {}
/**
* @public
*
* The output of {@link ListSupportedInstanceTypesCommand}.
*/
export interface ListSupportedInstanceTypesCommandOutput extends ListSupportedInstanceTypesOutput, __MetadataBearer {}

/**
* @public
* <p>A list of the instance types that Amazon EMR supports. You can filter the
* list by Amazon Web Services Region and Amazon EMR release. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { EMRClient, ListSupportedInstanceTypesCommand } from "@aws-sdk/client-emr"; // ES Modules import
* // const { EMRClient, ListSupportedInstanceTypesCommand } = require("@aws-sdk/client-emr"); // CommonJS import
* const client = new EMRClient(config);
* const input = { // ListSupportedInstanceTypesInput
* ReleaseLabel: "STRING_VALUE", // required
* Marker: "STRING_VALUE",
* };
* const command = new ListSupportedInstanceTypesCommand(input);
* const response = await client.send(command);
* // { // ListSupportedInstanceTypesOutput
* // SupportedInstanceTypes: [ // SupportedInstanceTypesList
* // { // SupportedInstanceType
* // Type: "STRING_VALUE",
* // MemoryGB: Number("float"),
* // StorageGB: Number("int"),
* // VCPU: Number("int"),
* // Is64BitsOnly: true || false,
* // InstanceFamilyId: "STRING_VALUE",
* // EbsOptimizedAvailable: true || false,
* // EbsOptimizedByDefault: true || false,
* // NumberOfDisks: Number("int"),
* // EbsStorageOnly: true || false,
* // Architecture: "STRING_VALUE",
* // },
* // ],
* // Marker: "STRING_VALUE",
* // };
*
* ```
*
* @param ListSupportedInstanceTypesCommandInput - {@link ListSupportedInstanceTypesCommandInput}
* @returns {@link ListSupportedInstanceTypesCommandOutput}
* @see {@link ListSupportedInstanceTypesCommandInput} for command's `input` shape.
* @see {@link ListSupportedInstanceTypesCommandOutput} for command's `response` shape.
* @see {@link EMRClientResolvedConfig | config} for EMRClient's `config` shape.
*
* @throws {@link InternalServerException} (server fault)
* <p>This exception occurs when there is an internal failure in the Amazon EMR
* service.</p>
*
* @throws {@link InvalidRequestException} (client fault)
* <p>This exception occurs when there is something wrong with user input.</p>
*
* @throws {@link EMRServiceException}
* <p>Base exception class for all service exceptions from EMR service.</p>
*
*/
export class ListSupportedInstanceTypesCommand extends $Command<
ListSupportedInstanceTypesCommandInput,
ListSupportedInstanceTypesCommandOutput,
EMRClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: ListSupportedInstanceTypesCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: EMRClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListSupportedInstanceTypesCommandInput, ListSupportedInstanceTypesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ListSupportedInstanceTypesCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "EMRClient";
const commandName = "ListSupportedInstanceTypesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: ListSupportedInstanceTypesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_ListSupportedInstanceTypesCommand(input, context);
}

/**
* @internal
*/
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<ListSupportedInstanceTypesCommandOutput> {
return de_ListSupportedInstanceTypesCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-emr/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export * from "./ListSecurityConfigurationsCommand";
export * from "./ListStepsCommand";
export * from "./ListStudioSessionMappingsCommand";
export * from "./ListStudiosCommand";
export * from "./ListSupportedInstanceTypesCommand";
export * from "./ModifyClusterCommand";
export * from "./ModifyInstanceFleetCommand";
export * from "./ModifyInstanceGroupsCommand";
Expand Down
116 changes: 112 additions & 4 deletions clients/client-emr/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,9 @@ export interface SpotProvisioningSpecification {
BlockDurationMinutes?: number;

/**
* <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>
* <note>
* <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>
* </note>
* <p> Specifies the strategy to use in launching Spot Instance fleets. Currently, the only
* option is capacity-optimized (the default), which launches instances from Spot Instance
* pools with optimal capacity for the number of instances that are launching. </p>
*/
AllocationStrategy?: SpotProvisioningAllocationStrategy | string;
}
Expand Down Expand Up @@ -4725,6 +4724,115 @@ export interface ListStudioSessionMappingsOutput {
Marker?: string;
}

/**
* @public
*/
export interface ListSupportedInstanceTypesInput {
/**
* <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
* application packages</a> that Amazon EMR has installed on the cluster.
* 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
* <i>
* <a href="https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-release-components.html">Amazon EMR Release
* Guide</a>
* </i>.</p>
*/
ReleaseLabel: string | undefined;

/**
* <p>The pagination token that marks the next set of results to retrieve.</p>
*/
Marker?: string;
}

/**
* @public
* <p>An instance type that the specified Amazon EMR release supports.</p>
*/
export interface SupportedInstanceType {
/**
* <p>The <a href="http://aws.amazon.com/ec2/instance-types/">Amazon EC2 instance
* type</a>, for example <code>m5.xlarge</code>, of the
* <code>SupportedInstanceType</code>.</p>
*/
Type?: string;

/**
* <p>The amount of memory that is available to Amazon EMR from the <code>SupportedInstanceType</code>. The kernel and hypervisor
* software consume some memory, so this value might be lower than the overall memory for the
* instance type.</p>
*/
MemoryGB?: number;

/**
* <p>
* <code>StorageGB</code> represents the storage capacity of the
* <code>SupportedInstanceType</code>. This value is <code>0</code> for Amazon EBS-only instance types.</p>
*/
StorageGB?: number;

/**
* <p>The number of vCPUs available for the <code>SupportedInstanceType</code>.</p>
*/
VCPU?: number;

/**
* <p>Indicates whether the <code>SupportedInstanceType</code> only supports 64-bit
* architecture.</p>
*/
Is64BitsOnly?: boolean;

/**
* <p>The Amazon EC2 family and generation for the
* <code>SupportedInstanceType</code>.</p>
*/
InstanceFamilyId?: string;

/**
* <p>Indicates whether the <code>SupportedInstanceType</code> supports Amazon EBS
* optimization.</p>
*/
EbsOptimizedAvailable?: boolean;

/**
* <p>Indicates whether the <code>SupportedInstanceType</code> uses Amazon EBS
* optimization by default.</p>
*/
EbsOptimizedByDefault?: boolean;

/**
* <p>Number of disks for the <code>SupportedInstanceType</code>. This value is <code>0</code>
* for Amazon EBS-only instance types.</p>
*/
NumberOfDisks?: number;

/**
* <p>Indicates whether the <code>SupportedInstanceType</code> only supports Amazon EBS.</p>
*/
EbsStorageOnly?: boolean;

/**
* <p>The CPU architecture, for example <code>X86_64</code> or <code>AARCH64</code>.</p>
*/
Architecture?: string;
}

/**
* @public
*/
export interface ListSupportedInstanceTypesOutput {
/**
* <p>The list of instance types that the release specified in
* <code>ListSupportedInstanceTypesInput$ReleaseLabel</code> supports, filtered by Amazon Web Services Region.</p>
*/
SupportedInstanceTypes?: SupportedInstanceType[];

/**
* <p>The pagination token that marks the next set of results to retrieve.</p>
*/
Marker?: string;
}

/**
* @public
*/
Expand Down
Loading

0 comments on commit 9875d03

Please sign in to comment.