Lists all the job steps for JCL files to restart a batch job. This is only applicable for Micro Focus engine with versions 8.0.6 and above.
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { M2Client, ListBatchJobRestartPointsCommand } from "@aws-sdk/client-m2"; // ES Modules import + * // const { M2Client, ListBatchJobRestartPointsCommand } = require("@aws-sdk/client-m2"); // CommonJS import + * const client = new M2Client(config); + * const input = { // ListBatchJobRestartPointsRequest + * applicationId: "STRING_VALUE", // required + * executionId: "STRING_VALUE", // required + * }; + * const command = new ListBatchJobRestartPointsCommand(input); + * const response = await client.send(command); + * // { // ListBatchJobRestartPointsResponse + * // batchJobSteps: [ // BatchJobStepList + * // { // JobStep + * // stepNumber: Number("int"), + * // stepName: "STRING_VALUE", + * // procStepNumber: Number("int"), + * // procStepName: "STRING_VALUE", + * // stepCondCode: "STRING_VALUE", + * // stepRestartable: true || false, + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListBatchJobRestartPointsCommandInput - {@link ListBatchJobRestartPointsCommandInput} + * @returns {@link ListBatchJobRestartPointsCommandOutput} + * @see {@link ListBatchJobRestartPointsCommandInput} for command's `input` shape. + * @see {@link ListBatchJobRestartPointsCommandOutput} for command's `response` shape. + * @see {@link M2ClientResolvedConfig | config} for M2Client's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *The account or role doesn't have the right permissions to make the request.
+ * + * @throws {@link ConflictException} (client fault) + *The parameters provided in the request conflict with existing resources.
+ * + * @throws {@link InternalServerException} (server fault) + *An unexpected error occurred during the processing of the request.
+ * + * @throws {@link ResourceNotFoundException} (client fault) + *The specified resource was not found.
+ * + * @throws {@link ThrottlingException} (client fault) + *The number of requests made exceeds the limit.
+ * + * @throws {@link ValidationException} (client fault) + *One or more parameters provided in the request is not valid.
+ * + * @throws {@link M2ServiceException} + *Base exception class for all service exceptions from M2 service.
+ * + * @public + */ +export class ListBatchJobRestartPointsCommand extends $Command + .classBuilder< + ListBatchJobRestartPointsCommandInput, + ListBatchJobRestartPointsCommandOutput, + M2ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: M2ClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AwsSupernovaControlPlaneService", "ListBatchJobRestartPoints", {}) + .n("M2Client", "ListBatchJobRestartPointsCommand") + .f(void 0, void 0) + .ser(se_ListBatchJobRestartPointsCommand) + .de(de_ListBatchJobRestartPointsCommand) + .build() {} diff --git a/clients/client-m2/src/commands/StartBatchJobCommand.ts b/clients/client-m2/src/commands/StartBatchJobCommand.ts index 9920b760e780..734bf08e8fcd 100644 --- a/clients/client-m2/src/commands/StartBatchJobCommand.ts +++ b/clients/client-m2/src/commands/StartBatchJobCommand.ts @@ -53,6 +53,15 @@ export interface StartBatchJobCommandOutput extends StartBatchJobResponse, __Met * scriptName: "STRING_VALUE", * }, * }, + * restartBatchJobIdentifier: { // RestartBatchJobIdentifier + * executionId: "STRING_VALUE", // required + * jobStepRestartMarker: { // JobStepRestartMarker + * fromStep: "STRING_VALUE", // required + * fromProcStep: "STRING_VALUE", + * toStep: "STRING_VALUE", + * toProcStep: "STRING_VALUE", + * }, + * }, * }, * jobParams: { // BatchJobParametersMap * "Provides restart step information for the most recent restart operation.
+ * @public + */ +export interface JobStepRestartMarker { + /** + *The step name that a batch job restart was from.
+ * @public + */ + fromStep: string | undefined; + + /** + *The procedure step name that a job was restarted from.
+ * @public + */ + fromProcStep?: string; + + /** + *The step name that a job was restarted to.
+ * @public + */ + toStep?: string; + + /** + *The procedure step name that a batch job was restarted to.
+ * @public + */ + toProcStep?: string; +} + +/** + *An identifier for the StartBatchJob API to show that it is a restart operation.
+ * @public + */ +export interface RestartBatchJobIdentifier { + /** + *The executionId from the StartBatchJob response when the job ran for the first time.
+ * @public + */ + executionId: string | undefined; + + /** + *The restart step information for the most recent restart operation.
+ * @public + */ + jobStepRestartMarker: JobStepRestartMarker | undefined; +} + /** *Identifies a specific batch job.
* @public @@ -1467,6 +1517,7 @@ export interface ScriptBatchJobIdentifier { */ export type BatchJobIdentifier = | BatchJobIdentifier.FileBatchJobIdentifierMember + | BatchJobIdentifier.RestartBatchJobIdentifierMember | BatchJobIdentifier.S3BatchJobIdentifierMember | BatchJobIdentifier.ScriptBatchJobIdentifierMember | BatchJobIdentifier.$UnknownMember; @@ -1483,6 +1534,7 @@ export namespace BatchJobIdentifier { fileBatchJobIdentifier: FileBatchJobIdentifier; scriptBatchJobIdentifier?: never; s3BatchJobIdentifier?: never; + restartBatchJobIdentifier?: never; $unknown?: never; } @@ -1495,6 +1547,7 @@ export namespace BatchJobIdentifier { fileBatchJobIdentifier?: never; scriptBatchJobIdentifier: ScriptBatchJobIdentifier; s3BatchJobIdentifier?: never; + restartBatchJobIdentifier?: never; $unknown?: never; } @@ -1506,6 +1559,19 @@ export namespace BatchJobIdentifier { fileBatchJobIdentifier?: never; scriptBatchJobIdentifier?: never; s3BatchJobIdentifier: S3BatchJobIdentifier; + restartBatchJobIdentifier?: never; + $unknown?: never; + } + + /** + *Specifies the required information for restart, including execution ID and jobsteprestartmarker.
+ * @public + */ + export interface RestartBatchJobIdentifierMember { + fileBatchJobIdentifier?: never; + scriptBatchJobIdentifier?: never; + s3BatchJobIdentifier?: never; + restartBatchJobIdentifier: RestartBatchJobIdentifier; $unknown?: never; } @@ -1516,6 +1582,7 @@ export namespace BatchJobIdentifier { fileBatchJobIdentifier?: never; scriptBatchJobIdentifier?: never; s3BatchJobIdentifier?: never; + restartBatchJobIdentifier?: never; $unknown: [string, any]; } @@ -1523,6 +1590,7 @@ export namespace BatchJobIdentifier { fileBatchJobIdentifier: (value: FileBatchJobIdentifier) => T; scriptBatchJobIdentifier: (value: ScriptBatchJobIdentifier) => T; s3BatchJobIdentifier: (value: S3BatchJobIdentifier) => T; + restartBatchJobIdentifier: (value: RestartBatchJobIdentifier) => T; _: (name: string, value: any) => T; } @@ -1531,6 +1599,8 @@ export namespace BatchJobIdentifier { if (value.scriptBatchJobIdentifier !== undefined) return visitor.scriptBatchJobIdentifier(value.scriptBatchJobIdentifier); if (value.s3BatchJobIdentifier !== undefined) return visitor.s3BatchJobIdentifier(value.s3BatchJobIdentifier); + if (value.restartBatchJobIdentifier !== undefined) + return visitor.restartBatchJobIdentifier(value.restartBatchJobIdentifier); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -1560,6 +1630,7 @@ export const BatchJobExecutionStatus = { DISPATCH: "Dispatching", FAILED: "Failed", HOLDING: "Holding", + PURGED: "Purged", RUNNING: "Running", SUBMITTING: "Submitting", SUCCEEDED: "Succeeded", @@ -1649,6 +1720,12 @@ export interface GetBatchJobExecutionResponse { * @public */ batchJobIdentifier?: BatchJobIdentifier; + + /** + *The restart steps information for the most recent restart operation.
+ * @public + */ + jobStepRestartMarker?: JobStepRestartMarker; } /** @@ -2593,6 +2670,76 @@ export interface ListBatchJobExecutionsResponse { nextToken?: string; } +/** + * @public + */ +export interface ListBatchJobRestartPointsRequest { + /** + *The unique identifier of the application.
+ * @public + */ + applicationId: string | undefined; + + /** + *The unique identifier of each batch job execution.
+ * @public + */ + executionId: string | undefined; +} + +/** + *Provides information related to a job step.
+ * @public + */ +export interface JobStep { + /** + *The number of a step.
+ * @public + */ + stepNumber?: number; + + /** + *The name of a step.
+ * @public + */ + stepName?: string; + + /** + *The number of a procedure step.
+ * @public + */ + procStepNumber?: number; + + /** + *The name of a procedure step.
+ * @public + */ + procStepName?: string; + + /** + *The condition code of a step.
+ * @public + */ + stepCondCode?: string; + + /** + *Specifies if a step can be restarted or not.
+ * @public + */ + stepRestartable?: boolean; +} + +/** + * @public + */ +export interface ListBatchJobRestartPointsResponse { + /** + *Returns all the batch job steps and related information for a batch job that previously ran.
+ * @public + */ + batchJobSteps?: JobStep[]; +} + /** * @public */ diff --git a/clients/client-m2/src/protocols/Aws_restJson1.ts b/clients/client-m2/src/protocols/Aws_restJson1.ts index 55fff8473b3f..01f69280c201 100644 --- a/clients/client-m2/src/protocols/Aws_restJson1.ts +++ b/clients/client-m2/src/protocols/Aws_restJson1.ts @@ -83,6 +83,10 @@ import { ListBatchJobExecutionsCommandInput, ListBatchJobExecutionsCommandOutput, } from "../commands/ListBatchJobExecutionsCommand"; +import { + ListBatchJobRestartPointsCommandInput, + ListBatchJobRestartPointsCommandOutput, +} from "../commands/ListBatchJobRestartPointsCommand"; import { ListDataSetImportHistoryCommandInput, ListDataSetImportHistoryCommandOutput, @@ -128,6 +132,7 @@ import { HighAvailabilityConfig, InternalServerException, JobIdentifier, + JobStepRestartMarker, MaintenanceSchedule, PendingMaintenance, PoAttributes, @@ -135,6 +140,7 @@ import { PsAttributes, RecordLength, ResourceNotFoundException, + RestartBatchJobIdentifier, S3BatchJobIdentifier, ScriptBatchJobIdentifier, ServiceQuotaExceededException, @@ -546,6 +552,23 @@ export const se_ListBatchJobExecutionsCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListBatchJobRestartPointsCommand + */ +export const se_ListBatchJobRestartPointsCommand = async ( + input: ListBatchJobRestartPointsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/applications/{applicationId}/batch-job-executions/{executionId}/steps"); + b.p("applicationId", () => input.applicationId!, "{applicationId}", false); + b.p("executionId", () => input.executionId!, "{executionId}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListDataSetImportHistoryCommand */ @@ -1068,6 +1091,7 @@ export const de_GetBatchJobExecutionCommand = async ( executionId: __expectString, jobId: __expectString, jobName: __expectString, + jobStepRestartMarker: _json, jobType: __expectString, jobUser: __expectString, returnCode: __expectString, @@ -1309,6 +1333,27 @@ export const de_ListBatchJobExecutionsCommand = async ( return contents; }; +/** + * deserializeAws_restJson1ListBatchJobRestartPointsCommand + */ +export const de_ListBatchJobRestartPointsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): PromiseSpecifies an Amazon S3 location that identifies the batch jobs that you want to run. Use this identifier to run ad hoc batch jobs.
" } + }, + "restartBatchJobIdentifier": { + "target": "com.amazonaws.m2#RestartBatchJobIdentifier", + "traits": { + "smithy.api#documentation": "Specifies the required information for restart, including execution ID and jobsteprestartmarker.
" + } } }, "traits": { @@ -1348,6 +1361,12 @@ } } }, + "com.amazonaws.m2#BatchJobStepList": { + "type": "list", + "member": { + "target": "com.amazonaws.m2#JobStep" + } + }, "com.amazonaws.m2#BatchJobType": { "type": "string", "traits": { @@ -3360,6 +3379,12 @@ "traits": { "smithy.api#documentation": "The unique identifier of this batch job.
" } + }, + "jobStepRestartMarker": { + "target": "com.amazonaws.m2#JobStepRestartMarker", + "traits": { + "smithy.api#documentation": "The restart steps information for the most recent restart operation.
" + } } } }, @@ -4018,6 +4043,86 @@ "smithy.api#documentation": "Identifies a specific batch job.
" } }, + "com.amazonaws.m2#JobStep": { + "type": "structure", + "members": { + "stepNumber": { + "target": "com.amazonaws.m2#Integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "The number of a step.
" + } + }, + "stepName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of a step.
" + } + }, + "procStepNumber": { + "target": "com.amazonaws.m2#Integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "The number of a procedure step.
" + } + }, + "procStepName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The name of a procedure step.
" + } + }, + "stepCondCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The condition code of a step.
" + } + }, + "stepRestartable": { + "target": "com.amazonaws.m2#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "Specifies if a step can be restarted or not.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides information related to a job step.
" + } + }, + "com.amazonaws.m2#JobStepRestartMarker": { + "type": "structure", + "members": { + "fromStep": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The step name that a batch job restart was from.
", + "smithy.api#required": {} + } + }, + "fromProcStep": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The procedure step name that a job was restarted from.
" + } + }, + "toStep": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The step name that a job was restarted to.
" + } + }, + "toProcStep": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The procedure step name that a batch job was restarted to.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Provides restart step information for the most recent restart operation.
" + } + }, "com.amazonaws.m2#ListApplicationVersions": { "type": "operation", "input": { @@ -4438,6 +4543,83 @@ } } }, + "com.amazonaws.m2#ListBatchJobRestartPoints": { + "type": "operation", + "input": { + "target": "com.amazonaws.m2#ListBatchJobRestartPointsRequest" + }, + "output": { + "target": "com.amazonaws.m2#ListBatchJobRestartPointsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.m2#AccessDeniedException" + }, + { + "target": "com.amazonaws.m2#ConflictException" + }, + { + "target": "com.amazonaws.m2#InternalServerException" + }, + { + "target": "com.amazonaws.m2#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.m2#ThrottlingException" + }, + { + "target": "com.amazonaws.m2#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "Lists all the job steps for JCL files to restart a batch job. This is only applicable for Micro Focus engine with versions 8.0.6 and above.
", + "smithy.api#http": { + "method": "GET", + "uri": "/applications/{applicationId}/batch-job-executions/{executionId}/steps", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.m2#ListBatchJobRestartPointsRequest": { + "type": "structure", + "members": { + "applicationId": { + "target": "com.amazonaws.m2#Identifier", + "traits": { + "smithy.api#documentation": "The unique identifier of the application.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "executionId": { + "target": "com.amazonaws.m2#Identifier", + "traits": { + "smithy.api#documentation": "The unique identifier of each batch job execution.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.m2#ListBatchJobRestartPointsResponse": { + "type": "structure", + "members": { + "batchJobSteps": { + "target": "com.amazonaws.m2#BatchJobStepList", + "traits": { + "smithy.api#documentation": "Returns all the batch job steps and related information for a batch job that previously ran.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.m2#ListDataSetImportHistory": { "type": "operation", "input": { @@ -5262,6 +5444,28 @@ "smithy.api#httpError": 404 } }, + "com.amazonaws.m2#RestartBatchJobIdentifier": { + "type": "structure", + "members": { + "executionId": { + "target": "com.amazonaws.m2#Identifier", + "traits": { + "smithy.api#documentation": "The executionId from the StartBatchJob response when the job ran for the first time.
", + "smithy.api#required": {} + } + }, + "jobStepRestartMarker": { + "target": "com.amazonaws.m2#JobStepRestartMarker", + "traits": { + "smithy.api#documentation": "The restart step information for the most recent restart operation.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An identifier for the StartBatchJob API to show that it is a restart operation.
" + } + }, "com.amazonaws.m2#S3BatchJobIdentifier": { "type": "structure", "members": { @@ -6115,6 +6319,14 @@ "value": "cannotParse", "name": "CANNOT_PARSE" }, + { + "value": "featureNotAvailable", + "name": "FEATURE_NOT_AVAILABLE" + }, + { + "value": "unsupportedEngineVersion", + "name": "UNSUPPORTED_ENGINE_VERSION" + }, { "value": "fieldValidationFailed", "name": "FIELD_VALIDATION_FAILED"