Skip to content

Commit 572bc93

Browse files
author
awstools
committedMay 30, 2024
feat(client-emr-serverless): The release adds support for spark structured streaming.
1 parent c87de6a commit 572bc93

14 files changed

+4552
-3644
lines changed
 

‎clients/client-emr-serverless/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ ListApplications
278278

279279
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/emr-serverless/command/ListApplicationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-emr-serverless/Interface/ListApplicationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-emr-serverless/Interface/ListApplicationsCommandOutput/)
280280

281+
</details>
282+
<details>
283+
<summary>
284+
ListJobRunAttempts
285+
</summary>
286+
287+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/emr-serverless/command/ListJobRunAttemptsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-emr-serverless/Interface/ListJobRunAttemptsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-emr-serverless/Interface/ListJobRunAttemptsCommandOutput/)
288+
281289
</details>
282290
<details>
283291
<summary>

‎clients/client-emr-serverless/src/EMRServerless.ts

+23
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ import {
3333
ListApplicationsCommandInput,
3434
ListApplicationsCommandOutput,
3535
} from "./commands/ListApplicationsCommand";
36+
import {
37+
ListJobRunAttemptsCommand,
38+
ListJobRunAttemptsCommandInput,
39+
ListJobRunAttemptsCommandOutput,
40+
} from "./commands/ListJobRunAttemptsCommand";
3641
import { ListJobRunsCommand, ListJobRunsCommandInput, ListJobRunsCommandOutput } from "./commands/ListJobRunsCommand";
3742
import {
3843
ListTagsForResourceCommand,
@@ -71,6 +76,7 @@ const commands = {
7176
GetDashboardForJobRunCommand,
7277
GetJobRunCommand,
7378
ListApplicationsCommand,
79+
ListJobRunAttemptsCommand,
7480
ListJobRunsCommand,
7581
ListTagsForResourceCommand,
7682
StartApplicationCommand,
@@ -187,6 +193,23 @@ export interface EMRServerless {
187193
cb: (err: any, data?: ListApplicationsCommandOutput) => void
188194
): void;
189195

196+
/**
197+
* @see {@link ListJobRunAttemptsCommand}
198+
*/
199+
listJobRunAttempts(
200+
args: ListJobRunAttemptsCommandInput,
201+
options?: __HttpHandlerOptions
202+
): Promise<ListJobRunAttemptsCommandOutput>;
203+
listJobRunAttempts(
204+
args: ListJobRunAttemptsCommandInput,
205+
cb: (err: any, data?: ListJobRunAttemptsCommandOutput) => void
206+
): void;
207+
listJobRunAttempts(
208+
args: ListJobRunAttemptsCommandInput,
209+
options: __HttpHandlerOptions,
210+
cb: (err: any, data?: ListJobRunAttemptsCommandOutput) => void
211+
): void;
212+
190213
/**
191214
* @see {@link ListJobRunsCommand}
192215
*/

‎clients/client-emr-serverless/src/EMRServerlessClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
} from "./commands/GetDashboardForJobRunCommand";
6464
import { GetJobRunCommandInput, GetJobRunCommandOutput } from "./commands/GetJobRunCommand";
6565
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand";
66+
import { ListJobRunAttemptsCommandInput, ListJobRunAttemptsCommandOutput } from "./commands/ListJobRunAttemptsCommand";
6667
import { ListJobRunsCommandInput, ListJobRunsCommandOutput } from "./commands/ListJobRunsCommand";
6768
import {
6869
ListTagsForResourceCommandInput,
@@ -96,6 +97,7 @@ export type ServiceInputTypes =
9697
| GetDashboardForJobRunCommandInput
9798
| GetJobRunCommandInput
9899
| ListApplicationsCommandInput
100+
| ListJobRunAttemptsCommandInput
99101
| ListJobRunsCommandInput
100102
| ListTagsForResourceCommandInput
101103
| StartApplicationCommandInput
@@ -116,6 +118,7 @@ export type ServiceOutputTypes =
116118
| GetDashboardForJobRunCommandOutput
117119
| GetJobRunCommandOutput
118120
| ListApplicationsCommandOutput
121+
| ListJobRunAttemptsCommandOutput
119122
| ListJobRunsCommandOutput
120123
| ListTagsForResourceCommandOutput
121124
| StartApplicationCommandOutput

‎clients/client-emr-serverless/src/commands/GetDashboardForJobRunCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export interface GetDashboardForJobRunCommandOutput extends GetDashboardForJobRu
4545
* const input = { // GetDashboardForJobRunRequest
4646
* applicationId: "STRING_VALUE", // required
4747
* jobRunId: "STRING_VALUE", // required
48+
* attempt: Number("int"),
4849
* };
4950
* const command = new GetDashboardForJobRunCommand(input);
5051
* const response = await client.send(command);

‎clients/client-emr-serverless/src/commands/GetJobRunCommand.ts

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export interface GetJobRunCommandOutput extends GetJobRunResponse, __MetadataBea
3737
* const input = { // GetJobRunRequest
3838
* applicationId: "STRING_VALUE", // required
3939
* jobRunId: "STRING_VALUE", // required
40+
* attempt: Number("int"),
4041
* };
4142
* const command = new GetJobRunCommand(input);
4243
* const response = await client.send(command);
@@ -133,6 +134,14 @@ export interface GetJobRunCommandOutput extends GetJobRunResponse, __MetadataBea
133134
* // memoryGBHour: Number("double"),
134135
* // storageGBHour: Number("double"),
135136
* // },
137+
* // mode: "STRING_VALUE",
138+
* // retryPolicy: { // RetryPolicy
139+
* // maxAttempts: Number("int"),
140+
* // maxFailedAttemptsPerHour: Number("int"),
141+
* // },
142+
* // attempt: Number("int"),
143+
* // attemptCreatedAt: new Date("TIMESTAMP"),
144+
* // attemptUpdatedAt: new Date("TIMESTAMP"),
136145
* // },
137146
* // };
138147
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { EMRServerlessClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EMRServerlessClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ListJobRunAttemptsRequest, ListJobRunAttemptsResponse } from "../models/models_0";
10+
import { de_ListJobRunAttemptsCommand, se_ListJobRunAttemptsCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link ListJobRunAttemptsCommand}.
20+
*/
21+
export interface ListJobRunAttemptsCommandInput extends ListJobRunAttemptsRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link ListJobRunAttemptsCommand}.
26+
*/
27+
export interface ListJobRunAttemptsCommandOutput extends ListJobRunAttemptsResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Lists all attempt of a job run.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { EMRServerlessClient, ListJobRunAttemptsCommand } from "@aws-sdk/client-emr-serverless"; // ES Modules import
35+
* // const { EMRServerlessClient, ListJobRunAttemptsCommand } = require("@aws-sdk/client-emr-serverless"); // CommonJS import
36+
* const client = new EMRServerlessClient(config);
37+
* const input = { // ListJobRunAttemptsRequest
38+
* applicationId: "STRING_VALUE", // required
39+
* jobRunId: "STRING_VALUE", // required
40+
* nextToken: "STRING_VALUE",
41+
* maxResults: Number("int"),
42+
* };
43+
* const command = new ListJobRunAttemptsCommand(input);
44+
* const response = await client.send(command);
45+
* // { // ListJobRunAttemptsResponse
46+
* // jobRunAttempts: [ // JobRunAttempts // required
47+
* // { // JobRunAttemptSummary
48+
* // applicationId: "STRING_VALUE", // required
49+
* // id: "STRING_VALUE", // required
50+
* // name: "STRING_VALUE",
51+
* // mode: "STRING_VALUE",
52+
* // arn: "STRING_VALUE", // required
53+
* // createdBy: "STRING_VALUE", // required
54+
* // jobCreatedAt: new Date("TIMESTAMP"), // required
55+
* // createdAt: new Date("TIMESTAMP"), // required
56+
* // updatedAt: new Date("TIMESTAMP"), // required
57+
* // executionRole: "STRING_VALUE", // required
58+
* // state: "STRING_VALUE", // required
59+
* // stateDetails: "STRING_VALUE", // required
60+
* // releaseLabel: "STRING_VALUE", // required
61+
* // type: "STRING_VALUE",
62+
* // attempt: Number("int"),
63+
* // },
64+
* // ],
65+
* // nextToken: "STRING_VALUE",
66+
* // };
67+
*
68+
* ```
69+
*
70+
* @param ListJobRunAttemptsCommandInput - {@link ListJobRunAttemptsCommandInput}
71+
* @returns {@link ListJobRunAttemptsCommandOutput}
72+
* @see {@link ListJobRunAttemptsCommandInput} for command's `input` shape.
73+
* @see {@link ListJobRunAttemptsCommandOutput} for command's `response` shape.
74+
* @see {@link EMRServerlessClientResolvedConfig | config} for EMRServerlessClient's `config` shape.
75+
*
76+
* @throws {@link InternalServerException} (server fault)
77+
* <p>Request processing failed because of an error or failure with the service.</p>
78+
*
79+
* @throws {@link ResourceNotFoundException} (client fault)
80+
* <p>The specified resource was not found.</p>
81+
*
82+
* @throws {@link ValidationException} (client fault)
83+
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
84+
* service.</p>
85+
*
86+
* @throws {@link EMRServerlessServiceException}
87+
* <p>Base exception class for all service exceptions from EMRServerless service.</p>
88+
*
89+
* @public
90+
*/
91+
export class ListJobRunAttemptsCommand extends $Command
92+
.classBuilder<
93+
ListJobRunAttemptsCommandInput,
94+
ListJobRunAttemptsCommandOutput,
95+
EMRServerlessClientResolvedConfig,
96+
ServiceInputTypes,
97+
ServiceOutputTypes
98+
>()
99+
.ep({
100+
...commonParams,
101+
})
102+
.m(function (this: any, Command: any, cs: any, config: EMRServerlessClientResolvedConfig, o: any) {
103+
return [
104+
getSerdePlugin(config, this.serialize, this.deserialize),
105+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
106+
];
107+
})
108+
.s("AwsToledoWebService", "ListJobRunAttempts", {})
109+
.n("EMRServerlessClient", "ListJobRunAttemptsCommand")
110+
.f(void 0, void 0)
111+
.ser(se_ListJobRunAttemptsCommand)
112+
.de(de_ListJobRunAttemptsCommand)
113+
.build() {}

‎clients/client-emr-serverless/src/commands/ListJobRunsCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface ListJobRunsCommandOutput extends ListJobRunsResponse, __Metadat
4343
* states: [ // JobRunStateSet
4444
* "STRING_VALUE",
4545
* ],
46+
* mode: "STRING_VALUE",
4647
* };
4748
* const command = new ListJobRunsCommand(input);
4849
* const response = await client.send(command);
@@ -52,6 +53,7 @@ export interface ListJobRunsCommandOutput extends ListJobRunsResponse, __Metadat
5253
* // applicationId: "STRING_VALUE", // required
5354
* // id: "STRING_VALUE", // required
5455
* // name: "STRING_VALUE",
56+
* // mode: "STRING_VALUE",
5557
* // arn: "STRING_VALUE", // required
5658
* // createdBy: "STRING_VALUE", // required
5759
* // createdAt: new Date("TIMESTAMP"), // required
@@ -61,6 +63,9 @@ export interface ListJobRunsCommandOutput extends ListJobRunsResponse, __Metadat
6163
* // stateDetails: "STRING_VALUE", // required
6264
* // releaseLabel: "STRING_VALUE", // required
6365
* // type: "STRING_VALUE",
66+
* // attempt: Number("int"),
67+
* // attemptCreatedAt: new Date("TIMESTAMP"),
68+
* // attemptUpdatedAt: new Date("TIMESTAMP"),
6469
* // },
6570
* // ],
6671
* // nextToken: "STRING_VALUE",

‎clients/client-emr-serverless/src/commands/StartJobRunCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ export interface StartJobRunCommandOutput extends StartJobRunResponse, __Metadat
100100
* },
101101
* executionTimeoutMinutes: Number("long"),
102102
* name: "STRING_VALUE",
103+
* mode: "STRING_VALUE",
104+
* retryPolicy: { // RetryPolicy
105+
* maxAttempts: Number("int"),
106+
* maxFailedAttemptsPerHour: Number("int"),
107+
* },
103108
* };
104109
* const command = new StartJobRunCommand(input);
105110
* const response = await client.send(command);

‎clients/client-emr-serverless/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export * from "./GetApplicationCommand";
66
export * from "./GetDashboardForJobRunCommand";
77
export * from "./GetJobRunCommand";
88
export * from "./ListApplicationsCommand";
9+
export * from "./ListJobRunAttemptsCommand";
910
export * from "./ListJobRunsCommand";
1011
export * from "./ListTagsForResourceCommand";
1112
export * from "./StartApplicationCommand";

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

+261
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,13 @@ export interface GetDashboardForJobRunRequest {
718718
* @public
719719
*/
720720
jobRunId: string | undefined;
721+
722+
/**
723+
* <p>An optimal parameter that indicates the amount of attempts for the job. If not specified,
724+
* this value defaults to the attempt of the latest job.</p>
725+
* @public
726+
*/
727+
attempt?: number;
721728
}
722729

723730
/**
@@ -746,6 +753,13 @@ export interface GetJobRunRequest {
746753
* @public
747754
*/
748755
jobRunId: string | undefined;
756+
757+
/**
758+
* <p>An optimal parameter that indicates the amount of attempts for the job. If not specified,
759+
* this value defaults to the attempt of the latest job.</p>
760+
* @public
761+
*/
762+
attempt?: number;
749763
}
750764

751765
/**
@@ -875,6 +889,38 @@ export namespace JobDriver {
875889
};
876890
}
877891

892+
/**
893+
* @public
894+
* @enum
895+
*/
896+
export const JobRunMode = {
897+
BATCH: "BATCH",
898+
STREAMING: "STREAMING",
899+
} as const;
900+
901+
/**
902+
* @public
903+
*/
904+
export type JobRunMode = (typeof JobRunMode)[keyof typeof JobRunMode];
905+
906+
/**
907+
* <p>The retry policy to use for a job run.</p>
908+
* @public
909+
*/
910+
export interface RetryPolicy {
911+
/**
912+
* <p>Maximum number of attempts for the job run. This parameter is only applicable for <code>BATCH</code> mode.</p>
913+
* @public
914+
*/
915+
maxAttempts?: number;
916+
917+
/**
918+
* <p>Maximum number of failed attempts per hour. This [arameter is only applicable for <code>STREAMING</code> mode.</p>
919+
* @public
920+
*/
921+
maxFailedAttemptsPerHour?: number;
922+
}
923+
878924
/**
879925
* @public
880926
* @enum
@@ -923,6 +969,149 @@ export interface TotalResourceUtilization {
923969
storageGBHour?: number;
924970
}
925971

972+
/**
973+
* @public
974+
*/
975+
export interface ListJobRunAttemptsRequest {
976+
/**
977+
* <p>The ID of the application for which to list job runs.</p>
978+
* @public
979+
*/
980+
applicationId: string | undefined;
981+
982+
/**
983+
* <p>The ID of the job run to list.</p>
984+
* @public
985+
*/
986+
jobRunId: string | undefined;
987+
988+
/**
989+
* <p>The token for the next set of job run attempt results.</p>
990+
* @public
991+
*/
992+
nextToken?: string;
993+
994+
/**
995+
* <p>The maximum number of job run attempts to list.</p>
996+
* @public
997+
*/
998+
maxResults?: number;
999+
}
1000+
1001+
/**
1002+
* <p>The summary of attributes associated with a job run attempt.</p>
1003+
* @public
1004+
*/
1005+
export interface JobRunAttemptSummary {
1006+
/**
1007+
* <p>The ID of the application the job is running on.</p>
1008+
* @public
1009+
*/
1010+
applicationId: string | undefined;
1011+
1012+
/**
1013+
* <p>The ID of the job run attempt.</p>
1014+
* @public
1015+
*/
1016+
id: string | undefined;
1017+
1018+
/**
1019+
* <p>The name of the job run attempt.</p>
1020+
* @public
1021+
*/
1022+
name?: string;
1023+
1024+
/**
1025+
* <p>The mode of the job run attempt.</p>
1026+
* @public
1027+
*/
1028+
mode?: JobRunMode;
1029+
1030+
/**
1031+
* <p>The Amazon Resource Name (ARN) of the job run.</p>
1032+
* @public
1033+
*/
1034+
arn: string | undefined;
1035+
1036+
/**
1037+
* <p>The user who created the job run.</p>
1038+
* @public
1039+
*/
1040+
createdBy: string | undefined;
1041+
1042+
/**
1043+
* <p>The date and time of when the job run was created.</p>
1044+
* @public
1045+
*/
1046+
jobCreatedAt: Date | undefined;
1047+
1048+
/**
1049+
* <p>The date and time when the job run attempt was created.</p>
1050+
* @public
1051+
*/
1052+
createdAt: Date | undefined;
1053+
1054+
/**
1055+
* <p>The date and time of when the job run attempt was last updated.</p>
1056+
* @public
1057+
*/
1058+
updatedAt: Date | undefined;
1059+
1060+
/**
1061+
* <p>The Amazon Resource Name (ARN) of the execution role of the job run..</p>
1062+
* @public
1063+
*/
1064+
executionRole: string | undefined;
1065+
1066+
/**
1067+
* <p>The state of the job run attempt.</p>
1068+
* @public
1069+
*/
1070+
state: JobRunState | undefined;
1071+
1072+
/**
1073+
* <p>The state details of the job run attempt.</p>
1074+
* @public
1075+
*/
1076+
stateDetails: string | undefined;
1077+
1078+
/**
1079+
* <p>The Amazon EMR release label of the job run attempt.</p>
1080+
* @public
1081+
*/
1082+
releaseLabel: string | undefined;
1083+
1084+
/**
1085+
* <p>The type of the job run, such as Spark or Hive.</p>
1086+
* @public
1087+
*/
1088+
type?: string;
1089+
1090+
/**
1091+
* <p>The attempt number of the job run execution.</p>
1092+
* @public
1093+
*/
1094+
attempt?: number;
1095+
}
1096+
1097+
/**
1098+
* @public
1099+
*/
1100+
export interface ListJobRunAttemptsResponse {
1101+
/**
1102+
* <p>The array of the listed job run attempt objects.</p>
1103+
* @public
1104+
*/
1105+
jobRunAttempts: JobRunAttemptSummary[] | undefined;
1106+
1107+
/**
1108+
* <p>The output displays the token for the next set of application results.
1109+
* This is required for pagination and is available as a response of the previous request.</p>
1110+
* @public
1111+
*/
1112+
nextToken?: string;
1113+
}
1114+
9261115
/**
9271116
* @public
9281117
*/
@@ -963,6 +1152,12 @@ export interface ListJobRunsRequest {
9631152
* @public
9641153
*/
9651154
states?: JobRunState[];
1155+
1156+
/**
1157+
* <p>The mode of the job runs to list.</p>
1158+
* @public
1159+
*/
1160+
mode?: JobRunMode;
9661161
}
9671162

9681163
/**
@@ -988,6 +1183,12 @@ export interface JobRunSummary {
9881183
*/
9891184
name?: string;
9901185

1186+
/**
1187+
* <p>The mode of the job run.</p>
1188+
* @public
1189+
*/
1190+
mode?: JobRunMode;
1191+
9911192
/**
9921193
* <p>The ARN of the job run.</p>
9931194
* @public
@@ -1042,6 +1243,24 @@ export interface JobRunSummary {
10421243
* @public
10431244
*/
10441245
type?: string;
1246+
1247+
/**
1248+
* <p>The attempt number of the job run execution.</p>
1249+
* @public
1250+
*/
1251+
attempt?: number;
1252+
1253+
/**
1254+
* <p>The date and time of when the job run attempt was created.</p>
1255+
* @public
1256+
*/
1257+
attemptCreatedAt?: Date;
1258+
1259+
/**
1260+
* <p>The date and time of when the job run attempt was last updated.</p>
1261+
* @public
1262+
*/
1263+
attemptUpdatedAt?: Date;
10451264
}
10461265

10471266
/**
@@ -1701,6 +1920,36 @@ export interface JobRun {
17011920
* @public
17021921
*/
17031922
billedResourceUtilization?: ResourceUtilization;
1923+
1924+
/**
1925+
* <p>The mode of the job run.</p>
1926+
* @public
1927+
*/
1928+
mode?: JobRunMode;
1929+
1930+
/**
1931+
* <p>The retry policy of the job run.</p>
1932+
* @public
1933+
*/
1934+
retryPolicy?: RetryPolicy;
1935+
1936+
/**
1937+
* <p>The attempt of the job run.</p>
1938+
* @public
1939+
*/
1940+
attempt?: number;
1941+
1942+
/**
1943+
* <p>The date and time of when the job run attempt was created.</p>
1944+
* @public
1945+
*/
1946+
attemptCreatedAt?: Date;
1947+
1948+
/**
1949+
* <p>The date and time of when the job run attempt was last updated.</p>
1950+
* @public
1951+
*/
1952+
attemptUpdatedAt?: Date;
17041953
}
17051954

17061955
/**
@@ -1756,6 +2005,18 @@ export interface StartJobRunRequest {
17562005
* @public
17572006
*/
17582007
name?: string;
2008+
2009+
/**
2010+
* <p>The mode of the job run when it starts.</p>
2011+
* @public
2012+
*/
2013+
mode?: JobRunMode;
2014+
2015+
/**
2016+
* <p>The retry policy when job run starts.</p>
2017+
* @public
2018+
*/
2019+
retryPolicy?: RetryPolicy;
17592020
}
17602021

17612022
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// smithy-typescript generated code
2+
import { createPaginator } from "@smithy/core";
3+
import { Paginator } from "@smithy/types";
4+
5+
import {
6+
ListJobRunAttemptsCommand,
7+
ListJobRunAttemptsCommandInput,
8+
ListJobRunAttemptsCommandOutput,
9+
} from "../commands/ListJobRunAttemptsCommand";
10+
import { EMRServerlessClient } from "../EMRServerlessClient";
11+
import { EMRServerlessPaginationConfiguration } from "./Interfaces";
12+
13+
/**
14+
* @public
15+
*/
16+
export const paginateListJobRunAttempts: (
17+
config: EMRServerlessPaginationConfiguration,
18+
input: ListJobRunAttemptsCommandInput,
19+
...rest: any[]
20+
) => Paginator<ListJobRunAttemptsCommandOutput> = createPaginator<
21+
EMRServerlessPaginationConfiguration,
22+
ListJobRunAttemptsCommandInput,
23+
ListJobRunAttemptsCommandOutput
24+
>(EMRServerlessClient, ListJobRunAttemptsCommand, "nextToken", "nextToken", "maxResults");
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
22
export * from "./Interfaces";
33
export * from "./ListApplicationsPaginator";
4+
export * from "./ListJobRunAttemptsPaginator";
45
export * from "./ListJobRunsPaginator";

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

+107-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
} from "../commands/GetDashboardForJobRunCommand";
4444
import { GetJobRunCommandInput, GetJobRunCommandOutput } from "../commands/GetJobRunCommand";
4545
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "../commands/ListApplicationsCommand";
46+
import { ListJobRunAttemptsCommandInput, ListJobRunAttemptsCommandOutput } from "../commands/ListJobRunAttemptsCommand";
4647
import { ListJobRunsCommandInput, ListJobRunsCommandOutput } from "../commands/ListJobRunsCommand";
4748
import {
4849
ListTagsForResourceCommandInput,
@@ -71,6 +72,7 @@ import {
7172
InternalServerException,
7273
JobDriver,
7374
JobRun,
75+
JobRunAttemptSummary,
7476
JobRunSummary,
7577
ManagedPersistenceMonitoringConfiguration,
7678
MaximumAllowedResources,
@@ -79,6 +81,7 @@ import {
7981
PrometheusMonitoringConfiguration,
8082
ResourceNotFoundException,
8183
ResourceUtilization,
84+
RetryPolicy,
8285
S3MonitoringConfiguration,
8386
ServiceQuotaExceededException,
8487
SparkSubmit,
@@ -186,8 +189,11 @@ export const se_GetDashboardForJobRunCommand = async (
186189
b.bp("/applications/{applicationId}/jobruns/{jobRunId}/dashboard");
187190
b.p("applicationId", () => input.applicationId!, "{applicationId}", false);
188191
b.p("jobRunId", () => input.jobRunId!, "{jobRunId}", false);
192+
const query: any = map({
193+
[_a]: [() => input.attempt !== void 0, () => input[_a]!.toString()],
194+
});
189195
let body: any;
190-
b.m("GET").h(headers).b(body);
196+
b.m("GET").h(headers).q(query).b(body);
191197
return b.build();
192198
};
193199

@@ -203,8 +209,11 @@ export const se_GetJobRunCommand = async (
203209
b.bp("/applications/{applicationId}/jobruns/{jobRunId}");
204210
b.p("applicationId", () => input.applicationId!, "{applicationId}", false);
205211
b.p("jobRunId", () => input.jobRunId!, "{jobRunId}", false);
212+
const query: any = map({
213+
[_a]: [() => input.attempt !== void 0, () => input[_a]!.toString()],
214+
});
206215
let body: any;
207-
b.m("GET").h(headers).b(body);
216+
b.m("GET").h(headers).q(query).b(body);
208217
return b.build();
209218
};
210219

@@ -228,6 +237,27 @@ export const se_ListApplicationsCommand = async (
228237
return b.build();
229238
};
230239

240+
/**
241+
* serializeAws_restJson1ListJobRunAttemptsCommand
242+
*/
243+
export const se_ListJobRunAttemptsCommand = async (
244+
input: ListJobRunAttemptsCommandInput,
245+
context: __SerdeContext
246+
): Promise<__HttpRequest> => {
247+
const b = rb(input, context);
248+
const headers: any = {};
249+
b.bp("/applications/{applicationId}/jobruns/{jobRunId}/attempts");
250+
b.p("applicationId", () => input.applicationId!, "{applicationId}", false);
251+
b.p("jobRunId", () => input.jobRunId!, "{jobRunId}", false);
252+
const query: any = map({
253+
[_nT]: [, input[_nT]!],
254+
[_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()],
255+
});
256+
let body: any;
257+
b.m("GET").h(headers).q(query).b(body);
258+
return b.build();
259+
};
260+
231261
/**
232262
* serializeAws_restJson1ListJobRunsCommand
233263
*/
@@ -245,6 +275,7 @@ export const se_ListJobRunsCommand = async (
245275
[_cAA]: [() => input.createdAtAfter !== void 0, () => __serializeDateTime(input[_cAA]!).toString()],
246276
[_cAB]: [() => input.createdAtBefore !== void 0, () => __serializeDateTime(input[_cAB]!).toString()],
247277
[_s]: [() => input.states !== void 0, () => (input[_s]! || []).map((_entry) => _entry as any)],
278+
[_m]: [, input[_m]!],
248279
});
249280
let body: any;
250281
b.m("GET").h(headers).q(query).b(body);
@@ -304,7 +335,9 @@ export const se_StartJobRunCommand = async (
304335
executionRoleArn: [],
305336
executionTimeoutMinutes: [],
306337
jobDriver: (_) => _json(_),
338+
mode: [],
307339
name: [],
340+
retryPolicy: (_) => _json(_),
308341
tags: (_) => _json(_),
309342
})
310343
);
@@ -555,6 +588,28 @@ export const de_ListApplicationsCommand = async (
555588
return contents;
556589
};
557590

591+
/**
592+
* deserializeAws_restJson1ListJobRunAttemptsCommand
593+
*/
594+
export const de_ListJobRunAttemptsCommand = async (
595+
output: __HttpResponse,
596+
context: __SerdeContext
597+
): Promise<ListJobRunAttemptsCommandOutput> => {
598+
if (output.statusCode !== 200 && output.statusCode >= 300) {
599+
return de_CommandError(output, context);
600+
}
601+
const contents: any = map({
602+
$metadata: deserializeMetadata(output),
603+
});
604+
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
605+
const doc = take(data, {
606+
jobRunAttempts: (_) => de_JobRunAttempts(_, context),
607+
nextToken: __expectString,
608+
});
609+
Object.assign(contents, doc);
610+
return contents;
611+
};
612+
558613
/**
559614
* deserializeAws_restJson1ListJobRunsCommand
560615
*/
@@ -906,6 +961,8 @@ const se_ConfigurationOverrides = (input: ConfigurationOverrides, context: __Ser
906961

907962
// se_PrometheusMonitoringConfiguration omitted.
908963

964+
// se_RetryPolicy omitted.
965+
909966
// se_S3MonitoringConfiguration omitted.
910967

911968
// se_SecurityGroupIds omitted.
@@ -1043,6 +1100,9 @@ const de_JobRun = (output: any, context: __SerdeContext): JobRun => {
10431100
return take(output, {
10441101
applicationId: __expectString,
10451102
arn: __expectString,
1103+
attempt: __expectInt32,
1104+
attemptCreatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1105+
attemptUpdatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
10461106
billedResourceUtilization: (_: any) => de_ResourceUtilization(_, context),
10471107
configurationOverrides: (_: any) => de_ConfigurationOverrides(_, context),
10481108
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -1051,9 +1111,11 @@ const de_JobRun = (output: any, context: __SerdeContext): JobRun => {
10511111
executionTimeoutMinutes: __expectLong,
10521112
jobDriver: (_: any) => _json(__expectUnion(_)),
10531113
jobRunId: __expectString,
1114+
mode: __expectString,
10541115
name: __expectString,
10551116
networkConfiguration: _json,
10561117
releaseLabel: __expectString,
1118+
retryPolicy: _json,
10571119
state: __expectString,
10581120
stateDetails: __expectString,
10591121
tags: _json,
@@ -1063,6 +1125,41 @@ const de_JobRun = (output: any, context: __SerdeContext): JobRun => {
10631125
}) as any;
10641126
};
10651127

1128+
/**
1129+
* deserializeAws_restJson1JobRunAttempts
1130+
*/
1131+
const de_JobRunAttempts = (output: any, context: __SerdeContext): JobRunAttemptSummary[] => {
1132+
const retVal = (output || [])
1133+
.filter((e: any) => e != null)
1134+
.map((entry: any) => {
1135+
return de_JobRunAttemptSummary(entry, context);
1136+
});
1137+
return retVal;
1138+
};
1139+
1140+
/**
1141+
* deserializeAws_restJson1JobRunAttemptSummary
1142+
*/
1143+
const de_JobRunAttemptSummary = (output: any, context: __SerdeContext): JobRunAttemptSummary => {
1144+
return take(output, {
1145+
applicationId: __expectString,
1146+
arn: __expectString,
1147+
attempt: __expectInt32,
1148+
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1149+
createdBy: __expectString,
1150+
executionRole: __expectString,
1151+
id: __expectString,
1152+
jobCreatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1153+
mode: __expectString,
1154+
name: __expectString,
1155+
releaseLabel: __expectString,
1156+
state: __expectString,
1157+
stateDetails: __expectString,
1158+
type: __expectString,
1159+
updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1160+
}) as any;
1161+
};
1162+
10661163
/**
10671164
* deserializeAws_restJson1JobRuns
10681165
*/
@@ -1082,10 +1179,14 @@ const de_JobRunSummary = (output: any, context: __SerdeContext): JobRunSummary =
10821179
return take(output, {
10831180
applicationId: __expectString,
10841181
arn: __expectString,
1182+
attempt: __expectInt32,
1183+
attemptCreatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1184+
attemptUpdatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
10851185
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
10861186
createdBy: __expectString,
10871187
executionRole: __expectString,
10881188
id: __expectString,
1189+
mode: __expectString,
10891190
name: __expectString,
10901191
releaseLabel: __expectString,
10911192
state: __expectString,
@@ -1120,6 +1221,8 @@ const de_ResourceUtilization = (output: any, context: __SerdeContext): ResourceU
11201221
}) as any;
11211222
};
11221223

1224+
// de_RetryPolicy omitted.
1225+
11231226
// de_S3MonitoringConfiguration omitted.
11241227

11251228
// de_SecurityGroupIds omitted.
@@ -1168,8 +1271,10 @@ const isSerializableHeaderValue = (value: any): boolean =>
11681271
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
11691272
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
11701273

1274+
const _a = "attempt";
11711275
const _cAA = "createdAtAfter";
11721276
const _cAB = "createdAtBefore";
1277+
const _m = "mode";
11731278
const _mR = "maxResults";
11741279
const _nT = "nextToken";
11751280
const _s = "states";

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

+3,991-3,642
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.