Skip to content

Commit a3fdee6

Browse files
author
awstools
committed
feat(client-redshift-serverless): Add track support for Redshift Serverless workgroup.
1 parent f62fcc0 commit a3fdee6

16 files changed

+805
-7
lines changed

clients/client-redshift-serverless/README.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ using your favorite package manager:
3131

3232
The AWS SDK is modulized by clients and commands.
3333
To send a request, you only need to import the `RedshiftServerlessClient` and
34-
the commands you need, for example `ListNamespacesCommand`:
34+
the commands you need, for example `ListTracksCommand`:
3535

3636
```js
3737
// ES5 example
38-
const { RedshiftServerlessClient, ListNamespacesCommand } = require("@aws-sdk/client-redshift-serverless");
38+
const { RedshiftServerlessClient, ListTracksCommand } = require("@aws-sdk/client-redshift-serverless");
3939
```
4040

4141
```ts
4242
// ES6+ example
43-
import { RedshiftServerlessClient, ListNamespacesCommand } from "@aws-sdk/client-redshift-serverless";
43+
import { RedshiftServerlessClient, ListTracksCommand } from "@aws-sdk/client-redshift-serverless";
4444
```
4545

4646
### Usage
@@ -59,7 +59,7 @@ const client = new RedshiftServerlessClient({ region: "REGION" });
5959
const params = {
6060
/** input parameters */
6161
};
62-
const command = new ListNamespacesCommand(params);
62+
const command = new ListTracksCommand(params);
6363
```
6464

6565
#### Async/await
@@ -138,15 +138,15 @@ const client = new AWS.RedshiftServerless({ region: "REGION" });
138138

139139
// async/await.
140140
try {
141-
const data = await client.listNamespaces(params);
141+
const data = await client.listTracks(params);
142142
// process data.
143143
} catch (error) {
144144
// error handling.
145145
}
146146

147147
// Promises.
148148
client
149-
.listNamespaces(params)
149+
.listTracks(params)
150150
.then((data) => {
151151
// process data.
152152
})
@@ -155,7 +155,7 @@ client
155155
});
156156

157157
// callbacks.
158-
client.listNamespaces(params, (err, data) => {
158+
client.listTracks(params, (err, data) => {
159159
// process err and data.
160160
});
161161
```
@@ -426,6 +426,14 @@ GetTableRestoreStatus
426426

427427
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/redshift-serverless/command/GetTableRestoreStatusCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/GetTableRestoreStatusCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/GetTableRestoreStatusCommandOutput/)
428428

429+
</details>
430+
<details>
431+
<summary>
432+
GetTrack
433+
</summary>
434+
435+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/redshift-serverless/command/GetTrackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/GetTrackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/GetTrackCommandOutput/)
436+
429437
</details>
430438
<details>
431439
<summary>
@@ -522,6 +530,14 @@ ListTagsForResource
522530

523531
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/redshift-serverless/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/ListTagsForResourceCommandOutput/)
524532

533+
</details>
534+
<details>
535+
<summary>
536+
ListTracks
537+
</summary>
538+
539+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/redshift-serverless/command/ListTracksCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/ListTracksCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-redshift-serverless/Interface/ListTracksCommandOutput/)
540+
525541
</details>
526542
<details>
527543
<summary>

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

