Skip to content

Commit a04fee3

Browse files
author
awstools
committed
feat(client-emr-serverless): AWS EMR Serverless: Adds a new option in the CancelJobRun API in EMR 7.9.0+, to cancel a job with grace period. This feature is enabled by default with a 120-second grace period for streaming jobs and is not enabled by default for batch jobs.
1 parent fa3d7b9 commit a04fee3

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

clients/client-emr-serverless/src/commands/CancelJobRunCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface CancelJobRunCommandOutput extends CancelJobRunResponse, __Metad
3838
* const input = { // CancelJobRunRequest
3939
* applicationId: "STRING_VALUE", // required
4040
* jobRunId: "STRING_VALUE", // required
41+
* shutdownGracePeriodInSeconds: Number("int"),
4142
* };
4243
* const command = new CancelJobRunCommand(input);
4344
* const response = await client.send(command);

clients/client-emr-serverless/src/models/models_0.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,12 @@ export interface CancelJobRunRequest {
663663
* @public
664664
*/
665665
jobRunId: string | undefined;
666+
667+
/**
668+
* The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.
669+
* @public
670+
*/
671+
shutdownGracePeriodInSeconds?: number | undefined;
666672
}
667673

668674
/**

clients/client-emr-serverless/src/protocols/Aws_restJson1.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ export const se_CancelJobRunCommand = async (
105105
b.bp("/applications/{applicationId}/jobruns/{jobRunId}");
106106
b.p("applicationId", () => input.applicationId!, "{applicationId}", false);
107107
b.p("jobRunId", () => input.jobRunId!, "{jobRunId}", false);
108+
const query: any = map({
109+
[_sGPIS]: [() => input.shutdownGracePeriodInSeconds !== void 0, () => input[_sGPIS]!.toString()],
110+
});
108111
let body: any;
109-
b.m("DELETE").h(headers).b(body);
112+
b.m("DELETE").h(headers).q(query).b(body);
110113
return b.build();
111114
};
112115

@@ -1287,4 +1290,5 @@ const _m = "mode";
12871290
const _mR = "maxResults";
12881291
const _nT = "nextToken";
12891292
const _s = "states";
1293+
const _sGPIS = "shutdownGracePeriodInSeconds";
12901294
const _tK = "tagKeys";

codegen/sdk-codegen/aws-models/emr-serverless.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,14 @@
11941194
"smithy.api#required": {},
11951195
"smithy.api#resourceIdentifier": "jobRunId"
11961196
}
1197+
},
1198+
"shutdownGracePeriodInSeconds": {
1199+
"target": "com.amazonaws.emrserverless#ShutdownGracePeriodInSeconds",
1200+
"traits": {
1201+
"smithy.api#default": null,
1202+
"smithy.api#documentation": "The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.",
1203+
"smithy.api#httpQuery": "shutdownGracePeriodInSeconds"
1204+
}
11971205
}
11981206
}
11991207
},
@@ -1638,8 +1646,7 @@
16381646
"type": "string",
16391647
"traits": {
16401648
"smithy.api#length": {
1641-
"min": 1,
1642-
"max": 10280
1649+
"min": 1
16431650
},
16441651
"smithy.api#pattern": ".*\\S.*",
16451652
"smithy.api#sensitive": {}
@@ -1649,6 +1656,12 @@
16491656
"type": "list",
16501657
"member": {
16511658
"target": "com.amazonaws.emrserverless#EntryPointArgument"
1659+
},
1660+
"traits": {
1661+
"smithy.api#length": {
1662+
"min": 0,
1663+
"max": 1024
1664+
}
16521665
}
16531666
},
16541667
"com.amazonaws.emrserverless#EntryPointPath": {
@@ -3401,6 +3414,9 @@
34013414
"smithy.api#httpError": 402
34023415
}
34033416
},
3417+
"com.amazonaws.emrserverless#ShutdownGracePeriodInSeconds": {
3418+
"type": "integer"
3419+
},
34043420
"com.amazonaws.emrserverless#SparkSubmit": {
34053421
"type": "structure",
34063422
"members": {

0 commit comments

Comments
 (0)