Versions Compared

Key

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

...

The following examples illustrate typical use cases.

...

Adding Orders

Code Block
titleExample Examples for Cancelling OrdersAddingOrders
linenumberstrue
./cancel-dailyplan-orders.sh \
    # common options for connection to JS7 REST API
request_options=(--url=http://joc-2-0-primary:7446 \
    localhost:4446 --user=root \
    --password=root \
    --datecontroller-to="$(date +'%Y-%m-%d')"id=controller)

# add cancelsad orders of today's daily plan
# implies that the system time zone is used (default)

Cancel orders from the Daily Plan two days ago

Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=https://joc-2-0-primary:7443 \
    --cacert=/home/sos/jstest/certs/root-ca.pem \
    --user=root \
    -p \
    --date-to="$(TZ=Europe/London date --date="2 day ago" +'%Y-%m-%d')" \
    --time-zone=Europe/London
 
# cancels orders from yesterday's daily plan
# establishes the connection to JOC Cockpit by HTTPS and the Root CA Certificate is specified from the path to a .pem file
# asks the user for interactive keyboard input of the password used for the account specified
# specifies the date from an individual time zone

Cancel orders from the Daily Plan for a date range

Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --date-from="$(TZ=Europe/London date --date="10 day ago" +'%Y-%m-%d')" \
    --date-to="$(TZ=Europe/London date --date="2 day ago" +'%Y-%m-%d')" \
    --time-zone=Europe/London
 
# cancels orders from the daily plan between 10 days ago and 2 days ago
# specifies the date from an individual time zone

Cancel orders from the Daily Plan limited by a list of workflow folders

Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --date-to="$(date +'%Y-%m-%d')" \
    --workflow-folders=/ProductDemo/CyclicExecution,/ProductDemo/ScheduledExecution \
    --recursive

# cancels orders from today's Daily Plan
# limits cancellation to orders for workflows from the given folders
# looks up sub-folders recursively

Cancel orders from the Daily Plan limited by a list of workflows

Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --date-to="$(date +'%Y-%m-%d')" \
    --workflows=/ProductDemo/CyclicExecution/Cyclic-Check,/ProductDemo/ScheduledExecution/Daily-EOD

# cancels orders from today's Daily Plan
# limits cancellation to orders for the given list of workflows

Cancel orders from the Daily Plan limited by a list of schedule folders

Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --date-to="$(date +'%Y-%m-%d')" \
    --schedule-folders=/ProductDemo/CyclicExecution,/ProductDemo/ScheduledExecution \
    --recursive

# cancels orders from today's Daily Plan
# limits cancellation to orders created from schedules from the given folders
# looks up sub-folders recursively

Cancel orders from the Daily Plan limited by a list of schedules

hoc order
./manage-workflow.sh add-order ${request_options[@]} \
	--workflow=ap3jobs

# add ad hoc order for specific job
./manage-workflow.sh add-order ${request_options[@]} \
	--workflow=ap3jobs --start-position=job2 --end-position=job3

# add pending order
./manage-workflow.sh add-order ${request_options[@]} \
	--workflow=ap3jobs --date-to=never

# add scheduled order and force admission
./manage-workflow.sh add-order ${request_options[@]} \
	--workflow=ap3jobs --order-name=sample-1 --date-to=now+15 --force

Cancelling Orders

Code Block
titleExamples for Cancelling Orders
linenumberstrue
# 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
./manage-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
./manage-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
titleExamples for Suspending and Resuming Orders
linenumberstrue
# 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
./manage-workflow.sh suspend-order ${request_options[@]} \
	--workflow=ap3jobs

# suspend orders in workflow and terminate running job
./manage-workflow.sh suspend-order ${request_options[@]} \
	--workflow=ap3jobs -force

# resume suspended orders in workflow
./manage-workflow.sh resume-order ${request_options[@]} \
	--workflow=ap3jobs --state=SUSPENDED

Letting run Orders

Code Block
titleExample for Letting Run Orders
linenumberstrue
# 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
./manage-workflow.sh letrun-order ${request_options[@]} \
	--workflow=ap3jobs --state=WAITING

Transferring Orders

Code Block
titleExample for Transferring Orders
linenumberstrue
# 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
./manage-workflow.sh transfer-order ${request_options[@]} \
	--workflow=ap3jobs

Suspending and Resuming Workflows

Code Block
titleExample for Suspending and Resuming Workflows
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# suspend workflow
./manage-workflow.sh suspend-workflow ${request_options[@]} \
	--workflow=ap3jobs

# resume workflow
./manage-workflow.sh resume-workflow ${request_options[@]} \
	--workflow=ap3jobs

Stopping and Unstopping Jobs

Code Block
titleExample for Stopping and Unstopping Jobs
linenumberstrue
# 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
./manage-workflow.sh stop-job ${request_options[@]} \
	--workflow=ap3jobs --label=job1,job2

# unstop jobs from labels
./manage-workflow.sh unstop-job ${request_options[@]} \
	--workflow=ap3jobs --label=job1,job2

Skipping and Unskipping Jobs

Code Block
titleExample for Skipping and Unskipping Jobs
linenumberstrue
# 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
./manage-workflow.sh skip-job ${request_options[@]} \
	--workflow=ap3jobs --label=job1,job2

# unskip jobs from labels
./manage-workflow.sh unskip-job -${request_options[@]} \
	--workflow=ap3jobs --label=job1,job2

Posting and Deleting Notices

Code Block
titleExample for Posting and Deleting Notices
linenumberstrue
# 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
./manage-workflow.sh post-notice ${request_options[@]} \
	--notice-board=ap3jobs

# post notice for specific daily plan date and lifetime
./manage-workflow.sh post-notice ${request_options[@]} \
	--notice-board=ap3jobs --notice-id=2024-08-26 --notice-lifetime=6h

# delete notices for current daily plan date
./manage-workflow.sh delete-notice ${request_options[@]} \
	--notice-board=ap3jobs

# delete notices for notice board and notice identifiers
./manage-workflow.sh delete-notice ${request_options[@]} \
	--notice-board=ap3jobs --notice-id=2024-08-25,2024-08-26
Code Block
titleExample for Cancelling Orders
linenumberstrue
./cancel-dailyplan-orders.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --date-to="$(date +'%Y-%m-%d')" \
    --schedules=/ProductDemo/CyclicExecution/Cyclic-Check,/ProductDemo/ScheduledExecution/Daily-EOD

# cancels orders from today's Daily Plan
# limits cancellation to orders created by the given list of schedules

Resources

...