Skip to content

Commit

Permalink
feat(client-migrationhubstrategy): This release introduces multi-data…
Browse files Browse the repository at this point in the history
…-source feature in Migration Hub Strategy Recommendations. This feature now supports vCenter as a data source to fetch inventory in addition to ADS and Import from file workflow that is currently supported with MHSR collector.
  • Loading branch information
awstools committed Oct 24, 2023
1 parent 8a65e9f commit fe4dd4f
Show file tree
Hide file tree
Showing 11 changed files with 645 additions and 14 deletions.
8 changes: 8 additions & 0 deletions clients/client-migrationhubstrategy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ GetServerStrategies

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/classes/getserverstrategiescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/interfaces/getserverstrategiescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/interfaces/getserverstrategiescommandoutput.html)

</details>
<details>
<summary>
ListAnalyzableServers
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/classes/listanalyzableserverscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/interfaces/listanalyzableserverscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhubstrategy/interfaces/listanalyzableserverscommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-migrationhubstrategy/src/MigrationHubStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ import {
GetServerStrategiesCommandInput,
GetServerStrategiesCommandOutput,
} from "./commands/GetServerStrategiesCommand";
import {
ListAnalyzableServersCommand,
ListAnalyzableServersCommandInput,
ListAnalyzableServersCommandOutput,
} from "./commands/ListAnalyzableServersCommand";
import {
ListApplicationComponentsCommand,
ListApplicationComponentsCommandInput,
Expand Down Expand Up @@ -116,6 +121,7 @@ const commands = {
GetRecommendationReportDetailsCommand,
GetServerDetailsCommand,
GetServerStrategiesCommand,
ListAnalyzableServersCommand,
ListApplicationComponentsCommand,
ListCollectorsCommand,
ListImportFileTaskCommand,
Expand Down Expand Up @@ -294,6 +300,23 @@ export interface MigrationHubStrategy {
cb: (err: any, data?: GetServerStrategiesCommandOutput) => void
): void;

/**
* @see {@link ListAnalyzableServersCommand}
*/
listAnalyzableServers(
args: ListAnalyzableServersCommandInput,
options?: __HttpHandlerOptions
): Promise<ListAnalyzableServersCommandOutput>;
listAnalyzableServers(
args: ListAnalyzableServersCommandInput,
cb: (err: any, data?: ListAnalyzableServersCommandOutput) => void
): void;
listAnalyzableServers(
args: ListAnalyzableServersCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAnalyzableServersCommandOutput) => void
): void;

/**
* @see {@link ListApplicationComponentsCommand}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ import {
GetServerStrategiesCommandInput,
GetServerStrategiesCommandOutput,
} from "./commands/GetServerStrategiesCommand";
import {
ListAnalyzableServersCommandInput,
ListAnalyzableServersCommandOutput,
} from "./commands/ListAnalyzableServersCommand";
import {
ListApplicationComponentsCommandInput,
ListApplicationComponentsCommandOutput,
Expand Down Expand Up @@ -132,6 +136,7 @@ export type ServiceInputTypes =
| GetRecommendationReportDetailsCommandInput
| GetServerDetailsCommandInput
| GetServerStrategiesCommandInput
| ListAnalyzableServersCommandInput
| ListApplicationComponentsCommandInput
| ListCollectorsCommandInput
| ListImportFileTaskCommandInput
Expand All @@ -158,6 +163,7 @@ export type ServiceOutputTypes =
| GetRecommendationReportDetailsCommandOutput
| GetServerDetailsCommandOutput
| GetServerStrategiesCommandOutput
| ListAnalyzableServersCommandOutput
| ListApplicationComponentsCommandOutput
| ListCollectorsCommandOutput
| ListImportFileTaskCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import {
MigrationHubStrategyClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../MigrationHubStrategyClient";
import { ListAnalyzableServersRequest, ListAnalyzableServersResponse } from "../models/models_0";
import { de_ListAnalyzableServersCommand, se_ListAnalyzableServersCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link ListAnalyzableServersCommand}.
*/
export interface ListAnalyzableServersCommandInput extends ListAnalyzableServersRequest {}
/**
* @public
*
* The output of {@link ListAnalyzableServersCommand}.
*/
export interface ListAnalyzableServersCommandOutput extends ListAnalyzableServersResponse, __MetadataBearer {}

/**
* @public
* Retrieves a list of all the servers fetched from customer vCenter using Strategy Recommendation Collector.
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { MigrationHubStrategyClient, ListAnalyzableServersCommand } from "@aws-sdk/client-migrationhubstrategy"; // ES Modules import
* // const { MigrationHubStrategyClient, ListAnalyzableServersCommand } = require("@aws-sdk/client-migrationhubstrategy"); // CommonJS import
* const client = new MigrationHubStrategyClient(config);
* const input = { // ListAnalyzableServersRequest
* sort: "STRING_VALUE",
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* };
* const command = new ListAnalyzableServersCommand(input);
* const response = await client.send(command);
* // { // ListAnalyzableServersResponse
* // analyzableServers: [ // AnalyzableServerSummaryList
* // { // AnalyzableServerSummary
* // hostname: "STRING_VALUE",
* // ipAddress: "STRING_VALUE",
* // source: "STRING_VALUE",
* // vmId: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListAnalyzableServersCommandInput - {@link ListAnalyzableServersCommandInput}
* @returns {@link ListAnalyzableServersCommandOutput}
* @see {@link ListAnalyzableServersCommandInput} for command's `input` shape.
* @see {@link ListAnalyzableServersCommandOutput} for command's `response` shape.
* @see {@link MigrationHubStrategyClientResolvedConfig | config} for MigrationHubStrategyClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p> The user does not have permission to perform the action. Check the
* AWS Identity and Access Management (IAM) policy associated with this user.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p> The server experienced an internal error. Try again. </p>
*
* @throws {@link ThrottlingException} (client fault)
* <p> The request was denied due to request throttling. </p>
*
* @throws {@link ValidationException} (client fault)
* <p> The request body isn't valid. </p>
*
* @throws {@link MigrationHubStrategyServiceException}
* <p>Base exception class for all service exceptions from MigrationHubStrategy service.</p>
*
*/
export class ListAnalyzableServersCommand extends $Command<
ListAnalyzableServersCommandInput,
ListAnalyzableServersCommandOutput,
MigrationHubStrategyClientResolvedConfig
> {
// 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: ListAnalyzableServersCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: MigrationHubStrategyClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListAnalyzableServersCommandInput, ListAnalyzableServersCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ListAnalyzableServersCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "MigrationHubStrategyClient";
const commandName = "ListAnalyzableServersCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AWSMigrationHubStrategyRecommendation",
operation: "ListAnalyzableServers",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface StartAssessmentCommandOutput extends StartAssessmentResponse, _
* ],
* },
* ],
* assessmentDataSourceType: "STRING_VALUE",
* };
* const command = new StartAssessmentCommand(input);
* const response = await client.send(command);
Expand Down
1 change: 1 addition & 0 deletions clients/client-migrationhubstrategy/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from "./GetPortfolioSummaryCommand";
export * from "./GetRecommendationReportDetailsCommand";
export * from "./GetServerDetailsCommand";
export * from "./GetServerStrategiesCommand";
export * from "./ListAnalyzableServersCommand";
export * from "./ListApplicationComponentsCommand";
export * from "./ListCollectorsCommand";
export * from "./ListImportFileTaskCommand";
Expand Down
Loading

0 comments on commit fe4dd4f

Please sign in to comment.