Skip to content

Commit 9a3cc54

Browse files
author
awstools
committed
feat(client-emr-serverless): This release adds API support to debug Amazon EMR Serverless jobs in real-time with live application UIs
1 parent 2426699 commit 9a3cc54

File tree

7 files changed

+436
-81
lines changed

7 files changed

+436
-81
lines changed

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import {
2121
GetApplicationCommandInput,
2222
GetApplicationCommandOutput,
2323
} from "./commands/GetApplicationCommand";
24+
import {
25+
GetDashboardForJobRunCommand,
26+
GetDashboardForJobRunCommandInput,
27+
GetDashboardForJobRunCommandOutput,
28+
} from "./commands/GetDashboardForJobRunCommand";
2429
import { GetJobRunCommand, GetJobRunCommandInput, GetJobRunCommandOutput } from "./commands/GetJobRunCommand";
2530
import {
2631
ListApplicationsCommand,
@@ -208,6 +213,38 @@ export class EMRServerless extends EMRServerlessClient {
208213
}
209214
}
210215

216+
/**
217+
* <p>Returns a URL to access the job run dashboard.</p>
218+
*/
219+
public getDashboardForJobRun(
220+
args: GetDashboardForJobRunCommandInput,
221+
options?: __HttpHandlerOptions
222+
): Promise<GetDashboardForJobRunCommandOutput>;
223+
public getDashboardForJobRun(
224+
args: GetDashboardForJobRunCommandInput,
225+
cb: (err: any, data?: GetDashboardForJobRunCommandOutput) => void
226+
): void;
227+
public getDashboardForJobRun(
228+
args: GetDashboardForJobRunCommandInput,
229+
options: __HttpHandlerOptions,
230+
cb: (err: any, data?: GetDashboardForJobRunCommandOutput) => void
231+
): void;
232+
public getDashboardForJobRun(
233+
args: GetDashboardForJobRunCommandInput,
234+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetDashboardForJobRunCommandOutput) => void),
235+
cb?: (err: any, data?: GetDashboardForJobRunCommandOutput) => void
236+
): Promise<GetDashboardForJobRunCommandOutput> | void {
237+
const command = new GetDashboardForJobRunCommand(args);
238+
if (typeof optionsOrCb === "function") {
239+
this.send(command, optionsOrCb);
240+
} else if (typeof cb === "function") {
241+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
242+
this.send(command, optionsOrCb || {}, cb);
243+
} else {
244+
return this.send(command, optionsOrCb);
245+
}
246+
}
247+
211248
/**
212249
* <p>Displays detailed information about a job run.</p>
213250
*/

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ import { CancelJobRunCommandInput, CancelJobRunCommandOutput } from "./commands/
5757
import { CreateApplicationCommandInput, CreateApplicationCommandOutput } from "./commands/CreateApplicationCommand";
5858
import { DeleteApplicationCommandInput, DeleteApplicationCommandOutput } from "./commands/DeleteApplicationCommand";
5959
import { GetApplicationCommandInput, GetApplicationCommandOutput } from "./commands/GetApplicationCommand";
60+
import {
61+
GetDashboardForJobRunCommandInput,
62+
GetDashboardForJobRunCommandOutput,
63+
} from "./commands/GetDashboardForJobRunCommand";
6064
import { GetJobRunCommandInput, GetJobRunCommandOutput } from "./commands/GetJobRunCommand";
6165
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand";
6266
import { ListJobRunsCommandInput, ListJobRunsCommandOutput } from "./commands/ListJobRunsCommand";
@@ -77,6 +81,7 @@ export type ServiceInputTypes =
7781
| CreateApplicationCommandInput
7882
| DeleteApplicationCommandInput
7983
| GetApplicationCommandInput
84+
| GetDashboardForJobRunCommandInput
8085
| GetJobRunCommandInput
8186
| ListApplicationsCommandInput
8287
| ListJobRunsCommandInput
@@ -93,6 +98,7 @@ export type ServiceOutputTypes =
9398
| CreateApplicationCommandOutput
9499
| DeleteApplicationCommandOutput
95100
| GetApplicationCommandOutput
101+
| GetDashboardForJobRunCommandOutput
96102
| GetJobRunCommandOutput
97103
| ListApplicationsCommandOutput
98104
| ListJobRunsCommandOutput
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { EMRServerlessClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EMRServerlessClient";
16+
import {
17+
GetDashboardForJobRunRequest,
18+
GetDashboardForJobRunRequestFilterSensitiveLog,
19+
GetDashboardForJobRunResponse,
20+
GetDashboardForJobRunResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_restJson1GetDashboardForJobRunCommand,
24+
serializeAws_restJson1GetDashboardForJobRunCommand,
25+
} from "../protocols/Aws_restJson1";
26+
27+
export interface GetDashboardForJobRunCommandInput extends GetDashboardForJobRunRequest {}
28+
export interface GetDashboardForJobRunCommandOutput extends GetDashboardForJobRunResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns a URL to access the job run dashboard.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { EMRServerlessClient, GetDashboardForJobRunCommand } from "@aws-sdk/client-emr-serverless"; // ES Modules import
36+
* // const { EMRServerlessClient, GetDashboardForJobRunCommand } = require("@aws-sdk/client-emr-serverless"); // CommonJS import
37+
* const client = new EMRServerlessClient(config);
38+
* const command = new GetDashboardForJobRunCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link GetDashboardForJobRunCommandInput} for command's `input` shape.
43+
* @see {@link GetDashboardForJobRunCommandOutput} for command's `response` shape.
44+
* @see {@link EMRServerlessClientResolvedConfig | config} for EMRServerlessClient's `config` shape.
45+
*
46+
*/
47+
export class GetDashboardForJobRunCommand extends $Command<
48+
GetDashboardForJobRunCommandInput,
49+
GetDashboardForJobRunCommandOutput,
50+
EMRServerlessClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: GetDashboardForJobRunCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: EMRServerlessClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<GetDashboardForJobRunCommandInput, GetDashboardForJobRunCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "EMRServerlessClient";
75+
const commandName = "GetDashboardForJobRunCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: GetDashboardForJobRunRequestFilterSensitiveLog,
81+
outputFilterSensitiveLog: GetDashboardForJobRunResponseFilterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(input: GetDashboardForJobRunCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
92+
return serializeAws_restJson1GetDashboardForJobRunCommand(input, context);
93+
}
94+
95+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetDashboardForJobRunCommandOutput> {
96+
return deserializeAws_restJson1GetDashboardForJobRunCommand(output, context);
97+
}
98+
99+
// Start section: command_body_extra
100+
// End section: command_body_extra
101+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from "./CancelJobRunCommand";
33
export * from "./CreateApplicationCommand";
44
export * from "./DeleteApplicationCommand";
55
export * from "./GetApplicationCommand";
6+
export * from "./GetDashboardForJobRunCommand";
67
export * from "./GetJobRunCommand";
78
export * from "./ListApplicationsCommand";
89
export * from "./ListJobRunsCommand";

0 commit comments

Comments
 (0)