Versions Compared

Key

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

...

The following examples illustrate typical use cases.

Exporting Objects

  • Any object can be exported to an archive file in .zip or .tar.gz format.
  • Users can export individual objects from their path and object type. Alternatively, objects can be exported by folders, optionally limited to specific object types.

Code Block
languagebash
titleExamples for Exporting Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# export workflows
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --path=/ap/ap3jobs,/ap/Agent/apRunAsUser --type=WORKFLOW

# export schedules
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --path=/ap/Agent/apAgentSchedule01,/ap/Agent/apAgentSchedule02 --type=SCHEDULE

# export objects from folder
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --folder=/ap --recursive

# export objects from folder using relative path
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --folder=/ap/Agent --recursive --use-short-path

# export objects from folder, limiting object types, feeding audit log
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --folder=/ap --recursive -type=WORKFLOW,JOBRESOURCE --audit-message="export to production"

Importing Objects

Code Block
languagebash
titleExamples for Importing Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# import objects
./deploy-workflow.sh import ${request_options[@]} \
    --file=export.zip --overwrite

# import objects to a new top-level folder and apply suffix
./deploy-workflow.sh import ${request_options[@]} \
    --file=export.zip --folder=/Version22 --suffix=v22

...

  • Previously exported objects can be imported, for example from a non-production environment to a production environment.
  • For import users can specify that existing objects with the same name and type should be overwritten. In addition, users can specify a prefix or suffix to be added to the name of imported objects.
  • On export users can specify to apply the absolute or relative path of objects when creating the archive file.
  • On import users can accept the path of imported objects as given with the archive file. Alternatively, users can specify a top-level folder hierarchy to which paths from objects in the archive file will be added.

Code Block
languagebash
titleExamples for Importing Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# import objects
./deploy-workflow.sh import ${request_options[@]} \
    --file=export.zip --overwrite

# import objects to a new top-level folder and apply suffix
./deploy-workflow.sh import ${request_options[@]} \
    --file=export.zip --folder=/Version22 --suffix=v22

Exporting and Importing/Deploying for High Security Level

  • For deployment of objects using the JS7 High Security Level requires digital signing outside of JOC Cockpit in order to securely apply the user's Private Key. To this purpose the import-deploy command is used. For deployment in Low or Medium Security Level the deploy command is used.
    • Digital signing includes that based on the user's Private Key and Certificate signature files are created that have to be added to the archive file for later import & deployment.
    • The steps to import and to deploy are available from a single operation to prevent tampering of objects after import.
  • There are a number of ways how to perform signing. The recommended solution is to use the js7_sign_workflow.sh|.cmd script as explained from the JS7 - Signing Workflows with X.509 Certificates using Unix Shell Script article. The below example explains the steps to export, sign and import/deploy objects.

Code Block
languagebash
titleExample for Exporting and Importing/Deploying for High Security Level
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# export objects from folder for signing
./deploy-workflow.sh export ${request_options[@]} \
    --file=export.zip --folder=/myFolder --recursive --for-signing

# digitally sign objects
mkdir -p ./temp
rm -fr ./temp/*
unzip -d ./temp ./export.zip
./js7_sign_workflow.sh --dir=./temp --key=./ecdsa.key --cert=./ecdsa.crt --hash=sha512
rm -f ./import-from-signing.zip
cd ./temp
zip -r ../import-from-signing.zip *
cd -

# import/deploy objects
./deploy-workflow.sh import-deploy ${request_options[@]} \
    --file=import-from-signing.zip

...

-from-signing.zip

Deploying and Revoking Objects

  • Deployable objects are visible in the inventory from the Controller system folder, for example workflows, job resources etc.
  • Such objects are in draft status after modification by the user. Deploying such objects makes them available for Controllers & Agents and sets them to the deployed status.
  • Deployed objects can be revoked which withdraws the objects from Controller & Agents and sets them to the draft status.

Code Block
languagebash
titleExamples for Deploying and Revoking Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# deploy objects from folder recursively and update daily plan
./deploy-workflow.sh deploy ${request_options[@]} \
    --folder=/ap/Agent --recursive --date-from=now

# deploy workflows and update daily plan
./deploy-workflow.sh deploy ${request_options[@]} \
    --path=/ap/ap3jobs,/ap/apEnv --type=WORKFLOW --date-from=now

# revoke workflows
./deploy-workflow.sh revoke ${request_options[@]} \
    --path=/ap/ap3jobs,/ap/apEnv --type=WORKFLOW

# revoke objects from folder
./deploy-workflow.sh revoke ${request_options[@]}  \
    --folder=/ap/Agent --recursive

...

-recursive

Releasing and Recalling Objects

  • Releasable objects are visible in the inventory from the Automation system folder, for example calendars, schedules etc.
  • Such objects are in draft status after modification by the user. Releasing such objects activates them and sets them to the released status.
  • Released objects can be recalled which deactivates the objects and sets them to the draft status.

Code Block
languagebash
titleExamples for Releasing and Recalling Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# release objects from folder and update daily plan
./deploy-workflow.sh release ${request_options[@]} \
    --folder=/ap/Agent --recursive --date-from=now

# release schedules and update daily plan
./deploy-workflow.sh release ${request_options[@]} \
    --path=/ap/Agent/apAgentSchedule01,/ap/Agent/apAgentSchedule02 --type=SCHEDULE --date-from=now

# recall objects from folder
./deploy-workflow.sh recall ${request_options[@]} \
    --folder=/ap/Agent --recursive

# recall schedules
./deploy-workflow.sh recall ${request_options[@]} \
    --path=/ap/Agent/apAgentSchedule01,/ap/Agent/apAgentSchedule02 --type=SCHEDULE

...

  • Objects can be added to the inventory from files in JSON format related to the object type such as a workflow, schedule. Newly added objects are in draft status.
  • Objects can be removed from the inventory which will move them to the trash from which they can be restored or deleted.

Code Block
languagebash
titleExamples for Storing and Removing Objects
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# store object
./deploy-workflow.sh store ${request_options[@]} \
    --path=/ap/NewFolder01/NewWorkflow01 --type=WORKFLOW --file=NewWorkflow01.workflow.json

# remove object, update daily plan
./deploy-workflow.sh remove ${request_options[@]} \
    --path=/ap/NewFolder01/NewWorkflow01 --type=WORKFLOW --date-from=now

# remove objects from folder, update daily plan
./deploy-workflow.sh remove ${request_options[@]} \
    --folder=/ap/NewFolder01 --date-from=now

...

  • Objects that have previously been removed reside in the trash.
  • Objects can be restored and or can be permanently deleted from the trash.
    • To restore an object from the trash the path, object type and new path in the inventory must be specified. Optionally a prefix or suffix can be added to restored object names. Restored objects are in draft status.
    • To permanently delete objects from the trash they can be specified from their path & object type or from a folder.

...