Skip to content

Commit a8faed6

Browse files
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 b156f65 commit a8faed6

File tree

6 files changed

+56
-4
lines changed

6 files changed

+56
-4
lines changed

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.api.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@
420420
"shape":"JobRunId",
421421
"location":"uri",
422422
"locationName":"jobRunId"
423+
},
424+
"shutdownGracePeriodInSeconds":{
425+
"shape":"ShutdownGracePeriodInSeconds",
426+
"location":"querystring",
427+
"locationName":"shutdownGracePeriodInSeconds"
423428
}
424429
}
425430
},
@@ -594,14 +599,15 @@
594599
},
595600
"EntryPointArgument":{
596601
"type":"string",
597-
"max":10280,
598602
"min":1,
599603
"pattern":".*\\S.*",
600604
"sensitive":true
601605
},
602606
"EntryPointArguments":{
603607
"type":"list",
604-
"member":{"shape":"EntryPointArgument"}
608+
"member":{"shape":"EntryPointArgument"},
609+
"max":1024,
610+
"min":0
605611
},
606612
"EntryPointPath":{
607613
"type":"string",
@@ -1318,6 +1324,10 @@
13181324
},
13191325
"exception":true
13201326
},
1327+
"ShutdownGracePeriodInSeconds":{
1328+
"type":"integer",
1329+
"box":true
1330+
},
13211331
"SparkSubmit":{
13221332
"type":"structure",
13231333
"required":["entryPoint"],

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.docs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,12 @@
815815
"refs": {
816816
}
817817
},
818+
"ShutdownGracePeriodInSeconds": {
819+
"base": null,
820+
"refs": {
821+
"CancelJobRunRequest$shutdownGracePeriodInSeconds": "<p>The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.</p>"
822+
}
823+
},
818824
"SparkSubmit": {
819825
"base": "<p>The configurations for the Spark submit job driver.</p>",
820826
"refs": {

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.normal.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@
544544
"documentation":"<p>The ID of the job run to cancel.</p>",
545545
"location":"uri",
546546
"locationName":"jobRunId"
547+
},
548+
"shutdownGracePeriodInSeconds":{
549+
"shape":"ShutdownGracePeriodInSeconds",
550+
"documentation":"<p>The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.</p>",
551+
"location":"querystring",
552+
"locationName":"shutdownGracePeriodInSeconds"
547553
}
548554
}
549555
},
@@ -817,14 +823,15 @@
817823
},
818824
"EntryPointArgument":{
819825
"type":"string",
820-
"max":10280,
821826
"min":1,
822827
"pattern":".*\\S.*",
823828
"sensitive":true
824829
},
825830
"EntryPointArguments":{
826831
"type":"list",
827-
"member":{"shape":"EntryPointArgument"}
832+
"member":{"shape":"EntryPointArgument"},
833+
"max":1024,
834+
"min":0
828835
},
829836
"EntryPointPath":{
830837
"type":"string",
@@ -1891,6 +1898,10 @@
18911898
},
18921899
"exception":true
18931900
},
1901+
"ShutdownGracePeriodInSeconds":{
1902+
"type":"integer",
1903+
"box":true
1904+
},
18941905
"SparkSubmit":{
18951906
"type":"structure",
18961907
"required":["entryPoint"],

sdk/src/Services/EMRServerless/Generated/Model/CancelJobRunRequest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public partial class CancelJobRunRequest : AmazonEMRServerlessRequest
3737
{
3838
private string _applicationId;
3939
private string _jobRunId;
40+
private int? _shutdownGracePeriodInSeconds;
4041

4142
/// <summary>
4243
/// Gets and sets the property ApplicationId.
@@ -76,5 +77,24 @@ internal bool IsSetJobRunId()
7677
return this._jobRunId != null;
7778
}
7879

80+
/// <summary>
81+
/// Gets and sets the property ShutdownGracePeriodInSeconds.
82+
/// <para>
83+
/// The duration (in seconds) to wait before forcefully terminating the job after cancellation
84+
/// is requested.
85+
/// </para>
86+
/// </summary>
87+
public int ShutdownGracePeriodInSeconds
88+
{
89+
get { return this._shutdownGracePeriodInSeconds.GetValueOrDefault(); }
90+
set { this._shutdownGracePeriodInSeconds = value; }
91+
}
92+
93+
// Check to see if ShutdownGracePeriodInSeconds property is set
94+
internal bool IsSetShutdownGracePeriodInSeconds()
95+
{
96+
return this._shutdownGracePeriodInSeconds.HasValue;
97+
}
98+
7999
}
80100
}

sdk/src/Services/EMRServerless/Generated/Model/Internal/MarshallTransformations/CancelJobRunRequestMarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ public IRequest Marshall(CancelJobRunRequest publicRequest)
6565
if (!publicRequest.IsSetJobRunId())
6666
throw new AmazonEMRServerlessException("Request object does not have required field JobRunId set");
6767
request.AddPathResource("{jobRunId}", StringUtils.FromString(publicRequest.JobRunId));
68+
69+
if (publicRequest.IsSetShutdownGracePeriodInSeconds())
70+
request.Parameters.Add("shutdownGracePeriodInSeconds", StringUtils.FromInt(publicRequest.ShutdownGracePeriodInSeconds));
6871
request.ResourcePath = "/applications/{applicationId}/jobruns/{jobRunId}";
72+
request.UseQueryString = true;
6973

7074
return request;
7175
}

sdk/src/Services/EMRServerless/Generated/Model/SparkSubmit.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ internal bool IsSetEntryPoint()
6363
/// The arguments for the Spark submit job run.
6464
/// </para>
6565
/// </summary>
66+
[AWSProperty(Min=0, Max=1024)]
6667
public List<string> EntryPointArguments
6768
{
6869
get { return this._entryPointArguments; }

0 commit comments

Comments
 (0)