Skip to content

Commit 9c30b3a

Browse files
author
awstools
committed
feat(client-keyspaces): Amazon Keyspaces Multi-Region Replication: Adds support to add new regions to multi and single-region keyspaces.
1 parent 663b3c6 commit 9c30b3a

File tree

13 files changed

+492
-10
lines changed

13 files changed

+492
-10
lines changed

clients/client-keyspaces/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ UntagResource
351351

352352
[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/)
353353

354+
</details>
355+
<details>
356+
<summary>
357+
UpdateKeyspace
358+
</summary>
359+
360+
[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/)
361+
354362
</details>
355363
<details>
356364
<summary>

clients/client-keyspaces/src/Keyspaces.ts

+20
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ import {
4747
UntagResourceCommandInput,
4848
UntagResourceCommandOutput,
4949
} from "./commands/UntagResourceCommand";
50+
import {
51+
UpdateKeyspaceCommand,
52+
UpdateKeyspaceCommandInput,
53+
UpdateKeyspaceCommandOutput,
54+
} from "./commands/UpdateKeyspaceCommand";
5055
import { UpdateTableCommand, UpdateTableCommandInput, UpdateTableCommandOutput } from "./commands/UpdateTableCommand";
5156
import { KeyspacesClient, KeyspacesClientConfig } from "./KeyspacesClient";
5257

@@ -68,6 +73,7 @@ const commands = {
6873
RestoreTableCommand,
6974
TagResourceCommand,
7075
UntagResourceCommand,
76+
UpdateKeyspaceCommand,
7177
UpdateTableCommand,
7278
};
7379

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

287+
/**
288+
* @see {@link UpdateKeyspaceCommand}
289+
*/
290+
updateKeyspace(
291+
args: UpdateKeyspaceCommandInput,
292+
options?: __HttpHandlerOptions
293+
): Promise<UpdateKeyspaceCommandOutput>;
294+
updateKeyspace(args: UpdateKeyspaceCommandInput, cb: (err: any, data?: UpdateKeyspaceCommandOutput) => void): void;
295+
updateKeyspace(
296+
args: UpdateKeyspaceCommandInput,
297+
options: __HttpHandlerOptions,
298+
cb: (err: any, data?: UpdateKeyspaceCommandOutput) => void
299+
): void;
300+
281301
/**
282302
* @see {@link UpdateTableCommand}
283303
*/

