diff --git a/clients/client-database-migration-service/README.md b/clients/client-database-migration-service/README.md index 2518885bde25..11c654885194 100644 --- a/clients/client-database-migration-service/README.md +++ b/clients/client-database-migration-service/README.md @@ -447,6 +447,14 @@ DescribeEndpointTypes [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/classes/describeendpointtypescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/interfaces/describeendpointtypescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/interfaces/describeendpointtypescommandoutput.html) + +
+ +DescribeEngineVersions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/classes/describeengineversionscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/interfaces/describeengineversionscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-database-migration-service/interfaces/describeengineversionscommandoutput.html) +
diff --git a/clients/client-database-migration-service/src/DatabaseMigrationService.ts b/clients/client-database-migration-service/src/DatabaseMigrationService.ts index a1e29be29274..23bbe619a5b8 100644 --- a/clients/client-database-migration-service/src/DatabaseMigrationService.ts +++ b/clients/client-database-migration-service/src/DatabaseMigrationService.ts @@ -147,6 +147,11 @@ import { DescribeEndpointTypesCommandInput, DescribeEndpointTypesCommandOutput, } from "./commands/DescribeEndpointTypesCommand"; +import { + DescribeEngineVersionsCommand, + DescribeEngineVersionsCommandInput, + DescribeEngineVersionsCommandOutput, +} from "./commands/DescribeEngineVersionsCommand"; import { DescribeEventCategoriesCommand, DescribeEventCategoriesCommandInput, @@ -424,6 +429,7 @@ const commands = { DescribeEndpointsCommand, DescribeEndpointSettingsCommand, DescribeEndpointTypesCommand, + DescribeEngineVersionsCommand, DescribeEventCategoriesCommand, DescribeEventsCommand, DescribeEventSubscriptionsCommand, @@ -963,6 +969,23 @@ export interface DatabaseMigrationService { cb: (err: any, data?: DescribeEndpointTypesCommandOutput) => void ): void; + /** + * @see {@link DescribeEngineVersionsCommand} + */ + describeEngineVersions( + args: DescribeEngineVersionsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeEngineVersions( + args: DescribeEngineVersionsCommandInput, + cb: (err: any, data?: DescribeEngineVersionsCommandOutput) => void + ): void; + describeEngineVersions( + args: DescribeEngineVersionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeEngineVersionsCommandOutput) => void + ): void; + /** * @see {@link DescribeEventCategoriesCommand} */ diff --git a/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts index 2270daae6d74..31d623730007 100644 --- a/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts +++ b/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts @@ -147,6 +147,10 @@ import { DescribeEndpointTypesCommandInput, DescribeEndpointTypesCommandOutput, } from "./commands/DescribeEndpointTypesCommand"; +import { + DescribeEngineVersionsCommandInput, + DescribeEngineVersionsCommandOutput, +} from "./commands/DescribeEngineVersionsCommand"; import { DescribeEventCategoriesCommandInput, DescribeEventCategoriesCommandOutput, @@ -359,6 +363,7 @@ export type ServiceInputTypes = | DescribeEndpointSettingsCommandInput | DescribeEndpointTypesCommandInput | DescribeEndpointsCommandInput + | DescribeEngineVersionsCommandInput | DescribeEventCategoriesCommandInput | DescribeEventSubscriptionsCommandInput | DescribeEventsCommandInput @@ -442,6 +447,7 @@ export type ServiceOutputTypes = | DescribeEndpointSettingsCommandOutput | DescribeEndpointTypesCommandOutput | DescribeEndpointsCommandOutput + | DescribeEngineVersionsCommandOutput | DescribeEventCategoriesCommandOutput | DescribeEventSubscriptionsCommandOutput | DescribeEventsCommandOutput diff --git a/clients/client-database-migration-service/src/commands/DescribeEngineVersionsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEngineVersionsCommand.ts new file mode 100644 index 000000000000..ceca9e01139d --- /dev/null +++ b/clients/client-database-migration-service/src/commands/DescribeEngineVersionsCommand.ts @@ -0,0 +1,161 @@ +// 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, +} from "@smithy/types"; + +import { + DatabaseMigrationServiceClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../DatabaseMigrationServiceClient"; +import { DescribeEngineVersionsMessage, DescribeEngineVersionsResponse } from "../models/models_0"; +import { de_DescribeEngineVersionsCommand, se_DescribeEngineVersionsCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DescribeEngineVersionsCommand}. + */ +export interface DescribeEngineVersionsCommandInput extends DescribeEngineVersionsMessage {} +/** + * @public + * + * The output of {@link DescribeEngineVersionsCommand}. + */ +export interface DescribeEngineVersionsCommandOutput extends DescribeEngineVersionsResponse, __MetadataBearer {} + +/** + * @public + *

Returns information about the replication instance versions used in the project.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DatabaseMigrationServiceClient, DescribeEngineVersionsCommand } from "@aws-sdk/client-database-migration-service"; // ES Modules import + * // const { DatabaseMigrationServiceClient, DescribeEngineVersionsCommand } = require("@aws-sdk/client-database-migration-service"); // CommonJS import + * const client = new DatabaseMigrationServiceClient(config); + * const input = { // DescribeEngineVersionsMessage + * MaxRecords: Number("int"), + * Marker: "STRING_VALUE", + * }; + * const command = new DescribeEngineVersionsCommand(input); + * const response = await client.send(command); + * // { // DescribeEngineVersionsResponse + * // EngineVersions: [ // EngineVersionList + * // { // EngineVersion + * // Version: "STRING_VALUE", + * // Lifecycle: "STRING_VALUE", + * // ReleaseStatus: "beta" || "prod", + * // LaunchDate: new Date("TIMESTAMP"), + * // AutoUpgradeDate: new Date("TIMESTAMP"), + * // DeprecationDate: new Date("TIMESTAMP"), + * // ForceUpgradeDate: new Date("TIMESTAMP"), + * // AvailableUpgrades: [ // AvailableUpgradesList + * // "STRING_VALUE", + * // ], + * // }, + * // ], + * // Marker: "STRING_VALUE", + * // }; + * + * ``` + * + * @param DescribeEngineVersionsCommandInput - {@link DescribeEngineVersionsCommandInput} + * @returns {@link DescribeEngineVersionsCommandOutput} + * @see {@link DescribeEngineVersionsCommandInput} for command's `input` shape. + * @see {@link DescribeEngineVersionsCommandOutput} for command's `response` shape. + * @see {@link DatabaseMigrationServiceClientResolvedConfig | config} for DatabaseMigrationServiceClient's `config` shape. + * + * @throws {@link DatabaseMigrationServiceServiceException} + *

Base exception class for all service exceptions from DatabaseMigrationService service.

+ * + */ +export class DescribeEngineVersionsCommand extends $Command< + DescribeEngineVersionsCommandInput, + DescribeEngineVersionsCommandOutput, + DatabaseMigrationServiceClientResolvedConfig +> { + // 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: DescribeEngineVersionsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: DatabaseMigrationServiceClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DescribeEngineVersionsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DatabaseMigrationServiceClient"; + const commandName = "DescribeEngineVersionsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DescribeEngineVersionsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DescribeEngineVersionsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DescribeEngineVersionsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-database-migration-service/src/commands/index.ts b/clients/client-database-migration-service/src/commands/index.ts index 9c8d8343f0fa..e182b92403a9 100644 --- a/clients/client-database-migration-service/src/commands/index.ts +++ b/clients/client-database-migration-service/src/commands/index.ts @@ -28,6 +28,7 @@ export * from "./DescribeConnectionsCommand"; export * from "./DescribeEndpointSettingsCommand"; export * from "./DescribeEndpointTypesCommand"; export * from "./DescribeEndpointsCommand"; +export * from "./DescribeEngineVersionsCommand"; export * from "./DescribeEventCategoriesCommand"; export * from "./DescribeEventSubscriptionsCommand"; export * from "./DescribeEventsCommand"; diff --git a/clients/client-database-migration-service/src/models/models_0.ts b/clients/client-database-migration-service/src/models/models_0.ts index 2b85c0e90a7c..18127583cc7e 100644 --- a/clients/client-database-migration-service/src/models/models_0.ts +++ b/clients/client-database-migration-service/src/models/models_0.ts @@ -2620,9 +2620,7 @@ export interface PostgreSQLSettings { /** * @public - *

Specifies whether to use default or custom replication behavior for - * PostgreSQL-compatible endpoints. You can use this setting to specify replication - * behavior for endpoints that require additional configuration, such as Babelfish endpoints.

+ *

Specifies the default behavior of the replication's handling of PostgreSQL- compatible endpoints that require some additional configuration, such as Babelfish endpoints.

*/ DatabaseMode?: DatabaseMode | string; @@ -7453,6 +7451,114 @@ export interface DescribeEndpointTypesResponse { SupportedEndpointTypes?: SupportedEndpointType[]; } +/** + * @public + */ +export interface DescribeEngineVersionsMessage { + /** + * @public + *

The maximum number of records to include in the response. If more records exist than the specified + * MaxRecords value, a pagination token called a marker is included in the response so that + * the remaining results can be retrieved.

+ */ + MaxRecords?: number; + + /** + * @public + *

An optional pagination token provided by a previous request. If this parameter is specified, + * the response includes only records beyond the marker, up to the value specified by MaxRecords.

+ */ + Marker?: string; +} + +/** + * @public + * @enum + */ +export const ReleaseStatusValues = { + BETA: "beta", + PROD: "prod", +} as const; + +/** + * @public + */ +export type ReleaseStatusValues = (typeof ReleaseStatusValues)[keyof typeof ReleaseStatusValues]; + +/** + * @public + *

Provides information about a replication instance version.

+ */ +export interface EngineVersion { + /** + * @public + *

The version number of the replication instance.

+ */ + Version?: string; + + /** + * @public + *

The lifecycle status of the replication instance version. Valid values are DEPRECATED, + * DEFAULT_VERSION, and ACTIVE.

+ */ + Lifecycle?: string; + + /** + * @public + *

The release status of the replication instance version.

+ */ + ReleaseStatus?: ReleaseStatusValues | string; + + /** + * @public + *

The date when the replication instance version became publicly available.

+ */ + LaunchDate?: Date; + + /** + * @public + *

The date when the replication instance will be automatically upgraded. This setting only applies + * if the auto-minor-version setting is enabled.

+ */ + AutoUpgradeDate?: Date; + + /** + * @public + *

The date when the replication instance version will be deprecated and can no longer be requested.

+ */ + DeprecationDate?: Date; + + /** + * @public + *

The date when the replication instance will have a version upgrade forced.

+ */ + ForceUpgradeDate?: Date; + + /** + * @public + *

The list of valid replication instance versions that you can upgrade to.

+ */ + AvailableUpgrades?: string[]; +} + +/** + * @public + */ +export interface DescribeEngineVersionsResponse { + /** + * @public + *

Returned EngineVersion objects that describe the replication instance engine versions used in the project.

+ */ + EngineVersions?: EngineVersion[]; + + /** + * @public + *

An optional pagination token provided by a previous request. If this parameter is specified, the response + * includes only records beyond the marker, up to the value specified by MaxRecords.

+ */ + Marker?: string; +} + /** * @public *

@@ -8581,20 +8687,6 @@ export interface DescribeOrderableReplicationInstancesMessage { Marker?: string; } -/** - * @public - * @enum - */ -export const ReleaseStatusValues = { - BETA: "beta", - PROD: "prod", -} as const; - -/** - * @public - */ -export type ReleaseStatusValues = (typeof ReleaseStatusValues)[keyof typeof ReleaseStatusValues]; - /** * @public *

In response to the DescribeOrderableReplicationInstances operation, this diff --git a/clients/client-database-migration-service/src/pagination/DescribeEngineVersionsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEngineVersionsPaginator.ts new file mode 100644 index 000000000000..5a5cd2eb0d0c --- /dev/null +++ b/clients/client-database-migration-service/src/pagination/DescribeEngineVersionsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + DescribeEngineVersionsCommand, + DescribeEngineVersionsCommandInput, + DescribeEngineVersionsCommandOutput, +} from "../commands/DescribeEngineVersionsCommand"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEngineVersionsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateDescribeEngineVersions( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeEngineVersionsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeEngineVersionsCommandOutput; + while (hasNext) { + input.Marker = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/src/pagination/index.ts b/clients/client-database-migration-service/src/pagination/index.ts index 820cb4344839..b6603f58d3d6 100644 --- a/clients/client-database-migration-service/src/pagination/index.ts +++ b/clients/client-database-migration-service/src/pagination/index.ts @@ -10,15 +10,16 @@ export * from "./DescribeEndpointTypesPaginator"; export * from "./DescribeEndpointsPaginator"; +export * from "./DescribeEngineVersionsPaginator"; + export * from "./DescribeEventSubscriptionsPaginator"; export * from "./DescribeEventsPaginator"; export * from "./DescribeFleetAdvisorCollectorsPaginator"; - -export * from "./DescribeFleetAdvisorDatabasesPaginator"; // smithy-typescript generated code export * from "./Interfaces"; +export * from "./DescribeFleetAdvisorDatabasesPaginator"; export * from "./DescribeFleetAdvisorLsaAnalysisPaginator"; export * from "./DescribeFleetAdvisorSchemaObjectSummaryPaginator"; export * from "./DescribeFleetAdvisorSchemasPaginator"; diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 84d8f3d8d31b..f8a4fd608fd0 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -120,6 +120,10 @@ import { DescribeEndpointTypesCommandInput, DescribeEndpointTypesCommandOutput, } from "../commands/DescribeEndpointTypesCommand"; +import { + DescribeEngineVersionsCommandInput, + DescribeEngineVersionsCommandOutput, +} from "../commands/DescribeEngineVersionsCommand"; import { DescribeEventCategoriesCommandInput, DescribeEventCategoriesCommandOutput, @@ -335,6 +339,8 @@ import { DescribeEndpointSettingsMessage, DescribeEndpointsMessage, DescribeEndpointTypesMessage, + DescribeEngineVersionsMessage, + DescribeEngineVersionsResponse, DescribeEventCategoriesMessage, DescribeEventsMessage, DescribeEventsResponse, @@ -378,6 +384,7 @@ import { DocDbSettings, DynamoDbSettings, ElasticsearchSettings, + EngineVersion, Event, Filter, GcpMySQLSettings, @@ -857,6 +864,19 @@ export const se_DescribeEndpointTypesCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1DescribeEngineVersionsCommand + */ +export const se_DescribeEngineVersionsCommand = async ( + input: DescribeEngineVersionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DescribeEngineVersions"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1DescribeEventCategoriesCommand */ @@ -3001,6 +3021,46 @@ const de_DescribeEndpointTypesCommandError = async ( }); }; +/** + * deserializeAws_json1_1DescribeEngineVersionsCommand + */ +export const de_DescribeEngineVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_DescribeEngineVersionsCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEngineVersionsResponse(data, context); + const response: DescribeEngineVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1DescribeEngineVersionsCommandError + */ +const de_DescribeEngineVersionsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); +}; + /** * deserializeAws_json1_1DescribeEventCategoriesCommand */ @@ -5922,6 +5982,8 @@ const se_CreateReplicationTaskMessage = (input: CreateReplicationTaskMessage, co // se_DescribeEndpointTypesMessage omitted. +// se_DescribeEngineVersionsMessage omitted. + // se_DescribeEventCategoriesMessage omitted. /** @@ -6180,6 +6242,8 @@ const de_ApplyPendingMaintenanceActionResponse = ( // de_AvailabilityZonesList omitted. +// de_AvailableUpgradesList omitted. + // de_BatchStartRecommendationsErrorEntry omitted. // de_BatchStartRecommendationsErrorEntryList omitted. @@ -6375,6 +6439,16 @@ const de_DescribeCertificatesResponse = (output: any, context: __SerdeContext): // de_DescribeEndpointTypesResponse omitted. +/** + * deserializeAws_json1_1DescribeEngineVersionsResponse + */ +const de_DescribeEngineVersionsResponse = (output: any, context: __SerdeContext): DescribeEngineVersionsResponse => { + return take(output, { + EngineVersions: (_: any) => de_EngineVersionList(_, context), + Marker: __expectString, + }) as any; +}; + // de_DescribeEventCategoriesResponse omitted. /** @@ -6587,6 +6661,34 @@ const de_DescribeTableStatisticsResponse = (output: any, context: __SerdeContext // de_EndpointSettingsList omitted. +/** + * deserializeAws_json1_1EngineVersion + */ +const de_EngineVersion = (output: any, context: __SerdeContext): EngineVersion => { + return take(output, { + AutoUpgradeDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + AvailableUpgrades: _json, + DeprecationDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ForceUpgradeDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + LaunchDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Lifecycle: __expectString, + ReleaseStatus: __expectString, + Version: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_1EngineVersionList + */ +const de_EngineVersionList = (output: any, context: __SerdeContext): EngineVersion[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_EngineVersion(entry, context); + }); + return retVal; +}; + /** * deserializeAws_json1_1Event */