/
DescribeDBClustersCommand.ts
408 lines (397 loc) · 15.5 KB
/
DescribeDBClustersCommand.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { DBClusterMessage, DescribeDBClustersMessage } from "../models/models_0";
import { de_DescribeDBClustersCommand, se_DescribeDBClustersCommand } from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";
/**
* @public
*
* The input for {@link DescribeDBClustersCommand}.
*/
export interface DescribeDBClustersCommandInput extends DescribeDBClustersMessage {}
/**
* @public
*
* The output of {@link DescribeDBClustersCommand}.
*/
export interface DescribeDBClustersCommandOutput extends DBClusterMessage, __MetadataBearer {}
/**
* @public
* <p>Returns information about Amazon Aurora DB clusters and Multi-AZ DB clusters. This API supports pagination.</p>
* <p>For more information on Amazon Aurora DB clusters, see
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">
* What is Amazon Aurora?</a> in the <i>Amazon Aurora User Guide</i>.</p>
* <p>For more information on Multi-AZ DB clusters, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html"> Multi-AZ DB
* cluster deployments</a> in the <i>Amazon RDS User
* Guide</i>.</p>
* <p>This operation can also return information for Amazon Neptune DB instances and Amazon DocumentDB instances.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RDSClient, DescribeDBClustersCommand } from "@aws-sdk/client-rds"; // ES Modules import
* // const { RDSClient, DescribeDBClustersCommand } = require("@aws-sdk/client-rds"); // CommonJS import
* const client = new RDSClient(config);
* const input = { // DescribeDBClustersMessage
* DBClusterIdentifier: "STRING_VALUE",
* Filters: [ // FilterList
* { // Filter
* Name: "STRING_VALUE", // required
* Values: [ // FilterValueList // required
* "STRING_VALUE",
* ],
* },
* ],
* MaxRecords: Number("int"),
* Marker: "STRING_VALUE",
* IncludeShared: true || false,
* };
* const command = new DescribeDBClustersCommand(input);
* const response = await client.send(command);
* // { // DBClusterMessage
* // Marker: "STRING_VALUE",
* // DBClusters: [ // DBClusterList
* // { // DBCluster
* // AllocatedStorage: Number("int"),
* // AvailabilityZones: [ // AvailabilityZones
* // "STRING_VALUE",
* // ],
* // BackupRetentionPeriod: Number("int"),
* // CharacterSetName: "STRING_VALUE",
* // DatabaseName: "STRING_VALUE",
* // DBClusterIdentifier: "STRING_VALUE",
* // DBClusterParameterGroup: "STRING_VALUE",
* // DBSubnetGroup: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // AutomaticRestartTime: new Date("TIMESTAMP"),
* // PercentProgress: "STRING_VALUE",
* // EarliestRestorableTime: new Date("TIMESTAMP"),
* // Endpoint: "STRING_VALUE",
* // ReaderEndpoint: "STRING_VALUE",
* // CustomEndpoints: [ // StringList
* // "STRING_VALUE",
* // ],
* // MultiAZ: true || false,
* // Engine: "STRING_VALUE",
* // EngineVersion: "STRING_VALUE",
* // LatestRestorableTime: new Date("TIMESTAMP"),
* // Port: Number("int"),
* // MasterUsername: "STRING_VALUE",
* // DBClusterOptionGroupMemberships: [ // DBClusterOptionGroupMemberships
* // { // DBClusterOptionGroupStatus
* // DBClusterOptionGroupName: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // },
* // ],
* // PreferredBackupWindow: "STRING_VALUE",
* // PreferredMaintenanceWindow: "STRING_VALUE",
* // ReplicationSourceIdentifier: "STRING_VALUE",
* // ReadReplicaIdentifiers: [ // ReadReplicaIdentifierList
* // "STRING_VALUE",
* // ],
* // DBClusterMembers: [ // DBClusterMemberList
* // { // DBClusterMember
* // DBInstanceIdentifier: "STRING_VALUE",
* // IsClusterWriter: true || false,
* // DBClusterParameterGroupStatus: "STRING_VALUE",
* // PromotionTier: Number("int"),
* // },
* // ],
* // VpcSecurityGroups: [ // VpcSecurityGroupMembershipList
* // { // VpcSecurityGroupMembership
* // VpcSecurityGroupId: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // },
* // ],
* // HostedZoneId: "STRING_VALUE",
* // StorageEncrypted: true || false,
* // KmsKeyId: "STRING_VALUE",
* // DbClusterResourceId: "STRING_VALUE",
* // DBClusterArn: "STRING_VALUE",
* // AssociatedRoles: [ // DBClusterRoles
* // { // DBClusterRole
* // RoleArn: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // FeatureName: "STRING_VALUE",
* // },
* // ],
* // IAMDatabaseAuthenticationEnabled: true || false,
* // CloneGroupId: "STRING_VALUE",
* // ClusterCreateTime: new Date("TIMESTAMP"),
* // EarliestBacktrackTime: new Date("TIMESTAMP"),
* // BacktrackWindow: Number("long"),
* // BacktrackConsumedChangeRecords: Number("long"),
* // EnabledCloudwatchLogsExports: [ // LogTypeList
* // "STRING_VALUE",
* // ],
* // Capacity: Number("int"),
* // EngineMode: "STRING_VALUE",
* // ScalingConfigurationInfo: { // ScalingConfigurationInfo
* // MinCapacity: Number("int"),
* // MaxCapacity: Number("int"),
* // AutoPause: true || false,
* // SecondsUntilAutoPause: Number("int"),
* // TimeoutAction: "STRING_VALUE",
* // SecondsBeforeTimeout: Number("int"),
* // },
* // DeletionProtection: true || false,
* // HttpEndpointEnabled: true || false,
* // ActivityStreamMode: "sync" || "async",
* // ActivityStreamStatus: "stopped" || "starting" || "started" || "stopping",
* // ActivityStreamKmsKeyId: "STRING_VALUE",
* // ActivityStreamKinesisStreamName: "STRING_VALUE",
* // CopyTagsToSnapshot: true || false,
* // CrossAccountClone: true || false,
* // DomainMemberships: [ // DomainMembershipList
* // { // DomainMembership
* // Domain: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // FQDN: "STRING_VALUE",
* // IAMRoleName: "STRING_VALUE",
* // },
* // ],
* // TagList: [ // TagList
* // { // Tag
* // Key: "STRING_VALUE",
* // Value: "STRING_VALUE",
* // },
* // ],
* // GlobalWriteForwardingStatus: "enabled" || "disabled" || "enabling" || "disabling" || "unknown",
* // GlobalWriteForwardingRequested: true || false,
* // PendingModifiedValues: { // ClusterPendingModifiedValues
* // PendingCloudwatchLogsExports: { // PendingCloudwatchLogsExports
* // LogTypesToEnable: [
* // "STRING_VALUE",
* // ],
* // LogTypesToDisable: [
* // "STRING_VALUE",
* // ],
* // },
* // DBClusterIdentifier: "STRING_VALUE",
* // MasterUserPassword: "STRING_VALUE",
* // IAMDatabaseAuthenticationEnabled: true || false,
* // EngineVersion: "STRING_VALUE",
* // BackupRetentionPeriod: Number("int"),
* // AllocatedStorage: Number("int"),
* // Iops: Number("int"),
* // StorageType: "STRING_VALUE",
* // },
* // DBClusterInstanceClass: "STRING_VALUE",
* // StorageType: "STRING_VALUE",
* // Iops: Number("int"),
* // PubliclyAccessible: true || false,
* // AutoMinorVersionUpgrade: true || false,
* // MonitoringInterval: Number("int"),
* // MonitoringRoleArn: "STRING_VALUE",
* // PerformanceInsightsEnabled: true || false,
* // PerformanceInsightsKMSKeyId: "STRING_VALUE",
* // PerformanceInsightsRetentionPeriod: Number("int"),
* // ServerlessV2ScalingConfiguration: { // ServerlessV2ScalingConfigurationInfo
* // MinCapacity: Number("double"),
* // MaxCapacity: Number("double"),
* // },
* // NetworkType: "STRING_VALUE",
* // DBSystemId: "STRING_VALUE",
* // MasterUserSecret: { // MasterUserSecret
* // SecretArn: "STRING_VALUE",
* // SecretStatus: "STRING_VALUE",
* // KmsKeyId: "STRING_VALUE",
* // },
* // IOOptimizedNextAllowedModificationTime: new Date("TIMESTAMP"),
* // },
* // ],
* // };
*
* ```
*
* @param DescribeDBClustersCommandInput - {@link DescribeDBClustersCommandInput}
* @returns {@link DescribeDBClustersCommandOutput}
* @see {@link DescribeDBClustersCommandInput} for command's `input` shape.
* @see {@link DescribeDBClustersCommandOutput} for command's `response` shape.
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
*
* @throws {@link DBClusterNotFoundFault} (client fault)
* <p>
* <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
*
* @throws {@link RDSServiceException}
* <p>Base exception class for all service exceptions from RDS service.</p>
*
* @example To describe a DB cluster
* ```javascript
* // The following example retrieves the details of the specified DB cluster.
* const input = {
* "DBClusterIdentifier": "mydbcluster"
* };
* const command = new DescribeDBClustersCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "DBClusters": [
* {
* "AllocatedStorage": 1,
* "AssociatedRoles": [],
* "AvailabilityZones": [
* "us-east-1a",
* "us-east-1b",
* "us-east-1e"
* ],
* "BackupRetentionPeriod": 1,
* "ClusterCreateTime": "2019-04-15T14:18:42.785Z",
* "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:mydbcluster",
* "DBClusterIdentifier": "mydbcluster",
* "DBClusterMembers": [
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "dbinstance3",
* "IsClusterWriter": false,
* "PromotionTier": 1
* },
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "dbinstance1",
* "IsClusterWriter": false,
* "PromotionTier": 1
* },
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "dbinstance2",
* "IsClusterWriter": false,
* "PromotionTier": 1
* },
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "mydbcluster",
* "IsClusterWriter": false,
* "PromotionTier": 1
* },
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "mydbcluster-us-east-1b",
* "IsClusterWriter": false,
* "PromotionTier": 1
* },
* {
* "DBClusterParameterGroupStatus": "in-sync",
* "DBInstanceIdentifier": "mydbcluster",
* "IsClusterWriter": true,
* "PromotionTier": 1
* }
* ],
* "DBClusterParameterGroup": "default.aurora-mysql5.7",
* "DBSubnetGroup": "default",
* "DatabaseName": "mydbcluster",
* "DbClusterResourceId": "cluster-AKIAIOSFODNN7EXAMPLE",
* "DeletionProtection": false,
* "EarliestRestorableTime": "2019-06-19T09:16:28.210Z",
* "Endpoint": "mydbcluster.cluster-cnpexample.us-east-1.rds.amazonaws.com",
* "Engine": "aurora-mysql",
* "EngineMode": "provisioned",
* "EngineVersion": "5.7.mysql_aurora.2.04.2",
* "HostedZoneId": "Z2R2ITUGPM61AM",
* "HttpEndpointEnabled": false,
* "IAMDatabaseAuthenticationEnabled": false,
* "KmsKeyId": "arn:aws:kms:us-east-1:814387698303:key/AKIAIOSFODNN7EXAMPLE",
* "LatestRestorableTime": "2019-06-20T22:38:14.908Z",
* "MasterUsername": "myadmin",
* "MultiAZ": true,
* "Port": 3306,
* "PreferredBackupWindow": "09:09-09:39",
* "PreferredMaintenanceWindow": "sat:04:09-sat:04:39",
* "ReadReplicaIdentifiers": [],
* "ReaderEndpoint": "mydbcluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com",
* "Status": "available",
* "StorageEncrypted": true,
* "VpcSecurityGroups": [
* {
* "Status": "active",
* "VpcSecurityGroupId": "sg-0b9130572daf3dc16"
* }
* ]
* }
* ]
* }
* *\/
* // example id: to-describe-a-db-cluster-1680215000529
* ```
*
*/
export class DescribeDBClustersCommand extends $Command<
DescribeDBClustersCommandInput,
DescribeDBClustersCommandOutput,
RDSClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}
/**
* @public
*/
constructor(readonly input: DescribeDBClustersCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}
/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RDSClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DescribeDBClustersCommandInput, DescribeDBClustersCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, DescribeDBClustersCommand.getEndpointParameterInstructions())
);
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const clientName = "RDSClient";
const commandName = "DescribeDBClustersCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
/**
* @internal
*/
private serialize(input: DescribeDBClustersCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_DescribeDBClustersCommand(input, context);
}
/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeDBClustersCommandOutput> {
return de_DescribeDBClustersCommand(output, context);
}
// Start section: command_body_extra
// End section: command_body_extra
}