import { IHandlerParameters } from "@zowe/imperative" ; import { IJob , GetJobs , JobsConstants } from "@zowe/zos-jobs-for-zowe-sdk" ; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; export class implements ICommandHandler export default class JobsHandler extends ZosmfBaseHandler { param { IHandlerParameters } params returns { Promise < void > } memberof public async processCmd ( params ) { const owner = ( params . arguments . owner != null ) ? params . arguments . owner : null ; const prefix = ( params . arguments . prefix != null ) ? params . arguments . prefix : JobsConstants . DEFAULT_PREFIX ; const jobs = await GetJobs . getJobsCommon ( this . mSession , { owner , prefix } ) ; params . response . data . setObj ( jobs ) ; params . response . data . setMessage ( `List of jobs returned for prefix "${ prefix }" and owner "${ owner }"` ) ; params . response . format . output ( { fields : [ "jobid" , "retcode" , "jobname" , "status" ] , output : jobs , format : "table" } ) ; } }