Skip to content

Commit

Permalink
feat(client-emr-serverless): The GetJobRun API has been updated to in…
Browse files Browse the repository at this point in the history
…clude the job's billed resource utilization. This utilization shows the aggregate vCPU, memory and storage that AWS has billed for the job run. The billed resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB per worker.
  • Loading branch information
awstools committed Apr 17, 2023
1 parent c1349f2 commit 6f369a9
Show file tree
Hide file tree
Showing 19 changed files with 184 additions and 90 deletions.
13 changes: 7 additions & 6 deletions clients/client-emr-serverless/src/EMRServerless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export class EMRServerless extends EMRServerlessClient {

/**
* @public
* <p>Returns a URL to access the job run dashboard.</p>
* <p>Returns a URL to access the job run dashboard. The generated URL is valid for one hour,
* after which you must invoke the API again to generate a new URL.</p>
*/
public getDashboardForJobRun(
args: GetDashboardForJobRunCommandInput,
Expand Down Expand Up @@ -467,11 +468,11 @@ export class EMRServerless extends EMRServerlessClient {

/**
* @public
* <p>Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services resource. Each tag
* consists of a key and an optional value, both of which you define. Tags enable you to
* categorize your Amazon Web Services resources by attributes such as purpose, owner, or environment. When
* you have many resources of the same type, you can quickly identify a specific resource
* based on the tags you've assigned to it. </p>
* <p>Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services
* resource. Each tag consists of a key and an optional value, both of which you define. Tags
* enable you to categorize your Amazon Web Services resources by attributes such as purpose,
* owner, or environment. When you have many resources of the same type, you can quickly
* identify a specific resource based on the tags you've assigned to it. </p>
*/
public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export interface CancelJobRunCommandOutput extends CancelJobRunResponse, __Metad
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export interface CreateApplicationCommandOutput extends CreateApplicationRespons
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export interface DeleteApplicationCommandOutput extends DeleteApplicationRespons
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export interface GetApplicationCommandOutput extends GetApplicationResponse, __M
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export interface GetDashboardForJobRunCommandOutput extends GetDashboardForJobRu

/**
* @public
* <p>Returns a URL to access the job run dashboard.</p>
* <p>Returns a URL to access the job run dashboard. The generated URL is valid for one hour,
* after which you must invoke the API again to generate a new URL.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -60,7 +61,8 @@ export interface GetDashboardForJobRunCommandOutput extends GetDashboardForJobRu
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export interface GetJobRunCommandOutput extends GetJobRunResponse, __MetadataBea
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export interface ListApplicationsCommandOutput extends ListApplicationsResponse,
* <p>Request processing failed because of an error or failure with the service.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export interface ListJobRunsCommandOutput extends ListJobRunsResponse, __Metadat
* <p>Request processing failed because of an error or failure with the service.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export interface ListTagsForResourceCommandOutput extends ListTagsForResourceRes
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export interface StartApplicationCommandOutput extends StartApplicationResponse,
* <p>The maximum number of resources per account has been reached.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export interface StartJobRunCommandOutput extends StartJobRunResponse, __Metadat
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export interface StopApplicationCommandOutput extends StopApplicationResponse, _
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
13 changes: 7 additions & 6 deletions clients/client-emr-serverless/src/commands/TagResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export interface TagResourceCommandOutput extends TagResourceResponse, __Metadat

/**
* @public
* <p>Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services resource. Each tag
* consists of a key and an optional value, both of which you define. Tags enable you to
* categorize your Amazon Web Services resources by attributes such as purpose, owner, or environment. When
* you have many resources of the same type, you can quickly identify a specific resource
* based on the tags you've assigned to it. </p>
* <p>Assigns tags to resources. A tag is a label that you assign to an Amazon Web Services
* resource. Each tag consists of a key and an optional value, both of which you define. Tags
* enable you to categorize your Amazon Web Services resources by attributes such as purpose,
* owner, or environment. When you have many resources of the same type, you can quickly
* identify a specific resource based on the tags you've assigned to it. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -66,7 +66,8 @@ export interface TagResourceCommandOutput extends TagResourceResponse, __Metadat
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export interface UntagResourceCommandOutput extends UntagResourceResponse, __Met
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export interface UpdateApplicationCommandOutput extends UpdateApplicationRespons
* <p>The specified resource was not found.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*
*
*/
Expand Down
42 changes: 38 additions & 4 deletions clients/client-emr-serverless/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ export class ResourceNotFoundException extends __BaseException {

/**
* @public
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services
* service.</p>
*/
export class ValidationException extends __BaseException {
readonly name: "ValidationException" = "ValidationException";
Expand Down Expand Up @@ -802,6 +803,30 @@ export interface GetJobRunRequest {
jobRunId: string | undefined;
}

/**
* @public
* <p>The resource utilization for memory, storage, and vCPU for jobs.</p>
*/
export interface ResourceUtilization {
/**
* <p>The aggregated vCPU used per hour from the time the job starts executing until the job
* is terminated.</p>
*/
vCPUHour?: number;

/**
* <p>The aggregated memory used per hour from the time the job starts executing until the job
* is terminated.</p>
*/
memoryGBHour?: number;

/**
* <p>The aggregated storage used per hour from the time the job starts executing until the
* job is terminated.</p>
*/
storageGBHour?: number;
}

/**
* @public
* <p>The managed log persistence configuration for a job run.</p>
Expand Down Expand Up @@ -1307,8 +1332,8 @@ export interface JobRun {
tags?: Record<string, string>;

/**
* <p>The aggregate vCPU, memory, and storage resources used from the time job start executing
* till the time job is terminated, rounded up to the nearest second.</p>
* <p>The aggregate vCPU, memory, and storage resources used from the time the job starts to
* execute, until the time the job terminates, rounded up to the nearest second.</p>
*/
totalResourceUtilization?: TotalResourceUtilization;

Expand All @@ -1325,9 +1350,18 @@ export interface JobRun {
totalExecutionDurationSeconds?: number;

/**
* Maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.
* <p>Returns the job run timeout value from the <code>StartJobRun</code> call. If no timeout
* was specified, then it returns the default timeout of 720 minutes.</p>
*/
executionTimeoutMinutes?: number;

/**
* <p>The aggregate vCPU, memory, and storage that AWS has billed for the job run. The billed
* resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB
* per worker. Note that billed resources do not include usage for idle pre-initialized
* workers.</p>
*/
billedResourceUtilization?: ResourceUtilization;
}

/**
Expand Down
13 changes: 13 additions & 0 deletions clients/client-emr-serverless/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
MonitoringConfiguration,
NetworkConfiguration,
ResourceNotFoundException,
ResourceUtilization,
S3MonitoringConfiguration,
ServiceQuotaExceededException,
SparkSubmit,
Expand Down Expand Up @@ -1652,6 +1653,7 @@ const de_JobRun = (output: any, context: __SerdeContext): JobRun => {
return take(output, {
applicationId: __expectString,
arn: __expectString,
billedResourceUtilization: (_: any) => de_ResourceUtilization(_, context),
configurationOverrides: (_: any) => de_ConfigurationOverrides(_, context),
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
createdBy: __expectString,
Expand Down Expand Up @@ -1711,6 +1713,17 @@ const de_JobRunSummary = (output: any, context: __SerdeContext): JobRunSummary =

// de_NetworkConfiguration omitted.

/**
* deserializeAws_restJson1ResourceUtilization
*/
const de_ResourceUtilization = (output: any, context: __SerdeContext): ResourceUtilization => {
return take(output, {
memoryGBHour: __limitedParseDouble,
storageGBHour: __limitedParseDouble,
vCPUHour: __limitedParseDouble,
}) as any;
};

// de_S3MonitoringConfiguration omitted.

// de_SecurityGroupIds omitted.
Expand Down
Loading

0 comments on commit 6f369a9

Please sign in to comment.