Skip to content

Commit 4c3f4ec

Browse files
author
awstools
committed
feat(client-dsql): Added GetClusterEndpointService API. The new API allows retrieving endpoint service name specific to a cluster.
1 parent 99e54ec commit 4c3f4ec

File tree

8 files changed

+334
-2
lines changed

8 files changed

+334
-2
lines changed

clients/client-dsql/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ GetCluster
251251

252252
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/GetClusterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterCommandOutput/)
253253

254+
</details>
255+
<details>
256+
<summary>
257+
GetVpcEndpointServiceName
258+
</summary>
259+
260+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/GetVpcEndpointServiceNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetVpcEndpointServiceNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetVpcEndpointServiceNameCommandOutput/)
261+
254262
</details>
255263
<details>
256264
<summary>

clients/client-dsql/src/DSQL.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import {
2323
DeleteMultiRegionClustersCommandOutput,
2424
} from "./commands/DeleteMultiRegionClustersCommand";
2525
import { GetClusterCommand, GetClusterCommandInput, GetClusterCommandOutput } from "./commands/GetClusterCommand";
26+
import {
27+
GetVpcEndpointServiceNameCommand,
28+
GetVpcEndpointServiceNameCommandInput,
29+
GetVpcEndpointServiceNameCommandOutput,
30+
} from "./commands/GetVpcEndpointServiceNameCommand";
2631
import {
2732
ListClustersCommand,
2833
ListClustersCommandInput,
@@ -52,6 +57,7 @@ const commands = {
5257
DeleteClusterCommand,
5358
DeleteMultiRegionClustersCommand,
5459
GetClusterCommand,
60+
GetVpcEndpointServiceNameCommand,
5561
ListClustersCommand,
5662
ListTagsForResourceCommand,
5763
TagResourceCommand,
@@ -128,6 +134,23 @@ export interface DSQL {
128134
cb: (err: any, data?: GetClusterCommandOutput) => void
129135
): void;
130136

137+
/**
138+
* @see {@link GetVpcEndpointServiceNameCommand}
139+
*/
140+
getVpcEndpointServiceName(
141+
args: GetVpcEndpointServiceNameCommandInput,
142+
options?: __HttpHandlerOptions
143+
): Promise<GetVpcEndpointServiceNameCommandOutput>;
144+
getVpcEndpointServiceName(
145+
args: GetVpcEndpointServiceNameCommandInput,
146+
cb: (err: any, data?: GetVpcEndpointServiceNameCommandOutput) => void
147+
): void;
148+
getVpcEndpointServiceName(
149+
args: GetVpcEndpointServiceNameCommandInput,
150+
options: __HttpHandlerOptions,
151+
cb: (err: any, data?: GetVpcEndpointServiceNameCommandOutput) => void
152+
): void;
153+
131154
/**
132155
* @see {@link ListClustersCommand}
133156
*/

clients/client-dsql/src/DSQLClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ import {
6464
DeleteMultiRegionClustersCommandOutput,
6565
} from "./commands/DeleteMultiRegionClustersCommand";
6666
import { GetClusterCommandInput, GetClusterCommandOutput } from "./commands/GetClusterCommand";
67+
import {
68+
GetVpcEndpointServiceNameCommandInput,
69+
GetVpcEndpointServiceNameCommandOutput,
70+
} from "./commands/GetVpcEndpointServiceNameCommand";
6771
import { ListClustersCommandInput, ListClustersCommandOutput } from "./commands/ListClustersCommand";
6872
import {
6973
ListTagsForResourceCommandInput,
@@ -92,6 +96,7 @@ export type ServiceInputTypes =
9296
| DeleteClusterCommandInput
9397
| DeleteMultiRegionClustersCommandInput
9498
| GetClusterCommandInput
99+
| GetVpcEndpointServiceNameCommandInput
95100
| ListClustersCommandInput
96101
| ListTagsForResourceCommandInput
97102
| TagResourceCommandInput
@@ -107,6 +112,7 @@ export type ServiceOutputTypes =
107112
| DeleteClusterCommandOutput
108113
| DeleteMultiRegionClustersCommandOutput
109114
| GetClusterCommandOutput
115+
| GetVpcEndpointServiceNameCommandOutput
110116
| ListClustersCommandOutput
111117
| ListTagsForResourceCommandOutput
112118
| TagResourceCommandOutput
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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 { DSQLClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DSQLClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { GetVpcEndpointServiceNameInput, GetVpcEndpointServiceNameOutput } from "../models/models_0";
10+
import { de_GetVpcEndpointServiceNameCommand, se_GetVpcEndpointServiceNameCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetVpcEndpointServiceNameCommand}.
21+
*/
22+
export interface GetVpcEndpointServiceNameCommandInput extends GetVpcEndpointServiceNameInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetVpcEndpointServiceNameCommand}.
27+
*/
28+
export interface GetVpcEndpointServiceNameCommandOutput extends GetVpcEndpointServiceNameOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Retrieves the VPC endpoint service name.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { DSQLClient, GetVpcEndpointServiceNameCommand } from "@aws-sdk/client-dsql"; // ES Modules import
36+
* // const { DSQLClient, GetVpcEndpointServiceNameCommand } = require("@aws-sdk/client-dsql"); // CommonJS import
37+
* const client = new DSQLClient(config);
38+
* const input = { // GetVpcEndpointServiceNameInput
39+
* identifier: "STRING_VALUE", // required
40+
* };
41+
* const command = new GetVpcEndpointServiceNameCommand(input);
42+
* const response = await client.send(command);
43+
* // { // GetVpcEndpointServiceNameOutput
44+
* // serviceName: "STRING_VALUE", // required
45+
* // };
46+
*
47+
* ```
48+
*
49+
* @param GetVpcEndpointServiceNameCommandInput - {@link GetVpcEndpointServiceNameCommandInput}
50+
* @returns {@link GetVpcEndpointServiceNameCommandOutput}
51+
* @see {@link GetVpcEndpointServiceNameCommandInput} for command's `input` shape.
52+
* @see {@link GetVpcEndpointServiceNameCommandOutput} for command's `response` shape.
53+
* @see {@link DSQLClientResolvedConfig | config} for DSQLClient's `config` shape.
54+
*
55+
* @throws {@link InternalServerException} (server fault)
56+
* <p>The request processing has failed because of an unknown error,
57+
* exception or failure.</p>
58+
*
59+
* @throws {@link ResourceNotFoundException} (client fault)
60+
* <p>The resource could not be found.</p>
61+
*
62+
* @throws {@link ThrottlingException} (client fault)
63+
* <p>The request was denied due to request throttling.</p>
64+
*
65+
* @throws {@link ValidationException} (client fault)
66+
* <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
67+
*
68+
* @throws {@link AccessDeniedException} (client fault)
69+
* <p>You do not have sufficient access to perform this action.</p>
70+
*
71+
* @throws {@link DSQLServiceException}
72+
* <p>Base exception class for all service exceptions from DSQL service.</p>
73+
*
74+
*
75+
* @example Get VPC Endpoint Service Name
76+
* ```javascript
77+
* //
78+
* const input = {
79+
* identifier: "kiqenqglxyl2snyvkvnj2c3s2e"
80+
* };
81+
* const command = new GetVpcEndpointServiceNameCommand(input);
82+
* const response = await client.send(command);
83+
* /* response is
84+
* { /* metadata only *\/ }
85+
* *\/
86+
* ```
87+
*
88+
* @public
89+
*/
90+
export class GetVpcEndpointServiceNameCommand extends $Command
91+
.classBuilder<
92+
GetVpcEndpointServiceNameCommandInput,
93+
GetVpcEndpointServiceNameCommandOutput,
94+
DSQLClientResolvedConfig,
95+
ServiceInputTypes,
96+
ServiceOutputTypes
97+
>()
98+
.ep(commonParams)
99+
.m(function (this: any, Command: any, cs: any, config: DSQLClientResolvedConfig, o: any) {
100+
return [
101+
getSerdePlugin(config, this.serialize, this.deserialize),
102+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
103+
];
104+
})
105+
.s("DSQL", "GetVpcEndpointServiceName", {})
106+
.n("DSQLClient", "GetVpcEndpointServiceNameCommand")
107+
.f(void 0, void 0)
108+
.ser(se_GetVpcEndpointServiceNameCommand)
109+
.de(de_GetVpcEndpointServiceNameCommand)
110+
.build() {
111+
/** @internal type navigation helper, not in runtime. */
112+
protected declare static __types: {
113+
api: {
114+
input: GetVpcEndpointServiceNameInput;
115+
output: GetVpcEndpointServiceNameOutput;
116+
};
117+
sdk: {
118+
input: GetVpcEndpointServiceNameCommandInput;
119+
output: GetVpcEndpointServiceNameCommandOutput;
120+
};
121+
};
122+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from "./CreateMultiRegionClustersCommand";
44
export * from "./DeleteClusterCommand";
55
export * from "./DeleteMultiRegionClustersCommand";
66
export * from "./GetClusterCommand";
7+
export * from "./GetVpcEndpointServiceNameCommand";
78
export * from "./ListClustersCommand";
89
export * from "./ListTagsForResourceCommand";
910
export * from "./TagResourceCommand";

clients/client-dsql/src/models/models_0.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,28 @@ export interface GetClusterOutput {
577577
linkedClusterArns?: string[] | undefined;
578578
}
579579

580+
/**
581+
* @public
582+
*/
583+
export interface GetVpcEndpointServiceNameInput {
584+
/**
585+
* <p>The ID of the cluster to retrieve.</p>
586+
* @public
587+
*/
588+
identifier: string | undefined;
589+
}
590+
591+
/**
592+
* @public
593+
*/
594+
export interface GetVpcEndpointServiceNameOutput {
595+
/**
596+
* <p>The VPC endpoint service name.</p>
597+
* @public
598+
*/
599+
serviceName: string | undefined;
600+
}
601+
580602
/**
581603
* @public
582604
*/

clients/client-dsql/src/protocols/Aws_restJson1.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ import {
3737
DeleteMultiRegionClustersCommandOutput,
3838
} from "../commands/DeleteMultiRegionClustersCommand";
3939
import { GetClusterCommandInput, GetClusterCommandOutput } from "../commands/GetClusterCommand";
40+
import {
41+
GetVpcEndpointServiceNameCommandInput,
42+
GetVpcEndpointServiceNameCommandOutput,
43+
} from "../commands/GetVpcEndpointServiceNameCommand";
4044
import { ListClustersCommandInput, ListClustersCommandOutput } from "../commands/ListClustersCommand";
4145
import {
4246
ListTagsForResourceCommandInput,
@@ -160,6 +164,22 @@ export const se_GetClusterCommand = async (
160164
return b.build();
161165
};
162166

167+
/**
168+
* serializeAws_restJson1GetVpcEndpointServiceNameCommand
169+
*/
170+
export const se_GetVpcEndpointServiceNameCommand = async (
171+
input: GetVpcEndpointServiceNameCommandInput,
172+
context: __SerdeContext
173+
): Promise<__HttpRequest> => {
174+
const b = rb(input, context);
175+
const headers: any = {};
176+
b.bp("/clusters/{identifier}/vpc-endpoint-service-name");
177+
b.p("identifier", () => input.identifier!, "{identifier}", false);
178+
let body: any;
179+
b.m("GET").h(headers).b(body);
180+
return b.build();
181+
};
182+
163183
/**
164184
* serializeAws_restJson1ListClustersCommand
165185
*/
@@ -376,6 +396,27 @@ export const de_GetClusterCommand = async (
376396
return contents;
377397
};
378398

399+
/**
400+
* deserializeAws_restJson1GetVpcEndpointServiceNameCommand
401+
*/
402+
export const de_GetVpcEndpointServiceNameCommand = async (
403+
output: __HttpResponse,
404+
context: __SerdeContext
405+
): Promise<GetVpcEndpointServiceNameCommandOutput> => {
406+
if (output.statusCode !== 200 && output.statusCode >= 300) {
407+
return de_CommandError(output, context);
408+
}
409+
const contents: any = map({
410+
$metadata: deserializeMetadata(output),
411+
});
412+
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
413+
const doc = take(data, {
414+
serviceName: __expectString,
415+
});
416+
Object.assign(contents, doc);
417+
return contents;
418+
};
419+
379420
/**
380421
* deserializeAws_restJson1ListClustersCommand
381422
*/

0 commit comments

Comments
 (0)