Skip to content

Commit

Permalink
feat(client-deadline): Add support for using the template from a prev…
Browse files Browse the repository at this point in the history
…ious job during job creation and listing parameter definitions for a job.
  • Loading branch information
awstools committed Oct 7, 2024
1 parent 990f025 commit 9c4d17d
Show file tree
Hide file tree
Showing 17 changed files with 551 additions and 57 deletions.
8 changes: 8 additions & 0 deletions clients/client-deadline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,14 @@ ListJobMembers

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/deadline/command/ListJobMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-deadline/Interface/ListJobMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-deadline/Interface/ListJobMembersCommandOutput/)

</details>
<details>
<summary>
ListJobParameterDefinitions
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/deadline/command/ListJobParameterDefinitionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-deadline/Interface/ListJobParameterDefinitionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-deadline/Interface/ListJobParameterDefinitionsCommandOutput/)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-deadline/src/Deadline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ import {
ListJobMembersCommandInput,
ListJobMembersCommandOutput,
} from "./commands/ListJobMembersCommand";
import {
ListJobParameterDefinitionsCommand,
ListJobParameterDefinitionsCommandInput,
ListJobParameterDefinitionsCommandOutput,
} from "./commands/ListJobParameterDefinitionsCommand";
import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "./commands/ListJobsCommand";
import {
ListLicenseEndpointsCommand,
Expand Down Expand Up @@ -436,6 +441,7 @@ const commands = {
ListFleetMembersCommand,
ListFleetsCommand,
ListJobMembersCommand,
ListJobParameterDefinitionsCommand,
ListJobsCommand,
ListLicenseEndpointsCommand,
ListMeteredProductsCommand,
Expand Down Expand Up @@ -1354,6 +1360,23 @@ export interface Deadline {
cb: (err: any, data?: ListJobMembersCommandOutput) => void
): void;

/**
* @see {@link ListJobParameterDefinitionsCommand}
*/
listJobParameterDefinitions(
args: ListJobParameterDefinitionsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListJobParameterDefinitionsCommandOutput>;
listJobParameterDefinitions(
args: ListJobParameterDefinitionsCommandInput,
cb: (err: any, data?: ListJobParameterDefinitionsCommandOutput) => void
): void;
listJobParameterDefinitions(
args: ListJobParameterDefinitionsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListJobParameterDefinitionsCommandOutput) => void
): void;

/**
* @see {@link ListJobsCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-deadline/src/DeadlineClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ import { ListFarmsCommandInput, ListFarmsCommandOutput } from "./commands/ListFa
import { ListFleetMembersCommandInput, ListFleetMembersCommandOutput } from "./commands/ListFleetMembersCommand";
import { ListFleetsCommandInput, ListFleetsCommandOutput } from "./commands/ListFleetsCommand";
import { ListJobMembersCommandInput, ListJobMembersCommandOutput } from "./commands/ListJobMembersCommand";
import {
ListJobParameterDefinitionsCommandInput,
ListJobParameterDefinitionsCommandOutput,
} from "./commands/ListJobParameterDefinitionsCommand";
import { ListJobsCommandInput, ListJobsCommandOutput } from "./commands/ListJobsCommand";
import {
ListLicenseEndpointsCommandInput,
Expand Down Expand Up @@ -354,6 +358,7 @@ export type ServiceInputTypes =
| ListFleetMembersCommandInput
| ListFleetsCommandInput
| ListJobMembersCommandInput
| ListJobParameterDefinitionsCommandInput
| ListJobsCommandInput
| ListLicenseEndpointsCommandInput
| ListMeteredProductsCommandInput
Expand Down Expand Up @@ -461,6 +466,7 @@ export type ServiceOutputTypes =
| ListFleetMembersCommandOutput
| ListFleetsCommandOutput
| ListJobMembersCommandOutput
| ListJobParameterDefinitionsCommandOutput
| ListJobsCommandOutput
| ListLicenseEndpointsCommandOutput
| ListMeteredProductsCommandOutput
Expand Down
5 changes: 3 additions & 2 deletions clients/client-deadline/src/commands/CreateJobCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export interface CreateJobCommandOutput extends CreateJobResponse, __MetadataBea
* farmId: "STRING_VALUE", // required
* queueId: "STRING_VALUE", // required
* clientToken: "STRING_VALUE",
* template: "STRING_VALUE", // required
* templateType: "JSON" || "YAML", // required
* template: "STRING_VALUE",
* templateType: "JSON" || "YAML",
* priority: Number("int"), // required
* parameters: { // JobParameters
* "<keys>": { // JobParameter Union: only one key present
Expand Down Expand Up @@ -71,6 +71,7 @@ export interface CreateJobCommandOutput extends CreateJobResponse, __MetadataBea
* targetTaskRunStatus: "READY" || "SUSPENDED",
* maxFailedTasksCount: Number("int"),
* maxRetriesPerTask: Number("int"),
* sourceJobId: "STRING_VALUE",
* };
* const command = new CreateJobCommand(input);
* const response = await client.send(command);
Expand Down
1 change: 1 addition & 0 deletions clients/client-deadline/src/commands/GetJobCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface GetJobCommandOutput extends GetJobResponse, __MetadataBearer {}
* // fileSystem: "COPIED" || "VIRTUAL",
* // },
* // description: "STRING_VALUE",
* // sourceJobId: "STRING_VALUE",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { DeadlineClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DeadlineClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ListJobParameterDefinitionsRequest, ListJobParameterDefinitionsResponse } from "../models/models_0";
import {
de_ListJobParameterDefinitionsCommand,
se_ListJobParameterDefinitionsCommand,
} from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ListJobParameterDefinitionsCommand}.
*/
export interface ListJobParameterDefinitionsCommandInput extends ListJobParameterDefinitionsRequest {}
/**
* @public
*
* The output of {@link ListJobParameterDefinitionsCommand}.
*/
export interface ListJobParameterDefinitionsCommandOutput
extends ListJobParameterDefinitionsResponse,
__MetadataBearer {}

/**
* <p>Lists parameter definitions of a job.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { DeadlineClient, ListJobParameterDefinitionsCommand } from "@aws-sdk/client-deadline"; // ES Modules import
* // const { DeadlineClient, ListJobParameterDefinitionsCommand } = require("@aws-sdk/client-deadline"); // CommonJS import
* const client = new DeadlineClient(config);
* const input = { // ListJobParameterDefinitionsRequest
* farmId: "STRING_VALUE", // required
* jobId: "STRING_VALUE", // required
* queueId: "STRING_VALUE", // required
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* };
* const command = new ListJobParameterDefinitionsCommand(input);
* const response = await client.send(command);
* // { // ListJobParameterDefinitionsResponse
* // jobParameterDefinitions: [ // JobParameterDefinitions // required
* // "DOCUMENT_VALUE",
* // ],
* // nextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListJobParameterDefinitionsCommandInput - {@link ListJobParameterDefinitionsCommandInput}
* @returns {@link ListJobParameterDefinitionsCommandOutput}
* @see {@link ListJobParameterDefinitionsCommandInput} for command's `input` shape.
* @see {@link ListJobParameterDefinitionsCommandOutput} for command's `response` shape.
* @see {@link DeadlineClientResolvedConfig | config} for DeadlineClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You don't have permission to perform the action.</p>
*
* @throws {@link InternalServerErrorException} (server fault)
* <p>Deadline Cloud can't process your request right now. Try again later.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The requested resource can't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Your request exceeded a request rate quota.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The request isn't valid. This can occur if your request contains malformed JSON or
* unsupported characters.</p>
*
* @throws {@link DeadlineServiceException}
* <p>Base exception class for all service exceptions from Deadline service.</p>
*
* @public
*/
export class ListJobParameterDefinitionsCommand extends $Command
.classBuilder<
ListJobParameterDefinitionsCommandInput,
ListJobParameterDefinitionsCommandOutput,
DeadlineClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: DeadlineClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("Deadline", "ListJobParameterDefinitions", {})
.n("DeadlineClient", "ListJobParameterDefinitionsCommand")
.f(void 0, void 0)
.ser(se_ListJobParameterDefinitionsCommand)
.de(de_ListJobParameterDefinitionsCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ListJobParameterDefinitionsRequest;
output: ListJobParameterDefinitionsResponse;
};
sdk: {
input: ListJobParameterDefinitionsCommandInput;
output: ListJobParameterDefinitionsCommandOutput;
};
};
}
1 change: 1 addition & 0 deletions clients/client-deadline/src/commands/ListJobsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface ListJobsCommandOutput extends ListJobsResponse, __MetadataBeare
* // },
* // maxFailedTasksCount: Number("int"),
* // maxRetriesPerTask: Number("int"),
* // sourceJobId: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
3 changes: 2 additions & 1 deletion clients/client-deadline/src/commands/ListQueuesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { DeadlineClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DeadlineClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ListQueuesRequest, ListQueuesResponse } from "../models/models_0";
import { ListQueuesRequest } from "../models/models_0";
import { ListQueuesResponse } from "../models/models_1";
import { de_ListQueuesCommand, se_ListQueuesCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { DeadlineClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DeadlineClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ListStorageProfilesForQueueRequest } from "../models/models_0";
import { ListStorageProfilesForQueueResponse } from "../models/models_1";
import { ListStorageProfilesForQueueRequest, ListStorageProfilesForQueueResponse } from "../models/models_1";
import {
de_ListStorageProfilesForQueueCommand,
se_ListStorageProfilesForQueueCommand,
Expand Down
1 change: 1 addition & 0 deletions clients/client-deadline/src/commands/SearchJobsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export interface SearchJobsCommandOutput extends SearchJobsResponse, __MetadataB
* // path: "STRING_VALUE",
* // },
* // },
* // sourceJobId: "STRING_VALUE",
* // },
* // ],
* // nextItemOffset: Number("int"),
Expand Down
1 change: 1 addition & 0 deletions clients/client-deadline/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export * from "./ListFarmsCommand";
export * from "./ListFleetMembersCommand";
export * from "./ListFleetsCommand";
export * from "./ListJobMembersCommand";
export * from "./ListJobParameterDefinitionsCommand";
export * from "./ListJobsCommand";
export * from "./ListLicenseEndpointsCommand";
export * from "./ListMeteredProductsCommand";
Expand Down
Loading

0 comments on commit 9c4d17d

Please sign in to comment.