Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

17.3.3 jobs resources

Operate jobs registered in Systemwalker Operation Manager.

The following operations are available.

Endpoint
(After /Systemwalker-omgr/api)

HTTP
Method

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
For the return values, refer to the icon type of the "4.10.2 Job Control Statement".

jobname

String

The return value varies depending on the icon type.
JNET: Name of the child job net
LNET: The job net name of the linked jobnet
BJOB: Batch job definition name
INTS: Work unit name
Other: Name of the batch program, command, or program to start as a job.

jobparam

String

Job parameters

directory

String

Directory

jobcomment

String

The return value varies depending on the icon type.
JNET: Job net comment of the child job net
LNET: Job net comment of the linked job net
Other: Comment on the job

req_host

String

Request Host Name
If more than one item is specified, they are separated by a comma (,).

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 return code of an unexecuted job is 0.

Note 1)

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)

17.3.3.1 Getting Job Information

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

HTTP Methods

GET

Request URI

/v1/subsystems/{subsystem}/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber}

/v1/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber} (If you omit the subsystem number)

Request Parameters

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

Note 1)

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

Status Codes

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.

  • The target job does not exist in the system.

  • The path parameter is specified incorrectly.

500

An error occurred on the server while processing the request.

Response Body

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.

Request Example
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 ********************
Response Example
{
  "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
}

17.3.3.2 Operating Job

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

HTTP Methods

POST

Request URI

/v1/subsystems/{subsystem}/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber}

/v1/projects/{projectname}/jobnets/{jobnetname}/jobs/{jobnumber} (If you omit the subsystem number)

Request Parameters

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

Note 1)

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".

Note 2)

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

Status Codes

Returns the following HTTP status codes.

Code

Specification

202

Processing of the request was successful.

400

The request parameter is invalid.

  • Required parameter is not specified.

  • You have specified a parameter that does not need to be specified.

  • The specified parameter value is invalid.

401

The credential is specified incorrectly.

403

You do not have permission to this project.

404

The target job does not exist.

  • The target job does not exist in the system.

  • The path parameter is specified incorrectly.

409

The specified operation cannot be performed on the target job.

  • Not in a job state that allows the specified operation.

500

An error occurred on the server while processing the request.

Response Body

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.

Request Example
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"
}
Response Example

Refer to the response example of the "17.3.3.1 Getting Job Information".

17.3.3.3 Getting a list of 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

HTTP Methods

GET

Request URI

/v1/jobs

Request Parameters

Common query parameters are available.

For more information, refer to the "17.2.3.2 Request Format".

Response

Status Codes

Returns the following HTTP status codes.

Code

Specification

200

Processing of the request was successful.

400

The request parameter is invalid.

  • You have specified a parameter that does not need to be specified.

  • You have specified the same query parameter more than once.

401

The credential is specified incorrectly.

500

An error occurred on the server while processing the request.

Response Body

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.

Request Example
GET /Systemwalker-omgr/api/v1/jobs?subsystem=0 HTTP/1.1
Host: Systemwalker Operation Manager server hostname:9900
Authorization: Basic ********************
Response Example

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".