Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The JS7 offers to perform any operation on orders, workflows, jobs and related objects by the JS7 - REST Web Service API.
  • In addition, a PowerShell module is available for simplified access to the REST Web Service API. This is described in the JS7 - PowerShell Module article.
  • The REST Web Service API can also be accessed from Shell utilities such as curl.

...

Code Block
titleUsage
Usage: set_job_resource.sh [Options] [Switches]

  Options:
    --url=<url>                   | required: JOC Cockpit URL
    --user=<account>              | required: user account for login to JOC Cockpit, use <user> or <user>:<password>
    --controller-id=<identifier>  | required: Controller ID
    --job-resource=<path>         | required: path to job resource
    --key=<identifier>            | required: name of variable in job resource
    --value=<string>              | required: value of variable in job resource
    --cacert=<path>               | optional: path to Root CA Certificate for HTTPS connections
    --user=<account>              | optional: user account for login to JOC Cockpit
    --password=<account>          | optional: password for login to JOC Cockpit
    --log-dir=<directory>         | optional: log directory for log output of this script

  Switches:
    -h | --help                   | displays usage
    -v | --verbose                | show verbose log output
    --show-logs                   | shows log output if --log-dir is used
    --make-dirs                   | creates directories if they do not exist

...

  • --url
  • --user
    • Specifies the user account for login to JOC Cockpit.
    • --user=<user> can be specified to cause the password to be prompted.
    • --user=<user>:<password> can be specified.
  • --controller-id
    • Specifies the Controller ID to which the updated job resource should be deployed.
  • --job-resource
    • Specifies the path to the job resource in the JOC Cockpit inventory.
  • --key
    • Specifies the name of the variable in the job resource specified with the --job-resource option.
  • --value
    • Specifies the value of the variable in the job resource specified with the --job-resource option.
  • --cacert
    • Specifies the path to a .pem file that holds the Root CA Certificate and optionally Intermediate CA Certificates to verify HTTPS connections to JOC Cockpit.
  • --user
    • Specifies the directory in which the Agent should be installed.
  • --password
    • Specifies the directory in which the Agent should be installed.
  • --log-dir
    • If a log directory is specified then the script will log information about processing steps to a log file in this directory.
    • File names are created according to the pattern: set_job_resource.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.log
    • For example: set_job_resource.2022-03-19T20-50-45.log

...

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./set_job_resource.sh \
    --url=http://joc-2-0-primary:7446 \
    --controller-id=controller \
    --user=root \
    --password=:root \
    --job-resource=/ProductDemo/Variables/pdBusinessDate \
    --key=BusinessDate \
    --value=$(date +'%Y-%m-%d')

# updates the job resource variable "BusinessDate" from the current date
# the connection to JOC Cockpit is established by HTTP

...

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./set_job_resource.sh \
    --url=https://joc-2-0-primary:7446 \
    --cacert=/home/sos/jstest/certs/root-ca.pem \
    --controller-id=controller \
    --user=root \
    --password=:root \
    --job-resource=/ProductDemo/Variables/pdBusinessDate \
    --key=BusinessDate \
    --value=$(date +'%Y-%m-%d')

# updates the job resource variable "BusinessDate" from the current date
# the connection to JOC Cockpit is established by HTTPS and the Root CA Certificate is specified from the path to a .pem file

...