...
The following examples illustrate typical use cases.
Adding Orders
Code Block |
---|
language | bash |
---|
title | Examples for Adding Orders |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# add ad hoc order
./operate-workflow.sh add-order ${request_options[@]} \
--workflow=ap3jobs
# add ad hoc order for specific job
./operate-workflow.sh add-order ${request_options[@]} \
--workflow=ap3jobs --start-position=job2 --end-position=job3
# add pending order
./operate-workflow.sh add-order ${request_options[@]} \
--workflow=ap3jobs --date-to=never
# add scheduled order and force admission
./operate-workflow.sh add-order ${request_options[@]} \
--workflow=ap3jobs --order-name=sample-1 --date-to=now+15 --force |
Cancelling Orders
Code Block |
---|
language | bash |
---|
title | Examples for Cancelling Orders |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# cancel orders by state
./operate-workflow.sh cancel-order ${request_options[@]} \
--workflow=ap3jobs --date-to=-2h --state=SCHEDULED,PROMPTING,SUSPENDED,INPROGRESS,RUNNING
# cancel orders by state, yesterday's start date, folder recursively
./operate-workflow.sh cancel-order ${request_options[@]} \
--folder=/ap --recursive --date-to="$(TZ=Europe/London date + '%Y-%m-%d')" --state=SCHEDULED,PROMPTING,SUSPENDED,INPROGRESS,RUNNING |
Suspending and Resuming Orders
Code Block |
---|
language | bash |
---|
title | Examples for Suspending and Resuming Orders |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# suspend orders in workflow
./operate-workflow.sh suspend-order ${request_options[@]} \
--workflow=ap3jobs
# suspend orders in workflow and terminate running job
./operate-workflow.sh suspend-order ${request_options[@]} \
--workflow=ap3jobs --force
# resume suspended orders in workflow
./operate-workflow.sh resume-order ${request_options[@]} \
--workflow=ap3jobs --state=SUSPENDED |
Letting run Orders
Code Block |
---|
language | bash |
---|
title | Example for Letting Run Orders |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# let run waiting orders in workflow
./operate-workflow.sh letrun-order ${request_options[@]} \
--workflow=ap3jobs --state=WAITING |
Transferring Orders
Code Block |
---|
language | bash |
---|
title | Example for Transferring Orders |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# transfer orders to latest workflow version
./operate-workflow.sh transfer-order ${request_options[@]} \
--workflow=ap3jobs |
Suspending and Resuming Workflows
Code Block |
---|
language | bash |
---|
title | Example for Suspending and Resuming Workflows |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# suspend workflow
./operate-workflow.sh suspend-workflow ${request_options[@]} \
--workflow=ap3jobs
# resume workflow
./operate-workflow.sh resume-workflow ${request_options[@]} \
--workflow=ap3jobs |
Stopping and Unstopping Jobs
Code Block |
---|
language | bash |
---|
title | Example for Stopping and Unstopping Jobs |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# stop jobs from labels
./operate-workflow.sh stop-job ${request_options[@]} \
--workflow=ap3jobs --label=job1,job2
# unstop jobs from labels
./operate-workflow.sh unstop-job ${request_options[@]} \
--workflow=ap3jobs --label=job1,job2 |
Skipping and Unskipping Jobs
Code Block |
---|
language | bash |
---|
title | Example for Skipping and Unskipping Jobs |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# skip jobs from labels
./operate-workflow.sh skip-job ${request_options[@]} \
--workflow=ap3jobs --label=job1,job2
# unskip jobs from labels
./operate-workflow.sh unskip-job ${request_options[@]} \
--workflow=ap3jobs --label=job1,job2 |
Posting, Reading and Deleting Notices
Code Block |
---|
language | bash |
---|
title | Example for Posting, Reading and Deleting Notices |
---|
linenumbers | true |
---|
|
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)
# post notice for current daily plan date
./operate-workflow.sh post-notice ${request_options[@]} \
--notice-board=ap3jobs
# post notice for specific daily plan date and lifetime
./operate-workflow.sh post-notice ${request_options[@]} \
--notice-board=ap3jobs --notice-id=2024-08-26 --notice-lifetime=6h
# reading notices from notice board
./operate-workflow.sh get-notice ${request_options[@]} \
--notice-board=ap3jobs
# reading specific notice from notice board
./operate-workflow.sh get-notice ${request_options[@]} \
--notice-board=ap3jobs --notice-id=2024-08-26
# reading notices by folder
./operate-workflow.sh get-notice ${request_options[@]} \
--folder=/ap --recursive
# delete notices from notice board for current daily plan date
./operate-workflow.sh delete-notice ${request_options[@]} \
--notice-board=ap3jobs
# delete specific notices from notice board using notice identifiers
./operate-workflow.sh delete-notice ${request_options[@]} \
--notice-board=ap3jobs --notice-id=2024-08-25,2024-08-26
# delete notices by folder
./operate-workflow.sh delete-notice ${request_options[@]} \
--folder=/ap --recursive |
...