Skip to content

Commit

Permalink
feat(client-keyspaces): Amazon Keyspaces Multi-Region Replication: Ad…
Browse files Browse the repository at this point in the history
…ds support to add new regions to multi and single-region keyspaces.
  • Loading branch information
awstools committed Nov 19, 2024
1 parent 663b3c6 commit 9c30b3a
Show file tree
Hide file tree
Showing 13 changed files with 492 additions and 10 deletions.
8 changes: 8 additions & 0 deletions clients/client-keyspaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ UntagResource

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/keyspaces/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-keyspaces/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-keyspaces/Interface/UntagResourceCommandOutput/)

</details>
<details>
<summary>
UpdateKeyspace
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/keyspaces/command/UpdateKeyspaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-keyspaces/Interface/UpdateKeyspaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-keyspaces/Interface/UpdateKeyspaceCommandOutput/)

</details>
<details>
<summary>
Expand Down
20 changes: 20 additions & 0 deletions clients/client-keyspaces/src/Keyspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ import {
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import {
UpdateKeyspaceCommand,
UpdateKeyspaceCommandInput,
UpdateKeyspaceCommandOutput,
} from "./commands/UpdateKeyspaceCommand";
import { UpdateTableCommand, UpdateTableCommandInput, UpdateTableCommandOutput } from "./commands/UpdateTableCommand";
import { KeyspacesClient, KeyspacesClientConfig } from "./KeyspacesClient";

Expand All @@ -68,6 +73,7 @@ const commands = {
RestoreTableCommand,
TagResourceCommand,
UntagResourceCommand,
UpdateKeyspaceCommand,
UpdateTableCommand,
};

Expand Down Expand Up @@ -278,6 +284,20 @@ export interface Keyspaces {
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;

/**
* @see {@link UpdateKeyspaceCommand}
*/
updateKeyspace(
args: UpdateKeyspaceCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateKeyspaceCommandOutput>;
updateKeyspace(args: UpdateKeyspaceCommandInput, cb: (err: any, data?: UpdateKeyspaceCommandOutput) => void): void;
updateKeyspace(
args: UpdateKeyspaceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateKeyspaceCommandOutput) => void
): void;

/**
* @see {@link UpdateTableCommand}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-keyspaces/src/KeyspacesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import { ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTy
import { RestoreTableCommandInput, RestoreTableCommandOutput } from "./commands/RestoreTableCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdateKeyspaceCommandInput, UpdateKeyspaceCommandOutput } from "./commands/UpdateKeyspaceCommand";
import { UpdateTableCommandInput, UpdateTableCommandOutput } from "./commands/UpdateTableCommand";
import {
ClientInputEndpointParameters,
Expand Down Expand Up @@ -109,6 +110,7 @@ export type ServiceInputTypes =
| RestoreTableCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateKeyspaceCommandInput
| UpdateTableCommandInput;

/**
Expand All @@ -132,6 +134,7 @@ export type ServiceOutputTypes =
| RestoreTableCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateKeyspaceCommandOutput
| UpdateTableCommandOutput;

/**
Expand Down
2 changes: 2 additions & 0 deletions clients/client-keyspaces/src/commands/CreateTypeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface CreateTypeCommandOutput extends CreateTypeResponse, __MetadataB
* <p>
* The <code>CreateType</code> operation creates a new user-defined type in the specified keyspace.
* </p>
* <p>To configure the required permissions, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-create">Permissions to create a UDT</a>
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/udts.html">User-defined types (UDTs)</a> in the <i>Amazon Keyspaces Developer
* Guide</i>. </p>
* @example
Expand Down
2 changes: 2 additions & 0 deletions clients/client-keyspaces/src/commands/DeleteTypeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export interface DeleteTypeCommandOutput extends DeleteTypeResponse, __MetadataB
* The <code>DeleteType</code> operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table
* or another UDT.
* </p>
* <p>To configure the required permissions, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-drop">Permissions to delete a UDT</a>
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
10 changes: 9 additions & 1 deletion clients/client-keyspaces/src/commands/GetKeyspaceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export interface GetKeyspaceCommandInput extends GetKeyspaceRequest {}
export interface GetKeyspaceCommandOutput extends GetKeyspaceResponse, __MetadataBearer {}

/**
* <p>Returns the name and the Amazon Resource Name (ARN) of the specified table.</p>
* <p>Returns the name of the specified keyspace, the Amazon Resource Name (ARN), the replication strategy, the Amazon Web Services Regions of
* a multi-Region keyspace, and the status of newly added Regions after an <code>UpdateKeyspace</code> operation.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -47,6 +48,13 @@ export interface GetKeyspaceCommandOutput extends GetKeyspaceResponse, __Metadat
* // replicationRegions: [ // RegionList
* // "STRING_VALUE",
* // ],
* // replicationGroupStatuses: [ // ReplicationGroupStatusList
* // { // ReplicationGroupStatus
* // region: "STRING_VALUE", // required
* // keyspaceStatus: "STRING_VALUE", // required
* // tablesReplicationProgress: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
3 changes: 2 additions & 1 deletion clients/client-keyspaces/src/commands/GetTypeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export interface GetTypeCommandOutput extends GetTypeResponse, __MetadataBearer
* </p>
* <p>To read keyspace metadata using <code>GetType</code>, the
* IAM principal needs <code>Select</code> action
* permissions for the system keyspace.</p>
* permissions for the system keyspace. To configure the required permissions, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view">Permissions to view a UDT</a>
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
3 changes: 2 additions & 1 deletion clients/client-keyspaces/src/commands/ListTypesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export interface ListTypesCommandOutput extends ListTypesResponse, __MetadataBea
* </p>
* <p>To read keyspace metadata using <code>ListTypes</code>, the
* IAM principal needs <code>Select</code> action
* permissions for the system keyspace.</p>
* permissions for the system keyspace. To configure the required permissions, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view">Permissions to view a UDT</a>
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
131 changes: 131 additions & 0 deletions clients/client-keyspaces/src/commands/UpdateKeyspaceCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { KeyspacesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KeyspacesClient";
import { UpdateKeyspaceRequest, UpdateKeyspaceResponse } from "../models/models_0";
import { de_UpdateKeyspaceCommand, se_UpdateKeyspaceCommand } from "../protocols/Aws_json1_0";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link UpdateKeyspaceCommand}.
*/
export interface UpdateKeyspaceCommandInput extends UpdateKeyspaceRequest {}
/**
* @public
*
* The output of {@link UpdateKeyspaceCommand}.
*/
export interface UpdateKeyspaceCommandOutput extends UpdateKeyspaceResponse, __MetadataBearer {}

/**
* <p>
* Adds a new Amazon Web Services Region to the keyspace. You can add a new Region to a keyspace that is either a single or a multi-Region keyspace.
* The new replica Region is applied to all tables in the keyspace. For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/keyspaces-multi-region-add-replica.html">Add an Amazon Web Services Region to a keyspace in Amazon Keyspaces</a> in the <i>Amazon Keyspaces Developer
* Guide</i>.
* </p>
* <p>To change a single-Region to a multi-Region keyspace, you have to enable client-side timestamps
* for all tables in the keyspace. For more information, see
* <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/client-side-timestamps.html">Client-side timestamps in Amazon Keyspaces</a> in the <i>Amazon Keyspaces Developer
* Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { KeyspacesClient, UpdateKeyspaceCommand } from "@aws-sdk/client-keyspaces"; // ES Modules import
* // const { KeyspacesClient, UpdateKeyspaceCommand } = require("@aws-sdk/client-keyspaces"); // CommonJS import
* const client = new KeyspacesClient(config);
* const input = { // UpdateKeyspaceRequest
* keyspaceName: "STRING_VALUE", // required
* replicationSpecification: { // ReplicationSpecification
* replicationStrategy: "STRING_VALUE", // required
* regionList: [ // RegionList
* "STRING_VALUE",
* ],
* },
* clientSideTimestamps: { // ClientSideTimestamps
* status: "STRING_VALUE", // required
* },
* };
* const command = new UpdateKeyspaceCommand(input);
* const response = await client.send(command);
* // { // UpdateKeyspaceResponse
* // resourceArn: "STRING_VALUE", // required
* // };
*
* ```
*
* @param UpdateKeyspaceCommandInput - {@link UpdateKeyspaceCommandInput}
* @returns {@link UpdateKeyspaceCommandOutput}
* @see {@link UpdateKeyspaceCommandInput} for command's `input` shape.
* @see {@link UpdateKeyspaceCommandOutput} for command's `response` shape.
* @see {@link KeyspacesClientResolvedConfig | config} for KeyspacesClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You don't have sufficient access permissions to perform this action. </p>
*
* @throws {@link ConflictException} (client fault)
* <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to
* perform an action and the same or a different action is already
* in progress, or if you try to create a resource that already exists. </p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly,
* or its status might not be <code>ACTIVE</code>.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html">Quotas</a> in the <i>Amazon Keyspaces Developer
* Guide</i>.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The operation failed due to an invalid or malformed request.</p>
*
* @throws {@link KeyspacesServiceException}
* <p>Base exception class for all service exceptions from Keyspaces service.</p>
*
* @public
*/
export class UpdateKeyspaceCommand extends $Command
.classBuilder<
UpdateKeyspaceCommandInput,
UpdateKeyspaceCommandOutput,
KeyspacesClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: KeyspacesClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("KeyspacesService", "UpdateKeyspace", {})
.n("KeyspacesClient", "UpdateKeyspaceCommand")
.f(void 0, void 0)
.ser(se_UpdateKeyspaceCommand)
.de(de_UpdateKeyspaceCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: UpdateKeyspaceRequest;
output: UpdateKeyspaceResponse;
};
sdk: {
input: UpdateKeyspaceCommandInput;
output: UpdateKeyspaceCommandOutput;
};
};
}
1 change: 1 addition & 0 deletions clients/client-keyspaces/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export * from "./ListTypesCommand";
export * from "./RestoreTableCommand";
export * from "./TagResourceCommand";
export * from "./UntagResourceCommand";
export * from "./UpdateKeyspaceCommand";
export * from "./UpdateTableCommand";
Loading

0 comments on commit 9c30b3a

Please sign in to comment.