/
StopDBClusterCommand.ts
327 lines (316 loc) · 12.1 KB
/
StopDBClusterCommand.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
// 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 { StopDBClusterMessage, StopDBClusterResult } from "../models/models_1";
import { de_StopDBClusterCommand, se_StopDBClusterCommand } from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";
/**
* @public
*
* The input for {@link StopDBClusterCommand}.
*/
export interface StopDBClusterCommandInput extends StopDBClusterMessage {}
/**
* @public
*
* The output of {@link StopDBClusterCommand}.
*/
export interface StopDBClusterCommandOutput extends StopDBClusterResult, __MetadataBearer {}
/**
* @public
* <p>Stops an Amazon Aurora DB cluster. When you stop a DB cluster, Aurora retains the DB cluster's
* metadata, including its endpoints and DB parameter groups. Aurora also
* retains the transaction logs so you can do a point-in-time restore if necessary.</p>
* <p>For more information, see
* <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-cluster-stop-start.html">
* Stopping and Starting an Aurora Cluster</a> in the <i>Amazon Aurora User Guide</i>.</p>
* <note>
* <p>This action only applies to Aurora DB clusters.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RDSClient, StopDBClusterCommand } from "@aws-sdk/client-rds"; // ES Modules import
* // const { RDSClient, StopDBClusterCommand } = require("@aws-sdk/client-rds"); // CommonJS import
* const client = new RDSClient(config);
* const input = { // StopDBClusterMessage
* DBClusterIdentifier: "STRING_VALUE", // required
* };
* const command = new StopDBClusterCommand(input);
* const response = await client.send(command);
* // { // StopDBClusterResult
* // DBCluster: { // 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 StopDBClusterCommandInput - {@link StopDBClusterCommandInput}
* @returns {@link StopDBClusterCommandOutput}
* @see {@link StopDBClusterCommandInput} for command's `input` shape.
* @see {@link StopDBClusterCommandOutput} 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 InvalidDBClusterStateFault} (client fault)
* <p>The requested operation can't be performed while the cluster is in this state.</p>
*
* @throws {@link InvalidDBInstanceStateFault} (client fault)
* <p>The DB instance isn't in a valid state.</p>
*
* @throws {@link RDSServiceException}
* <p>Base exception class for all service exceptions from RDS service.</p>
*
* @example To stop a DB cluster
* ```javascript
* // The following example stops a DB cluster and its DB instances.
* const input = {
* "DBClusterIdentifier": "mydbcluster"
* };
* const command = new StopDBClusterCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "DBCluster": {
* "AllocatedStorage": 1,
* "AvailabilityZones": [
* "us-east-1a",
* "us-east-1e",
* "us-east-1b"
* ],
* "BackupRetentionPeriod": 1,
* "DBClusterIdentifier": "mydbcluster",
* "DatabaseName": "mydb"
* }
* }
* *\/
* // example id: to-stop-a-db-cluster-1679701988603
* ```
*
*/
export class StopDBClusterCommand extends $Command<
StopDBClusterCommandInput,
StopDBClusterCommandOutput,
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: StopDBClusterCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}
/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RDSClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<StopDBClusterCommandInput, StopDBClusterCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getEndpointPlugin(configuration, StopDBClusterCommand.getEndpointParameterInstructions()));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const clientName = "RDSClient";
const commandName = "StopDBClusterCommand";
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: StopDBClusterCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_StopDBClusterCommand(input, context);
}
/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<StopDBClusterCommandOutput> {
return de_StopDBClusterCommand(output, context);
}
// Start section: command_body_extra
// End section: command_body_extra
}