+27
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ import {
133133
GetTableRestoreStatusCommandInput,
134134
GetTableRestoreStatusCommandOutput,
135135
} from "./commands/GetTableRestoreStatusCommand";
136+
import { GetTrackCommand, GetTrackCommandInput, GetTrackCommandOutput } from "./commands/GetTrackCommand";
136137
import {
137138
GetUsageLimitCommand,
138139
GetUsageLimitCommandInput,
@@ -193,6 +194,7 @@ import {
193194
ListTagsForResourceCommandInput,
194195
ListTagsForResourceCommandOutput,
195196
} from "./commands/ListTagsForResourceCommand";
197+
import { ListTracksCommand, ListTracksCommandInput, ListTracksCommandOutput } from "./commands/ListTracksCommand";
196198
import {
197199
ListUsageLimitsCommand,
198200
ListUsageLimitsCommandInput,
@@ -304,6 +306,7 @@ const commands = {
304306
GetScheduledActionCommand,
305307
GetSnapshotCommand,
306308
GetTableRestoreStatusCommand,
309+
GetTrackCommand,
307310
GetUsageLimitCommand,
308311
GetWorkgroupCommand,
309312
ListCustomDomainAssociationsCommand,
@@ -316,6 +319,7 @@ const commands = {
316319
ListSnapshotsCommand,
317320
ListTableRestoreStatusCommand,
318321
ListTagsForResourceCommand,
322+
ListTracksCommand,
319323
ListUsageLimitsCommand,
320324
ListWorkgroupsCommand,
321325
PutResourcePolicyCommand,
@@ -764,6 +768,17 @@ export interface RedshiftServerless {
764768
cb: (err: any, data?: GetTableRestoreStatusCommandOutput) => void
765769
): void;
766770

771+
/**
772+
* @see {@link GetTrackCommand}
773+
*/
774+
getTrack(args: GetTrackCommandInput, options?: __HttpHandlerOptions): Promise<GetTrackCommandOutput>;
775+
getTrack(args: GetTrackCommandInput, cb: (err: any, data?: GetTrackCommandOutput) => void): void;
776+
getTrack(
777+
args: GetTrackCommandInput,
778+
options: __HttpHandlerOptions,
779+
cb: (err: any, data?: GetTrackCommandOutput) => void
780+
): void;
781+
767782
/**
768783
* @see {@link GetUsageLimitCommand}
769784
*/
@@ -956,6 +971,18 @@ export interface RedshiftServerless {
956971
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
957972
): void;
958973

974+
/**
975+
* @see {@link ListTracksCommand}
976+
*/
977+
listTracks(): Promise<ListTracksCommandOutput>;
978+
listTracks(args: ListTracksCommandInput, options?: __HttpHandlerOptions): Promise<ListTracksCommandOutput>;
979+
listTracks(args: ListTracksCommandInput, cb: (err: any, data?: ListTracksCommandOutput) => void): void;
980+
listTracks(
981+
args: ListTracksCommandInput,
982+
options: __HttpHandlerOptions,
983+
cb: (err: any, data?: ListTracksCommandOutput) => void
984+
): void;
985+
959986
/**
960987
* @see {@link ListUsageLimitsCommand}
961988
*/

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

+6
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ import {
116116
GetTableRestoreStatusCommandInput,
117117
GetTableRestoreStatusCommandOutput,
118118
} from "./commands/GetTableRestoreStatusCommand";
119+
import { GetTrackCommandInput, GetTrackCommandOutput } from "./commands/GetTrackCommand";
119120
import { GetUsageLimitCommandInput, GetUsageLimitCommandOutput } from "./commands/GetUsageLimitCommand";
120121
import { GetWorkgroupCommandInput, GetWorkgroupCommandOutput } from "./commands/GetWorkgroupCommand";
121122
import {
@@ -146,6 +147,7 @@ import {
146147
ListTagsForResourceCommandInput,
147148
ListTagsForResourceCommandOutput,
148149
} from "./commands/ListTagsForResourceCommand";
150+
import { ListTracksCommandInput, ListTracksCommandOutput } from "./commands/ListTracksCommand";
149151
import { ListUsageLimitsCommandInput, ListUsageLimitsCommandOutput } from "./commands/ListUsageLimitsCommand";
150152
import { ListWorkgroupsCommandInput, ListWorkgroupsCommandOutput } from "./commands/ListWorkgroupsCommand";
151153
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
@@ -229,6 +231,7 @@ export type ServiceInputTypes =
229231
| GetScheduledActionCommandInput
230232
| GetSnapshotCommandInput
231233
| GetTableRestoreStatusCommandInput
234+
| GetTrackCommandInput
232235
| GetUsageLimitCommandInput
233236
| GetWorkgroupCommandInput
234237
| ListCustomDomainAssociationsCommandInput
@@ -241,6 +244,7 @@ export type ServiceInputTypes =
241244
| ListSnapshotsCommandInput
242245
| ListTableRestoreStatusCommandInput
243246
| ListTagsForResourceCommandInput
247+
| ListTracksCommandInput
244248
| ListUsageLimitsCommandInput
245249
| ListWorkgroupsCommandInput
246250
| PutResourcePolicyCommandInput
@@ -290,6 +294,7 @@ export type ServiceOutputTypes =
290294
| GetScheduledActionCommandOutput
291295
| GetSnapshotCommandOutput
292296
| GetTableRestoreStatusCommandOutput
297+
| GetTrackCommandOutput
293298
| GetUsageLimitCommandOutput
294299
| GetWorkgroupCommandOutput
295300
| ListCustomDomainAssociationsCommandOutput
@@ -302,6 +307,7 @@ export type ServiceOutputTypes =
302307
| ListSnapshotsCommandOutput
303308
| ListTableRestoreStatusCommandOutput
304309
| ListTagsForResourceCommandOutput
310+
| ListTracksCommandOutput
305311
| ListUsageLimitsCommandOutput
306312
| ListWorkgroupsCommandOutput
307313
| PutResourcePolicyCommandOutput

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

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
8787
* level: Number("int"),
8888
* },
8989
* ipAddressType: "STRING_VALUE",
90+
* trackName: "STRING_VALUE",
9091
* };
9192
* const command = new CreateWorkgroupCommand(input);
9293
* const response = await client.send(command);
@@ -147,6 +148,8 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
147148
* // status: "STRING_VALUE",
148149
* // level: Number("int"),
149150
* // },
151+
* // trackName: "STRING_VALUE",
152+
* // pendingTrackName: "STRING_VALUE",
150153
* // },
151154
* // };
152155
*

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

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export interface DeleteWorkgroupCommandOutput extends DeleteWorkgroupResponse, _
101101
* // status: "STRING_VALUE",
102102
* // level: Number("int"),
103103
* // },
104+
* // trackName: "STRING_VALUE",
105+
* // pendingTrackName: "STRING_VALUE",
104106
* // },
105107
* // };
106108
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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 { GetTrackRequest, GetTrackResponse } from "../models/models_0";
9+
import { de_GetTrackCommand, se_GetTrackCommand } from "../protocols/Aws_json1_1";
10+
import {
11+
RedshiftServerlessClientResolvedConfig,
12+
ServiceInputTypes,
13+
ServiceOutputTypes,
14+
} from "../RedshiftServerlessClient";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link GetTrackCommand}.
25+
*/
26+
export interface GetTrackCommandInput extends GetTrackRequest {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link GetTrackCommand}.
31+
*/
32+
export interface GetTrackCommandOutput extends GetTrackResponse, __MetadataBearer {}
33+
34+
/**
35+
* <p>Get the Redshift Serverless version for a specified track.</p>
36+
* @example
37+
* Use a bare-bones client and the command you need to make an API call.
38+
* ```javascript
39+
* import { RedshiftServerlessClient, GetTrackCommand } from "@aws-sdk/client-redshift-serverless"; // ES Modules import
40+
* // const { RedshiftServerlessClient, GetTrackCommand } = require("@aws-sdk/client-redshift-serverless"); // CommonJS import
41+
* const client = new RedshiftServerlessClient(config);
42+
* const input = { // GetTrackRequest
43+
* trackName: "STRING_VALUE", // required
44+
* };
45+
* const command = new GetTrackCommand(input);
46+
* const response = await client.send(command);
47+
* // { // GetTrackResponse
48+
* // track: { // ServerlessTrack
49+
* // trackName: "STRING_VALUE",
50+
* // workgroupVersion: "STRING_VALUE",
51+
* // updateTargets: [ // UpdateTargetsList
52+
* // { // UpdateTarget
53+
* // trackName: "STRING_VALUE",
54+
* // workgroupVersion: "STRING_VALUE",
55+
* // },
56+
* // ],
57+
* // },
58+
* // };
59+
*
60+
* ```
61+
*
62+
* @param GetTrackCommandInput - {@link GetTrackCommandInput}
63+
* @returns {@link GetTrackCommandOutput}
64+
* @see {@link GetTrackCommandInput} for command's `input` shape.
65+
* @see {@link GetTrackCommandOutput} for command's `response` shape.
66+
* @see {@link RedshiftServerlessClientResolvedConfig | config} for RedshiftServerlessClient's `config` shape.
67+
*
68+
* @throws {@link AccessDeniedException} (client fault)
69+
* <p>You do not have sufficient access to perform this action.</p>
70+
*
71+
* @throws {@link ConflictException} (client fault)
72+
* <p>The submitted action has conflicts.</p>
73+
*
74+
* @throws {@link InternalServerException} (server fault)
75+
* <p>The request processing has failed because of an unknown error, exception or failure.</p>
76+
*
77+
* @throws {@link ResourceNotFoundException} (client fault)
78+
* <p>The resource could not be found.</p>
79+
*
80+
* @throws {@link ThrottlingException} (client fault)
81+
* <p>The request was denied due to request throttling.</p>
82+
*
83+
* @throws {@link ValidationException} (client fault)
84+
* <p>The input failed to satisfy the constraints specified by an AWS service.</p>
85+
*
86+
* @throws {@link RedshiftServerlessServiceException}
87+
* <p>Base exception class for all service exceptions from RedshiftServerless service.</p>
88+
*
89+
* @public
90+
*/
91+
export class GetTrackCommand extends $Command
92+
.classBuilder<
93+
GetTrackCommandInput,
94+
GetTrackCommandOutput,
95+
RedshiftServerlessClientResolvedConfig,
96+
ServiceInputTypes,
97+
ServiceOutputTypes
98+
>()
99+
.ep(commonParams)
100+
.m(function (this: any, Command: any, cs: any, config: RedshiftServerlessClientResolvedConfig, o: any) {
101+
return [
102+
getSerdePlugin(config, this.serialize, this.deserialize),
103+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
104+
];
105+
})
106+
.s("RedshiftServerless", "GetTrack", {})
107+
.n("RedshiftServerlessClient", "GetTrackCommand")
108+
.f(void 0, void 0)
109+
.ser(se_GetTrackCommand)
110+
.de(de_GetTrackCommand)
111+
.build() {
112+
/** @internal type navigation helper, not in runtime. */
113+
protected declare static __types: {
114+
api: {
115+
input: GetTrackRequest;
116+
output: GetTrackResponse;
117+
};
118+
sdk: {
119+
input: GetTrackCommandInput;
120+
output: GetTrackCommandOutput;
121+
};
122+
};
123+
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export interface GetWorkgroupCommandOutput extends GetWorkgroupResponse, __Metad
101101
* // status: "STRING_VALUE",
102102
* // level: Number("int"),
103103
* // },
104+
* // trackName: "STRING_VALUE",
105+
* // pendingTrackName: "STRING_VALUE",
104106
* // },
105107
* // };
106108
*

0 commit comments

Comments
 (0)