Skip to content

Commit dc361a5

Browse files
author
awstools
committed
feat(client-redshift-serverless): Add Table Level Restore operations for Amazon Redshift Serverless. Add multi-port support for Amazon Redshift Serverless endpoints. Add Tagging support to Snapshots and Recovery Points in Amazon Redshift Serverless.
1 parent 009743a commit dc361a5

File tree

12 files changed

+1753
-190
lines changed

12 files changed

+1753
-190
lines changed

clients/client-redshift-serverless/src/RedshiftServerless.ts

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ import {
8787
GetResourcePolicyCommandOutput,
8888
} from "./commands/GetResourcePolicyCommand";
8989
import { GetSnapshotCommand, GetSnapshotCommandInput, GetSnapshotCommandOutput } from "./commands/GetSnapshotCommand";
90+
import {
91+
GetTableRestoreStatusCommand,
92+
GetTableRestoreStatusCommandInput,
93+
GetTableRestoreStatusCommandOutput,
94+
} from "./commands/GetTableRestoreStatusCommand";
9095
import {
9196
GetUsageLimitCommand,
9297
GetUsageLimitCommandInput,
@@ -117,6 +122,11 @@ import {
117122
ListSnapshotsCommandInput,
118123
ListSnapshotsCommandOutput,
119124
} from "./commands/ListSnapshotsCommand";
125+
import {
126+
ListTableRestoreStatusCommand,
127+
ListTableRestoreStatusCommandInput,
128+
ListTableRestoreStatusCommandOutput,
129+
} from "./commands/ListTableRestoreStatusCommand";
120130
import {
121131
ListTagsForResourceCommand,
122132
ListTagsForResourceCommandInput,
@@ -147,6 +157,11 @@ import {
147157
RestoreFromSnapshotCommandInput,
148158
RestoreFromSnapshotCommandOutput,
149159
} from "./commands/RestoreFromSnapshotCommand";
160+
import {
161+
RestoreTableFromSnapshotCommand,
162+
RestoreTableFromSnapshotCommandInput,
163+
RestoreTableFromSnapshotCommandOutput,
164+
} from "./commands/RestoreTableFromSnapshotCommand";
150165
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
151166
import {
152167
UntagResourceCommand,
@@ -591,15 +606,12 @@ export class RedshiftServerless extends RedshiftServerlessClient {
591606
* <p>By default, the temporary credentials expire in 900 seconds.
592607
* You can optionally specify a duration between 900 seconds (15 minutes) and 3600 seconds (60 minutes).</p>
593608
*
594-
* <p>
595-
* The Identity and Access Management (IAM) user or role that runs
596-
* GetCredentials must have an IAM policy attached that allows access to all
597-
* necessary actions and resources.
598-
* </p>
609+
* <p>The Identity and Access Management (IAM) user or role that runs
610+
* GetCredentials must have an IAM policy attached that allows access to all
611+
* necessary actions and resources.</p>
599612
*
600-
* <p>
601-
* If the <code>DbName</code> parameter is specified, the IAM policy must
602-
* allow access to the resource dbname for the specified database name.</p>
613+
* <p>If the <code>DbName</code> parameter is specified, the IAM policy must
614+
* allow access to the resource dbname for the specified database name.</p>
603615
*/
604616
public getCredentials(
605617
args: GetCredentialsCommandInput,
@@ -781,6 +793,38 @@ export class RedshiftServerless extends RedshiftServerlessClient {
781793
}
782794
}
783795

796+
/**
797+
* <p>Returns information about a <code>TableRestoreStatus</code> object.</p>
798+
*/
799+
public getTableRestoreStatus(
800+
args: GetTableRestoreStatusCommandInput,
801+
options?: __HttpHandlerOptions
802+
): Promise<GetTableRestoreStatusCommandOutput>;
803+
public getTableRestoreStatus(
804+
args: GetTableRestoreStatusCommandInput,
805+
cb: (err: any, data?: GetTableRestoreStatusCommandOutput) => void
806+
): void;
807+
public getTableRestoreStatus(
808+
args: GetTableRestoreStatusCommandInput,
809+
options: __HttpHandlerOptions,
810+
cb: (err: any, data?: GetTableRestoreStatusCommandOutput) => void
811+
): void;
812+
public getTableRestoreStatus(
813+
args: GetTableRestoreStatusCommandInput,
814+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetTableRestoreStatusCommandOutput) => void),
815+
cb?: (err: any, data?: GetTableRestoreStatusCommandOutput) => void
816+
): Promise<GetTableRestoreStatusCommandOutput> | void {
817+
const command = new GetTableRestoreStatusCommand(args);
818+
if (typeof optionsOrCb === "function") {
819+
this.send(command, optionsOrCb);
820+
} else if (typeof cb === "function") {
821+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
822+
this.send(command, optionsOrCb || {}, cb);
823+
} else {
824+
return this.send(command, optionsOrCb);
825+
}
826+
}
827+
784828
/**
785829
* <p>Returns information about a usage limit.</p>
786830
*/
@@ -970,6 +1014,38 @@ export class RedshiftServerless extends RedshiftServerlessClient {
9701014
}
9711015
}
9721016

1017+
/**
1018+
* <p>Returns information about an array of <code>TableRestoreStatus</code> objects.</p>
1019+
*/
1020+
public listTableRestoreStatus(
1021+
args: ListTableRestoreStatusCommandInput,
1022+
options?: __HttpHandlerOptions
1023+
): Promise<ListTableRestoreStatusCommandOutput>;
1024+
public listTableRestoreStatus(
1025+
args: ListTableRestoreStatusCommandInput,
1026+
cb: (err: any, data?: ListTableRestoreStatusCommandOutput) => void
1027+
): void;
1028+
public listTableRestoreStatus(
1029+
args: ListTableRestoreStatusCommandInput,
1030+
options: __HttpHandlerOptions,
1031+
cb: (err: any, data?: ListTableRestoreStatusCommandOutput) => void
1032+
): void;
1033+
public listTableRestoreStatus(
1034+
args: ListTableRestoreStatusCommandInput,
1035+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListTableRestoreStatusCommandOutput) => void),
1036+
cb?: (err: any, data?: ListTableRestoreStatusCommandOutput) => void
1037+
): Promise<ListTableRestoreStatusCommandOutput> | void {
1038+
const command = new ListTableRestoreStatusCommand(args);
1039+
if (typeof optionsOrCb === "function") {
1040+
this.send(command, optionsOrCb);
1041+
} else if (typeof cb === "function") {
1042+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1043+
this.send(command, optionsOrCb || {}, cb);
1044+
} else {
1045+
return this.send(command, optionsOrCb);
1046+
}
1047+
}
1048+
9731049
/**
9741050
* <p>Lists the tags assigned to a resource.</p>
9751051
*/
@@ -1162,6 +1238,38 @@ export class RedshiftServerless extends RedshiftServerlessClient {
11621238
}
11631239
}
11641240

