Operate jobs registered in Systemwalker Operation Manager.
The following operations are available.
Endpoint | HTTP | Operation details |
---|---|---|
/v1/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber} | GET | Gets information about the specified job. |
POST | Operates the specified job. | |
/v1/jobs | GET | Gets a list of job information. |
The fields of the objects in the jobs resource are as below.
If you want to specify a project that is unique in the system, specify the project name, job net name and job number in the SE version. For EE versions, specify the subsystem number, project name, job net name and job number.
Filed Name | Type | Specification |
---|---|---|
host | String | Host name of the connection destination |
subsystem | Numeric | Subsystem number |
projectname | String | Project name |
jobnetname | String | Job net name |
jobnumber | Numeric | Job number |
jobname_jes | String | Job name in job execution control |
jobiconex | String | Description of the icon type |
jobicon | List | Icon type |
jobname | String | The return value varies depending on the icon type. |
jobparam | String | Job parameters |
directory | String | Directory |
jobcomment | String | The return value varies depending on the icon type. |
req_host | String | Request Host Name |
status | List | Job status (Note 1) |
starttime | Date and time | Last Start Date and Time |
endtime | Date and time | Last End Date and Time |
endcode | Numeric | End code |
The returns of status field are as below.
Field values | Job status |
---|---|
Abend | Abnormally ended |
Forced | Canceled |
Pause | Paused |
Execute | Running |
Wait | Waiting |
Pseudo | Pseudo-normal |
Normal | Normally completed |
Disable | Disabled |
Delay | Execution delayed |
Warning | Warning |
Pass & W | Path state (Waiting for execution) |
Pass & P | Path state (Paused) |
Pass & D | Path state (Disabled) |
Function Description
Get the job information by sending a GET method request with the jobs resource.
Privilege/Execution Environment Required
You must have at least Browse permissions on the project where the specified job resides.
Requests
GET
/v1/subsystems/{subsystem}/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber}
/v1/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber} (If you omit the subsystem number)
Under Path Parameters, specify the following parameters.
Parameter | How to specify | Type | Specification |
---|---|---|---|
subsystem | Path | Numeric | Specify the subsystem number (from 0 to 9) on which the target job resides. If you omit the subsystem number, the value is 0. |
projectname(*) | Path | String | Specify the name of the project in which the job exists. |
jobnetname(*) | Path | String | Specify the name of the job net in which the job exists. |
jobnumber(*) | Path | Numeric | Specify the target job number (Note 1). |
(*):Required Parameters
Path: Path parameters
The job number is the number specified in the job control statement. You can use the Web API of the "17.3.3.3 Getting a list of job information" to get the job number of the job registered in the job net.
Response
Returns the following HTTP status codes.
Code | Specification |
---|---|
200 | Processing of the request was successful. |
401 | The credential is specified incorrectly. |
404 | The target job does not exist.
|
500 | An error occurred on the server while processing the request. |
Returns the object of the target jobs resource.
Usage Examples
An example of using the API to get a project with subsystem number 0, project name "SampleProject", job net name "SampleJobnet" and getting a job with job number 1 is as follows. Note that the response example shows the objects of the jobs resource that are stored in the data field, and the response header and other fields are omitted.
GET /Systemwalker-omgr/api/v1/subsystems/0/projects/SampleProject/jobnets/SampleJobnet/jobs/1 HTTP/1.1 Host: Systemwalker Operation Manager server hostname:9900 Authorization: Basic ********************
{ "host": "Systemwalker Operation Manager server hostname", "subsystem": 0, "projectname": "SampleProject", "jobnetname": "SampleJobnet", "jobnumber": 1, "jobname_jes": "SampleJob", "jobiconex": "Execute command", "jobicon": "CMND", "jobname": "SampleJob", "jobparam": "", "directory": "", "jobcomment": "Command execution", "req_host": "", "status": "Normal", "starttime": "2019/12/31 12:00:00", "endtime": "2019/12/31 12:00:01", "endcode": 0 }
Function Description
Operate the job by submitting a request for the POST method with the jobs resource.
Privilege/Execution Environment Required
You must have at least permissions to the project in which the specified job exists.
Requests
POST
/v1/subsystems/{subsystem}/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber}
/v1/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber} (If you omit the subsystem number)
Under Path Parameters and Request Body, specify the following parameters.
Parameter | How to specify | Type | Specification |
---|---|---|---|
subsystem | Path | Numeric | Specify the subsystem number (from 0 to 9) on which the target job resides. If you omit the subsystem number, the value is 0. |
projectname(*) | Path | String | Specify the name of the project in which the target job exists. |
jobnetname(*) | Path | String | Specify the name of the target job. |
jobnumber(*) | Path | Numeric | Specify the target job number (Note 1). |
control(*) | Body | List | Specify the operation type for the job. (Note 2) |
(*):Required Parameters
Path: Path parameters
Body: Request bodies
The job number is the number specified in the job control statement. You can check the job number of the job registered in the job net by narrowing down to an arbitrary job net using the Web API of the "17.3.3.3 Getting a list of job information".
Possible values for the message body control parameter are:
Specified value | Specification |
---|---|
cancel | Forcibly terminates a running or delayed job. |
pause | Stops a job that is waiting to be executed or has terminated. |
continue | Unstops a stopped job. |
disable | Invalidates jobs that are waiting to be executed, stopped, or terminated. |
enable | Undisables a disabled job. |
rerun | Restart an abnormally or forcibly terminated job. |
Response
Returns the following HTTP status codes.
Code | Specification |
---|---|
202 | Processing of the request was successful. |
400 | The request parameter is invalid.
|
401 | The credential is specified incorrectly. |
403 | You do not have permission to this project. |
404 | The target job does not exist.
|
409 | The specified operation cannot be performed on the target job.
|
500 | An error occurred on the server while processing the request. |
Returns an object from the specified jobs resource.
Note
Web API operations on job nets that exist in a project are not synchronized with Systemwalker Operation Manager server operations. Therefore, Web API responses do not guarantee that the server will complete its processing. Objects returned in the response body may not reflect the operation.
Usage Examples
An example of using the API to get a project with subsystem number 0, project name "SampleProject", job net name "SampleJobnet" and restarting a job with job number 5 is as follows.
POST /Systemwalker-omgr/api/v1/subsystems/0/projects/SampleProject/jobnets/SampleJobnet/jobs/5 HTTP/1.1 Host: Systemwalker Operation Manager server hostname:9900 Authorization: Basic ******************** Content-Type: application/json { "control": "rerun" }
Refer to the response example of the "17.3.3.1 Getting Job Information".
Function Description
Get a list of jobs resources.
The target job net is a jobnet that exists in a project in which the user specified in the credentials has reference rights or more.
Requests
GET
/v1/jobs
Common query parameters are available.
For more information, refer to the "17.2.3.2 Request Format".
Response
Returns the following HTTP status codes.
Code | Specification |
---|---|
200 | Processing of the request was successful. |
400 | The request parameter is invalid.
|
401 | The credential is specified incorrectly. |
500 | An error occurred on the server while processing the request. |
Returns an object from the jobs resource.
Usage Examples
The following example shows how to use the API to get a list of jobs registered in subsystem 0.
GET /Systemwalker-omgr/api/v1/jobs?subsystem=0 HTTP/1.1 Host: Systemwalker Operation Manager server hostname:9900 Authorization: Basic ********************
Returns an object from the jobs resource as an array of objects in the data field. For the objects in the jobs resource, refer to the response example of the "17.3.3.1 Getting Job Information".