clients/client-keyspaces/src/KeyspacesClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTy
7676
import { RestoreTableCommandInput, RestoreTableCommandOutput } from "./commands/RestoreTableCommand";
7777
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
7878
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
79+
import { UpdateKeyspaceCommandInput, UpdateKeyspaceCommandOutput } from "./commands/UpdateKeyspaceCommand";
7980
import { UpdateTableCommandInput, UpdateTableCommandOutput } from "./commands/UpdateTableCommand";
8081
import {
8182
ClientInputEndpointParameters,
@@ -109,6 +110,7 @@ export type ServiceInputTypes =
109110
| RestoreTableCommandInput
110111
| TagResourceCommandInput
111112
| UntagResourceCommandInput
113+
| UpdateKeyspaceCommandInput
112114
| UpdateTableCommandInput;
113115

114116
/**
@@ -132,6 +134,7 @@ export type ServiceOutputTypes =
132134
| RestoreTableCommandOutput
133135
| TagResourceCommandOutput
134136
| UntagResourceCommandOutput
137+
| UpdateKeyspaceCommandOutput
135138
| UpdateTableCommandOutput;
136139

137140
/**

clients/client-keyspaces/src/commands/CreateTypeCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export interface CreateTypeCommandOutput extends CreateTypeResponse, __MetadataB
3131
* <p>
3232
* The <code>CreateType</code> operation creates a new user-defined type in the specified keyspace.
3333
* </p>
34+
* <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>
35+
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
3436
* <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
3537
* Guide</i>. </p>
3638
* @example

clients/client-keyspaces/src/commands/DeleteTypeCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export interface DeleteTypeCommandOutput extends DeleteTypeResponse, __MetadataB
3232
* The <code>DeleteType</code> operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table
3333
* or another UDT.
3434
* </p>
35+
* <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>
36+
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
3537
* @example
3638
* Use a bare-bones client and the command you need to make an API call.
3739
* ```javascript

clients/client-keyspaces/src/commands/GetKeyspaceCommand.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface GetKeyspaceCommandInput extends GetKeyspaceRequest {}
2828
export interface GetKeyspaceCommandOutput extends GetKeyspaceResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Returns the name and the Amazon Resource Name (ARN) of the specified table.</p>
31+
* <p>Returns the name of the specified keyspace, the Amazon Resource Name (ARN), the replication strategy, the Amazon Web Services Regions of
32+
* a multi-Region keyspace, and the status of newly added Regions after an <code>UpdateKeyspace</code> operation.</p>
3233
* @example
3334
* Use a bare-bones client and the command you need to make an API call.
3435
* ```javascript
@@ -47,6 +48,13 @@ export interface GetKeyspaceCommandOutput extends GetKeyspaceResponse, __Metadat
4748
* // replicationRegions: [ // RegionList
4849
* // "STRING_VALUE",
4950
* // ],
51+
* // replicationGroupStatuses: [ // ReplicationGroupStatusList
52+
* // { // ReplicationGroupStatus
53+
* // region: "STRING_VALUE", // required
54+
* // keyspaceStatus: "STRING_VALUE", // required
55+
* // tablesReplicationProgress: "STRING_VALUE",
56+
* // },
57+
* // ],
5058
* // };
5159
*
5260
* ```

clients/client-keyspaces/src/commands/GetTypeCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export interface GetTypeCommandOutput extends GetTypeResponse, __MetadataBearer
3434
* </p>
3535
* <p>To read keyspace metadata using <code>GetType</code>, the
3636
* IAM principal needs <code>Select</code> action
37-
* permissions for the system keyspace.</p>
37+
* 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>
38+
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
3839
* @example
3940
* Use a bare-bones client and the command you need to make an API call.
4041
* ```javascript

clients/client-keyspaces/src/commands/ListTypesCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export interface ListTypesCommandOutput extends ListTypesResponse, __MetadataBea
3333
* </p>
3434
* <p>To read keyspace metadata using <code>ListTypes</code>, the
3535
* IAM principal needs <code>Select</code> action
36-
* permissions for the system keyspace.</p>
36+
* 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>
37+
* in the <i>Amazon Keyspaces Developer Guide</i>.</p>
3738
* @example
3839
* Use a bare-bones client and the command you need to make an API call.
3940
* ```javascript
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { KeyspacesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KeyspacesClient";
9+
import { UpdateKeyspaceRequest, UpdateKeyspaceResponse } from "../models/models_0";
10+
import { de_UpdateKeyspaceCommand, se_UpdateKeyspaceCommand } from "../protocols/Aws_json1_0";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link UpdateKeyspaceCommand}.
21+
*/
22+
export interface UpdateKeyspaceCommandInput extends UpdateKeyspaceRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link UpdateKeyspaceCommand}.
27+
*/
28+
export interface UpdateKeyspaceCommandOutput extends UpdateKeyspaceResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>
32+
* 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.
33+
* 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
34+
* Guide</i>.
35+
* </p>
36+
* <p>To change a single-Region to a multi-Region keyspace, you have to enable client-side timestamps
37+
* for all tables in the keyspace. For more information, see
38+
* <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
39+
* Guide</i>.</p>
40+
* @example
41+
* Use a bare-bones client and the command you need to make an API call.
42+
* ```javascript
43+
* import { KeyspacesClient, UpdateKeyspaceCommand } from "@aws-sdk/client-keyspaces"; // ES Modules import
44+
* // const { KeyspacesClient, UpdateKeyspaceCommand } = require("@aws-sdk/client-keyspaces"); // CommonJS import
45+
* const client = new KeyspacesClient(config);
46+
* const input = { // UpdateKeyspaceRequest
47+
* keyspaceName: "STRING_VALUE", // required
48+
* replicationSpecification: { // ReplicationSpecification
49+
* replicationStrategy: "STRING_VALUE", // required
50+
* regionList: [ // RegionList
51+
* "STRING_VALUE",
52+
* ],
53+
* },
54+
* clientSideTimestamps: { // ClientSideTimestamps
55+
* status: "STRING_VALUE", // required
56+
* },
57+
* };
58+
* const command = new UpdateKeyspaceCommand(input);
59+
* const response = await client.send(command);
60+
* // { // UpdateKeyspaceResponse
61+
* // resourceArn: "STRING_VALUE", // required
62+
* // };
63+
*
64+
* ```
65+
*
66+
* @param UpdateKeyspaceCommandInput - {@link UpdateKeyspaceCommandInput}
67+
* @returns {@link UpdateKeyspaceCommandOutput}
68+
* @see {@link UpdateKeyspaceCommandInput} for command's `input` shape.
69+
* @see {@link UpdateKeyspaceCommandOutput} for command's `response` shape.
70+
* @see {@link KeyspacesClientResolvedConfig | config} for KeyspacesClient's `config` shape.
71+
*
72+
* @throws {@link AccessDeniedException} (client fault)
73+
* <p>You don't have sufficient access permissions to perform this action. </p>
74+
*
75+
* @throws {@link ConflictException} (client fault)
76+
* <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to
77+
* perform an action and the same or a different action is already
78+
* in progress, or if you try to create a resource that already exists. </p>
79+
*
80+
* @throws {@link InternalServerException} (server fault)
81+
* <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
82+
*
83+
* @throws {@link ResourceNotFoundException} (client fault)
84+
* <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly,
85+
* or its status might not be <code>ACTIVE</code>.</p>
86+
*
87+
* @throws {@link ServiceQuotaExceededException} (client fault)
88+
* <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
89+
* Guide</i>.</p>
90+
*
91+
* @throws {@link ValidationException} (client fault)
92+
* <p>The operation failed due to an invalid or malformed request.</p>
93+
*
94+
* @throws {@link KeyspacesServiceException}
95+
* <p>Base exception class for all service exceptions from Keyspaces service.</p>
96+
*
97+
* @public
98+
*/
99+
export class UpdateKeyspaceCommand extends $Command
100+
.classBuilder<
101+
UpdateKeyspaceCommandInput,
102+
UpdateKeyspaceCommandOutput,
103+
KeyspacesClientResolvedConfig,
104+
ServiceInputTypes,
105+
ServiceOutputTypes
106+
>()
107+
.ep(commonParams)
108+
.m(function (this: any, Command: any, cs: any, config: KeyspacesClientResolvedConfig, o: any) {
109+
return [
110+
getSerdePlugin(config, this.serialize, this.deserialize),
111+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
112+
];
113+
})
114+
.s("KeyspacesService", "UpdateKeyspace", {})
115+
.n("KeyspacesClient", "UpdateKeyspaceCommand")
116+
.f(void 0, void 0)
117+
.ser(se_UpdateKeyspaceCommand)
118+
.de(de_UpdateKeyspaceCommand)
119+
.build() {
120+
/** @internal type navigation helper, not in runtime. */
121+
protected declare static __types: {
122+
api: {
123+
input: UpdateKeyspaceRequest;
124+
output: UpdateKeyspaceResponse;
125+
};
126+
sdk: {
127+
input: UpdateKeyspaceCommandInput;
128+
output: UpdateKeyspaceCommandOutput;
129+
};
130+
};
131+
}

clients/client-keyspaces/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export * from "./ListTypesCommand";
1616
export * from "./RestoreTableCommand";
1717
export * from "./TagResourceCommand";
1818
export * from "./UntagResourceCommand";
19+
export * from "./UpdateKeyspaceCommand";
1920
export * from "./UpdateTableCommand";

0 commit comments

Comments
 (0)