1241+
/**
1242+
* <p>Restores a table from a snapshot to your Amazon Redshift Serverless instance.</p>
1243+
*/
1244+
public restoreTableFromSnapshot(
1245+
args: RestoreTableFromSnapshotCommandInput,
1246+
options?: __HttpHandlerOptions
1247+
): Promise<RestoreTableFromSnapshotCommandOutput>;
1248+
public restoreTableFromSnapshot(
1249+
args: RestoreTableFromSnapshotCommandInput,
1250+
cb: (err: any, data?: RestoreTableFromSnapshotCommandOutput) => void
1251+
): void;
1252+
public restoreTableFromSnapshot(
1253+
args: RestoreTableFromSnapshotCommandInput,
1254+
options: __HttpHandlerOptions,
1255+
cb: (err: any, data?: RestoreTableFromSnapshotCommandOutput) => void
1256+
): void;
1257+
public restoreTableFromSnapshot(
1258+
args: RestoreTableFromSnapshotCommandInput,
1259+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: RestoreTableFromSnapshotCommandOutput) => void),
1260+
cb?: (err: any, data?: RestoreTableFromSnapshotCommandOutput) => void
1261+
): Promise<RestoreTableFromSnapshotCommandOutput> | void {
1262+
const command = new RestoreTableFromSnapshotCommand(args);
1263+
if (typeof optionsOrCb === "function") {
1264+
this.send(command, optionsOrCb);
1265+
} else if (typeof cb === "function") {
1266+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1267+
this.send(command, optionsOrCb || {}, cb);
1268+
} else {
1269+
return this.send(command, optionsOrCb);
1270+
}
1271+
}
1272+
11651273
/**
11661274
* <p>Assigns one or more tags to a resource.</p>
11671275
*/

