Versions Compared

Key

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

...

  • 1: argument errors
  • 4: this exit code is returned if the JS7 REST Web Service is not reachable or reports errors

Examples

The following examples illustrate typical use cases.

Update Job Resource Variable using HTTP Connection

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_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 UTC
# establishes the connection to JOC Cockpit by HTTP

Update Job Resource Variable using HTTPS Connection

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_set_job_resource.sh \
    --url=https://joc-2-0-primary:7443 \
    --cacert=/home/sos/jstest/certs/root-ca.pem \
    --controller-id=controller \
    --user=root \
    -p \
    --job-resource=/ProductDemo/Variables/pdBusinessDate \
    --key=businessDate \
    --env-var=BUSINESS_DATE \
    --value=$(TZ=Europe/London date +'%Y-%m-%d')

# updates the Job Resource argument "businessDate" from the current date
# the environment variable "BUSINESS_DATE" will be assigned the same date from a reference to the argument
# the date is specified from the UK time zone
# the connection to JOC Cockpit is established by HTTPS and the Root CA Certificate is specified from the path to a .pem file
# the user is prompted for input of the password

Authenticate from Client Certificate using HTTPS Connection

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_set_job_resource.sh \
    --url=https://joc-2-0-primary:7443 \
    --cacert=$HOME/certs/root-ca.crt \
    --client-key=$HOME/certs/centostest-primary.key \
    --client-cert=$HOME/certs/centostest-primary.crt \
    --controller-id=controller \
    --user=root \
    --job-resource=/ProductDemo/Variables/pdBusinessDate \
    --key=businessDate \
    --value=$(TZ=Europe/London date +'%Y-%m-%d')

# updates the Job Resource argument "businessDate" from the current date in the UK time zone
# the connection to JOC Cockpit is established by HTTPS and is authenticated by Client Key and Client Certificate

Update Job Resource Variable from File

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_set_job_resource.sh \
    --url=http://joc-2-0-primary:7446 \
    --controller-id=controller \
    --user=root \
    --password=root \
    --job-resource=/ProductDemo/Variables/pdConfigurationData \
    --key=configurationData \
    --env-var=CONFIGURATION_DATA \
    --file=./config.ini

# updates the Job Resource argument "configurationData" from the file specified
# the "CONFIGURATION_DATA" environment variable will hold the path to the file

Update Job Resource Variable from Encrypted Value

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_set_job_resource.sh \
    --url=http://joc-2-0-primary:7446 \
    --controller-id=controller \
    --user=root \
    --password=root \
    --job-resource=/ProductDemo/Variables/pdBusinessSecret \
    --key=businessSecret \
    --value='secret' \
    --encrypt-cert=./agent.crt
 
# updates the Job Resource variable "businessSecret" from some value
# the value of the "businessSecret" variable will be encrypted using an Agent's certificate
# the value of the "businessSecret" variable holds the encrypted symmetric key, initialization vector and encrypted secret

Update Job Resource Variable from Encrypted File

Code Block
titleExample for Update of a Job Resource Variable
linenumberstrue
./js7_set_job_resource.sh \
    --url=http://joc-2-0-primary:7446 \
    --controller-id=controller \
    --user=root \
    --password=root \
    --job-resource=/ProductDemo/Variables/pdConfigurationDataSecret \
    --key=configurationDataSecret \
    --env-var=CONFIGURATION_DATA_SECRET \
    --file=./config.ini \
    --encrypt-cert./foobar.crt

# updates the Job Resource variable "configurationDataSecret" from the file specified
# the contents of the file will be encrypted using the target Agent's certificate
# an additional variable "configurationDateSecret_key" and environment variable "CONFIGURATION_DATA_SECRET_key" will be created that both hold the encrypted symmetric key and initialization vector

...