Skip to content

Commit 2fc76d4

Browse files
author
awstools
committed
feat(client-rds-data): Add support for the automatic pause/resume feature of Aurora Serverless v2.
1 parent 6dde6f9 commit 2fc76d4

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

clients/client-rds-data/src/commands/BatchExecuteStatementCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ export interface BatchExecuteStatementCommandOutput extends BatchExecuteStatemen
177177
* @throws {@link DatabaseNotFoundException} (client fault)
178178
* <p>The DB cluster doesn't have a DB instance.</p>
179179
*
180+
* @throws {@link DatabaseResumingException} (client fault)
181+
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
182+
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
183+
* try again.</p>
184+
*
180185
* @throws {@link DatabaseUnavailableException} (server fault)
181186
* <p>The writer instance in the DB cluster isn't available.</p>
182187
*

clients/client-rds-data/src/commands/BeginTransactionCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export interface BeginTransactionCommandOutput extends BeginTransactionResponse,
7575
* @throws {@link DatabaseNotFoundException} (client fault)
7676
* <p>The DB cluster doesn't have a DB instance.</p>
7777
*
78+
* @throws {@link DatabaseResumingException} (client fault)
79+
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
80+
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
81+
* try again.</p>
82+
*
7883
* @throws {@link DatabaseUnavailableException} (server fault)
7984
* <p>The writer instance in the DB cluster isn't available.</p>
8085
*

clients/client-rds-data/src/commands/ExecuteStatementCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse,
204204
* @throws {@link DatabaseNotFoundException} (client fault)
205205
* <p>The DB cluster doesn't have a DB instance.</p>
206206
*
207+
* @throws {@link DatabaseResumingException} (client fault)
208+
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
209+
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
210+
* try again.</p>
211+
*
207212
* @throws {@link DatabaseUnavailableException} (server fault)
208213
* <p>The writer instance in the DB cluster isn't available.</p>
209214
*

clients/client-rds-data/src/models/models_0.ts

+22
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,28 @@ export class DatabaseNotFoundException extends __BaseException {
101101
}
102102
}
103103

104+
/**
105+
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
106+
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
107+
* try again.</p>
108+
* @public
109+
*/
110+
export class DatabaseResumingException extends __BaseException {
111+
readonly name: "DatabaseResumingException" = "DatabaseResumingException";
112+
readonly $fault: "client" = "client";
113+
/**
114+
* @internal
115+
*/
116+
constructor(opts: __ExceptionOptionType<DatabaseResumingException, __BaseException>) {
117+
super({
118+
name: "DatabaseResumingException",
119+
$fault: "client",
120+
...opts,
121+
});
122+
Object.setPrototypeOf(this, DatabaseResumingException.prototype);
123+
}
124+
}
125+
104126
/**
105127
* <p>The writer instance in the DB cluster isn't available.</p>
106128
* @public

clients/client-rds-data/src/protocols/Aws_restJson1.ts

+24
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
BadRequestException,
5050
DatabaseErrorException,
5151
DatabaseNotFoundException,
52+
DatabaseResumingException,
5253
DatabaseUnavailableException,
5354
Field,
5455
ForbiddenException,
@@ -382,6 +383,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
382383
case "DatabaseNotFoundException":
383384
case "com.amazonaws.rdsdata#DatabaseNotFoundException":
384385
throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context);
386+
case "DatabaseResumingException":
387+
case "com.amazonaws.rdsdata#DatabaseResumingException":
388+
throw await de_DatabaseResumingExceptionRes(parsedOutput, context);
385389
case "DatabaseUnavailableException":
386390
case "com.amazonaws.rdsdata#DatabaseUnavailableException":
387391
throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context);
@@ -503,6 +507,26 @@ const de_DatabaseNotFoundExceptionRes = async (
503507
return __decorateServiceException(exception, parsedOutput.body);
504508
};
505509

510+
/**
511+
* deserializeAws_restJson1DatabaseResumingExceptionRes
512+
*/
513+
const de_DatabaseResumingExceptionRes = async (
514+
parsedOutput: any,
515+
context: __SerdeContext
516+
): Promise<DatabaseResumingException> => {
517+
const contents: any = map({});
518+
const data: any = parsedOutput.body;
519+
const doc = take(data, {
520+
message: __expectString,
521+
});
522+
Object.assign(contents, doc);
523+
const exception = new DatabaseResumingException({
524+
$metadata: deserializeMetadata(parsedOutput),
525+
...contents,
526+
});
527+
return __decorateServiceException(exception, parsedOutput.body);
528+
};
529+
506530
/**
507531
* deserializeAws_restJson1DatabaseUnavailableExceptionRes
508532
*/

codegen/sdk-codegen/aws-models/rds-data.json

+22
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
{
114114
"target": "com.amazonaws.rdsdata#DatabaseNotFoundException"
115115
},
116+
{
117+
"target": "com.amazonaws.rdsdata#DatabaseResumingException"
118+
},
116119
{
117120
"target": "com.amazonaws.rdsdata#DatabaseUnavailableException"
118121
},
@@ -238,6 +241,9 @@
238241
{
239242
"target": "com.amazonaws.rdsdata#DatabaseNotFoundException"
240243
},
244+
{
245+
"target": "com.amazonaws.rdsdata#DatabaseResumingException"
246+
},
241247
{
242248
"target": "com.amazonaws.rdsdata#DatabaseUnavailableException"
243249
},
@@ -587,6 +593,19 @@
587593
"smithy.api#httpError": 404
588594
}
589595
},
596+
"com.amazonaws.rdsdata#DatabaseResumingException": {
597+
"type": "structure",
598+
"members": {
599+
"message": {
600+
"target": "com.amazonaws.rdsdata#ErrorMessage"
601+
}
602+
},
603+
"traits": {
604+
"smithy.api#documentation": "<p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.\n The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and\n try again.</p>",
605+
"smithy.api#error": "client",
606+
"smithy.api#httpError": 400
607+
}
608+
},
590609
"com.amazonaws.rdsdata#DatabaseUnavailableException": {
591610
"type": "structure",
592611
"members": {},
@@ -745,6 +764,9 @@
745764
{
746765
"target": "com.amazonaws.rdsdata#DatabaseNotFoundException"
747766
},
767+
{
768+
"target": "com.amazonaws.rdsdata#DatabaseResumingException"
769+
},
748770
{
749771
"target": "com.amazonaws.rdsdata#DatabaseUnavailableException"
750772
},

0 commit comments

Comments
 (0)