Synopsis
jobschrestexec connection information file |
Description
This command is called by a REST execution job.
Executes, waits for completion, or forcibly terminates jobs (API) on a cloud service for which a REST interface is provided.
You can set the key value of the response result of the submitted job in a job net variable to link with the succeeding job.
Options
Connection information file
Specify the file name containing the parameters to be specified in the command.
Specify a full path of up to 256 bytes.
For the details of the connection information file, refer to the "19.9.1 Connection information file".
Return values
Return value | Meaning |
---|---|
0 | Terminated normally |
1 | The command argument is invalid. |
2 | The parameter setting value in the connection information file is invalid. |
3 | A file operation failed during command execution. |
4 | The HTTP request to the specified destination URL failed. |
5 | The HTTP request to the specified destination URL timed out. |
6 | The system timed out waiting for the request to complete. |
7 | The request execution result is not the specified success value. |
8 | Failed to parse request response result. |
9 | It was not run because it is not registered as a Systemwalker Operation Manager job. |
10 | Failed to get credentials. |
99 | An internal error occurred. |
Command location
Windows | <Systemwalker Operation Manager installation directory>\MpWalker.JM\bin |
Linux | /usr/bin |
Examples
The following is an example job definition when the connection information file path is /connectionfiles/connectioninfo.json.
jobschrestexec /connectionfiles/connectioninfo.json |
Execution Results/Output Format
Example of output when a job on a cloud service is submitted
HttpStatusCode=200 |
Example of output when waiting for the completion of a submitted job on a cloud service
HttpStatusCode=200 |
HttpResHeader, HttpResBody, ChkResultHttpResHeader and ChkResultHttpResBody are not output if no response output destination is specified.
If the response result specification key is set to a job net variable, the following format is output.
Specified job net variable name = Value of the key specified in the response result
Cautions
This command can be executed only when it is registered as a job (REST execution job) of Systemwalker Operation Manager. It can only be run by Systemwalker Operation Manager jobs, such as directly from a command prompt.
Waiting for the submitted job on the cloud service to complete is possible only if the cloud service provides an API for obtaining the result of the execution job.
You can forcibly terminate a job running on a cloud service in accordance with the forcible termination of a REST execution job only if the cloud service provides an API for forcibly terminating execution jobs.
If you kill a REST execution job with a setting that does not make a kill request, the REST execution job is killed, but the cloud service job that is running is not killed.
The following is only possible if the API Content-Type is application/json.
Waiting for the submitted cloud service job to complete
Forcibly terminating a job on a cloud service when a REST execution job is forcibly terminated
Linkage between jobs by setting job net variables for response results
The contents of the HTTP response header and the HTTP response body are not output to the standard output. You can output to a file by specifying the path of the output result file in the connection information file.
If the status code of the HTTP request is not in the 200 range, the REST execution job will result in an HTTP request failure error.
In the case of a forced termination request, if the forced termination request fails, the system log is output and an error is reported to the administrator.
Even in the case of a forced termination request, if a REST execution job terminates abnormally for some reason after a job execution request on the cloud service, the forced termination of the job on the cloud service is not guaranteed.
This command cannot be executed in a network job or distributed execution job.