clients/client-redshift-serverless/src/RedshiftServerlessClient.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,20 @@ import { GetNamespaceCommandInput, GetNamespaceCommandOutput } from "./commands/
7777
import { GetRecoveryPointCommandInput, GetRecoveryPointCommandOutput } from "./commands/GetRecoveryPointCommand";
7878
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
7979
import { GetSnapshotCommandInput, GetSnapshotCommandOutput } from "./commands/GetSnapshotCommand";
80+
import {
81+
GetTableRestoreStatusCommandInput,
82+
GetTableRestoreStatusCommandOutput,
83+
} from "./commands/GetTableRestoreStatusCommand";
8084
import { GetUsageLimitCommandInput, GetUsageLimitCommandOutput } from "./commands/GetUsageLimitCommand";
8185
import { GetWorkgroupCommandInput, GetWorkgroupCommandOutput } from "./commands/GetWorkgroupCommand";
8286
import { ListEndpointAccessCommandInput, ListEndpointAccessCommandOutput } from "./commands/ListEndpointAccessCommand";
8387
import { ListNamespacesCommandInput, ListNamespacesCommandOutput } from "./commands/ListNamespacesCommand";
8488
import { ListRecoveryPointsCommandInput, ListRecoveryPointsCommandOutput } from "./commands/ListRecoveryPointsCommand";
8589
import { ListSnapshotsCommandInput, ListSnapshotsCommandOutput } from "./commands/ListSnapshotsCommand";
90+
import {
91+
ListTableRestoreStatusCommandInput,
92+
ListTableRestoreStatusCommandOutput,
93+
} from "./commands/ListTableRestoreStatusCommand";
8694
import {
8795
ListTagsForResourceCommandInput,
8896
ListTagsForResourceCommandOutput,
@@ -98,6 +106,10 @@ import {
98106
RestoreFromSnapshotCommandInput,
99107
RestoreFromSnapshotCommandOutput,
100108
} from "./commands/RestoreFromSnapshotCommand";
109+
import {
110+
RestoreTableFromSnapshotCommandInput,
111+
RestoreTableFromSnapshotCommandOutput,
112+
} from "./commands/RestoreTableFromSnapshotCommand";
101113
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
102114
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
103115
import {
@@ -135,18 +147,21 @@ export type ServiceInputTypes =
135147
| GetRecoveryPointCommandInput
136148
| GetResourcePolicyCommandInput
137149
| GetSnapshotCommandInput
150+
| GetTableRestoreStatusCommandInput
138151
| GetUsageLimitCommandInput
139152
| GetWorkgroupCommandInput
140153
| ListEndpointAccessCommandInput
141154
| ListNamespacesCommandInput
142155
| ListRecoveryPointsCommandInput
143156
| ListSnapshotsCommandInput
157+
| ListTableRestoreStatusCommandInput
144158
| ListTagsForResourceCommandInput
145159
| ListUsageLimitsCommandInput
146160
| ListWorkgroupsCommandInput
147161
| PutResourcePolicyCommandInput
148162
| RestoreFromRecoveryPointCommandInput
149163
| RestoreFromSnapshotCommandInput
164+
| RestoreTableFromSnapshotCommandInput
150165
| TagResourceCommandInput
151166
| UntagResourceCommandInput
152167
| UpdateEndpointAccessCommandInput
@@ -174,18 +189,21 @@ export type ServiceOutputTypes =
174189
| GetRecoveryPointCommandOutput
175190
| GetResourcePolicyCommandOutput
176191
| GetSnapshotCommandOutput
192+
| GetTableRestoreStatusCommandOutput
177193
| GetUsageLimitCommandOutput
178194
| GetWorkgroupCommandOutput
179195
| ListEndpointAccessCommandOutput
180196
| ListNamespacesCommandOutput
181197
| ListRecoveryPointsCommandOutput
182198
| ListSnapshotsCommandOutput
199+
| ListTableRestoreStatusCommandOutput
183200
| ListTagsForResourceCommandOutput
184201
| ListUsageLimitsCommandOutput
185202
| ListWorkgroupsCommandOutput
186203
| PutResourcePolicyCommandOutput
187204
| RestoreFromRecoveryPointCommandOutput
188205
| RestoreFromSnapshotCommandOutput
206+
| RestoreTableFromSnapshotCommandOutput
189207
| TagResourceCommandOutput
190208
| UntagResourceCommandOutput
191209
| UpdateEndpointAccessCommandOutput

clients/client-redshift-serverless/src/commands/GetCredentialsCommand.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ export interface GetCredentialsCommandOutput extends GetCredentialsResponse, __M
3838
* <p>By default, the temporary credentials expire in 900 seconds.
3939
* You can optionally specify a duration between 900 seconds (15 minutes) and 3600 seconds (60 minutes).</p>
4040
*
41-
* <p>
42-
* The Identity and Access Management (IAM) user or role that runs
43-
* GetCredentials must have an IAM policy attached that allows access to all
44-
* necessary actions and resources.
45-
* </p>
41+
* <p>The Identity and Access Management (IAM) user or role that runs
42+
* GetCredentials must have an IAM policy attached that allows access to all
43+
* necessary actions and resources.</p>
4644
*
47-
* <p>
48-
* If the <code>DbName</code> parameter is specified, the IAM policy must
49-
* allow access to the resource dbname for the specified database name.</p>
45+
* <p>If the <code>DbName</code> parameter is specified, the IAM policy must
46+
* allow access to the resource dbname for the specified database name.</p>
5047
* @example
5148
* Use a bare-bones client and the command you need to make an API call.
5249
* ```javascript
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import {
17+
GetTableRestoreStatusRequest,
18+
GetTableRestoreStatusRequestFilterSensitiveLog,
19+
GetTableRestoreStatusResponse,
20+
GetTableRestoreStatusResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_json1_1GetTableRestoreStatusCommand,
24+
serializeAws_json1_1GetTableRestoreStatusCommand,
25+
} from "../protocols/Aws_json1_1";
26+
import {
27+
RedshiftServerlessClientResolvedConfig,
28+
ServiceInputTypes,
29+
ServiceOutputTypes,
30+
} from "../RedshiftServerlessClient";
31+
32+
export interface GetTableRestoreStatusCommandInput extends GetTableRestoreStatusRequest {}
33+
export interface GetTableRestoreStatusCommandOutput extends GetTableRestoreStatusResponse, __MetadataBearer {}
34+
35+
/**
36+
* <p>Returns information about a <code>TableRestoreStatus</code> object.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { RedshiftServerlessClient, GetTableRestoreStatusCommand } from "@aws-sdk/client-redshift-serverless"; // ES Modules import
41+
* // const { RedshiftServerlessClient, GetTableRestoreStatusCommand } = require("@aws-sdk/client-redshift-serverless"); // CommonJS import
42+
* const client = new RedshiftServerlessClient(config);
43+
* const command = new GetTableRestoreStatusCommand(input);
44+
* const response = await client.send(command);
45+
* ```
46+
*
47+
* @see {@link GetTableRestoreStatusCommandInput} for command's `input` shape.
48+
* @see {@link GetTableRestoreStatusCommandOutput} for command's `response` shape.
49+
* @see {@link RedshiftServerlessClientResolvedConfig | config} for RedshiftServerlessClient's `config` shape.
50+
*
51+
*/
52+
export class GetTableRestoreStatusCommand extends $Command<
53+
GetTableRestoreStatusCommandInput,
54+
GetTableRestoreStatusCommandOutput,
55+
RedshiftServerlessClientResolvedConfig
56+
> {
57+
// Start section: command_properties
58+
// End section: command_properties
59+
60+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
61+
return {
62+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
63+
Endpoint: { type: "builtInParams", name: "endpoint" },
64+
Region: { type: "builtInParams", name: "region" },
65+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
66+
};
67+
}
68+
69+
constructor(readonly input: GetTableRestoreStatusCommandInput) {
70+
// Start section: command_constructor
71+
super();
72+
// End section: command_constructor
73+
}
74+
75+
/**
76+
* @internal
77+
*/
78+
resolveMiddleware(
79+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
80+
configuration: RedshiftServerlessClientResolvedConfig,
81+
options?: __HttpHandlerOptions
82+
): Handler<GetTableRestoreStatusCommandInput, GetTableRestoreStatusCommandOutput> {
83+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
84+
this.middlewareStack.use(
85+
getEndpointPlugin(configuration, GetTableRestoreStatusCommand.getEndpointParameterInstructions())
86+
);
87+
88+
const stack = clientStack.concat(this.middlewareStack);
89+
90+
const { logger } = configuration;
91+
const clientName = "RedshiftServerlessClient";
92+
const commandName = "GetTableRestoreStatusCommand";
93+
const handlerExecutionContext: HandlerExecutionContext = {
94+
logger,
95+
clientName,
96+
commandName,
97+
inputFilterSensitiveLog: GetTableRestoreStatusRequestFilterSensitiveLog,
98+
outputFilterSensitiveLog: GetTableRestoreStatusResponseFilterSensitiveLog,
99+
};
100+
const { requestHandler } = configuration;
101+
return stack.resolve(
102+
(request: FinalizeHandlerArguments<any>) =>
103+
requestHandler.handle(request.request as __HttpRequest, options || {}),
104+
handlerExecutionContext
105+
);
106+
}
107+
108+
private serialize(input: GetTableRestoreStatusCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
109+
return serializeAws_json1_1GetTableRestoreStatusCommand(input, context);
110+
}
111+
112+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetTableRestoreStatusCommandOutput> {
113+
return deserializeAws_json1_1GetTableRestoreStatusCommand(output, context);
114+
}
115+
116+
// Start section: command_body_extra
117+
// End section: command_body_extra
118+
}

0 commit comments

Comments
 (0)