-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-database-migration-service): New api to migrate event sub…
…scriptions to event bridge rules
- Loading branch information
awstools
committed
Jul 7, 2022
1 parent
0dd0bdd
commit 6ed4f9b
Showing
7 changed files
with
347 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
...client-database-migration-service/src/commands/UpdateSubscriptionsToEventBridgeCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { | ||
DatabaseMigrationServiceClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes, | ||
} from "../DatabaseMigrationServiceClient"; | ||
import { UpdateSubscriptionsToEventBridgeMessage, UpdateSubscriptionsToEventBridgeResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand, | ||
serializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
export interface UpdateSubscriptionsToEventBridgeCommandInput extends UpdateSubscriptionsToEventBridgeMessage {} | ||
export interface UpdateSubscriptionsToEventBridgeCommandOutput | ||
extends UpdateSubscriptionsToEventBridgeResponse, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* <p>Migrates 10 active and enabled Amazon SNS subscriptions at a time and converts them to corresponding Amazon EventBridge rules. | ||
* By default, this operation migrates subscriptions only when all your replication instance versions are 3.4.6 or higher. | ||
* If any replication instances are from versions earlier than 3.4.6, the operation raises an error and tells you | ||
* to upgrade these instances to version 3.4.6 or higher. To enable migration regardless of version, set the <code>Force</code> | ||
* option to true. However, if you don't upgrade instances earlier than version 3.4.6, some types of events might not be | ||
* available when you use Amazon EventBridge.</p> | ||
* <p>To call this operation, make sure that you have certain permissions added to your user account. | ||
* For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html#CHAP_Events-migrate-to-eventbridge">Migrating event subscriptions to Amazon EventBridge</a> | ||
* in the <i>Amazon Web Services Database Migration Service User Guide</i>.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { DatabaseMigrationServiceClient, UpdateSubscriptionsToEventBridgeCommand } from "@aws-sdk/client-database-migration-service"; // ES Modules import | ||
* // const { DatabaseMigrationServiceClient, UpdateSubscriptionsToEventBridgeCommand } = require("@aws-sdk/client-database-migration-service"); // CommonJS import | ||
* const client = new DatabaseMigrationServiceClient(config); | ||
* const command = new UpdateSubscriptionsToEventBridgeCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link UpdateSubscriptionsToEventBridgeCommandInput} for command's `input` shape. | ||
* @see {@link UpdateSubscriptionsToEventBridgeCommandOutput} for command's `response` shape. | ||
* @see {@link DatabaseMigrationServiceClientResolvedConfig | config} for DatabaseMigrationServiceClient's `config` shape. | ||
* | ||
*/ | ||
export class UpdateSubscriptionsToEventBridgeCommand extends $Command< | ||
UpdateSubscriptionsToEventBridgeCommandInput, | ||
UpdateSubscriptionsToEventBridgeCommandOutput, | ||
DatabaseMigrationServiceClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: UpdateSubscriptionsToEventBridgeCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: DatabaseMigrationServiceClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<UpdateSubscriptionsToEventBridgeCommandInput, UpdateSubscriptionsToEventBridgeCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "DatabaseMigrationServiceClient"; | ||
const commandName = "UpdateSubscriptionsToEventBridgeCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: UpdateSubscriptionsToEventBridgeMessage.filterSensitiveLog, | ||
outputFilterSensitiveLog: UpdateSubscriptionsToEventBridgeResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize( | ||
input: UpdateSubscriptionsToEventBridgeCommandInput, | ||
context: __SerdeContext | ||
): Promise<__HttpRequest> { | ||
return serializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand(input, context); | ||
} | ||
|
||
private deserialize( | ||
output: __HttpResponse, | ||
context: __SerdeContext | ||
): Promise<UpdateSubscriptionsToEventBridgeCommandOutput> { | ||
return deserializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.