import { IHandlerParameters } from "@zowe/imperative" ; import { CancelJobs , GetJobs , IJob } from "@zowe/zos-jobs-for-zowe-sdk" ; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; export class implements ICommandHandler export default class JobHandler extends ZosmfBaseHandler { private type { * } memberof private arguments : any ; param { IHandlerParameters } params returns { Promise < void > } memberof public async processCmd ( params ) { this . arguments = params . arguments ; const jobid = this . arguments . jobid + "" ; const job = await GetJobs . getJob ( this . mSession , jobid ) ; await CancelJobs . cancelJobForJob ( this . mSession , job , this . arguments . modifyVersion ) ; const message = `Successfully canceled job ${ job . jobname } (${ jobid })` ; this . console . log ( message ) ; this . data . setMessage ( message ) ; this . data . setObj ( job ) ; } }