Page History
...
- Parameterization of the
cancel-orders.sh
shell script includes:-url="${JS7_JOC_URL}
: The JOC Cockpit URL is provided from an environment variable that users can specify with theDefault
job resource.-user=root
,--password=root
: The example makes use of user/password authentication. A number of ways are offered for authentication and management of credentials:- JS7 - Use of Credential Store with Shell Jobs: Explains how to read accounts and passwords from a credential store.
- JS7 - Identity Services: Offer a number of authentication methods such as user/password, LDAP, certificates etc.
- JS7 - How to connect to JOC Cockpit using the PowerShell Module: Provides examples for use of different authentication methods that similarly apply to shell jobs.
--controller-id="${JS7_CONTROLLER_ID}"
: The Controller ID is provided from an environment variable available with theDefault
job resource.--date-to="$(TZ="${JS7_AGENT_TZ}" date +'%Y-%m-%d')T00:00:00"
: Specifies the date and time to which orders have been scheduled that will be cancelled.- The time zone is provided from the
JS7_AGENT_TZ
environment variable available from theDefault
job resource. - The syntax
TZ=<time-zone> date ...
executes thedate
command for the time zone specified. For time zone identifiers see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. - If the job is executed on 23rd of October 2023 then the parameterization evaluates to
--date-to=2023-10-23T00:00:00
to indicate that any orders scheduled prior to this date should be cancelled.
- The time zone is provided from the
--time-zone="${JS7_AGENT_TZ}"
: Specifies that the Agent's time zone will be used. The value of this option has to match the time zone assumed for the--date-to
option.--states=SCHEDULED,WAITING
: Specifies that orders in the SCHEDULED and WAITING state should be cancelled, see JS7 - Order State Transitions.
- Error handling allows exit codes 0 and 3 to signal successful execution. Exit 3 signals that no orders have been found that match the criteria which is not considered an error.
Anchor | ||||
---|---|---|---|---|
|
...
- Parameterization of the
delete-notices.sh
shell script includes:- For parameters related to access and authentication with JOC Cockpit see chapter Job: Cancel-Orders
--date="$(TZ="${JS7_AGENT_TZ}" date --date="1 day ago" +'%Y-%m-%d')"
: Explanations for jobCancel-Orders
apply. The difference being that the--date
expects a date without time as it specifies the day for which Notices have been created that should be deleted. In addition, the parameterization specifies to use previous day. If the job is executed on 23rd of October 2023 then the parameterization evaluates to--date=2023-10-22
.--time-zone="${JS7_AGENT_TZ}"
: Specifies that the Agent's time zone will be used. The value of this option has to match the time zone assumed for the--date
option.
- Error handling allows exit codes 0 and 3 to signal successful execution. Exit code 3 signals that no notices have been found that match the criteria which is not considered an error.
Logging
Log output of the workflow can look like this:
Explanations:
- For both jobs the parameterization is logged.
- The jobs did not find orders/notices for cancellation/deletion. This fact is logged to the stderr channel but is not considered an error.
Further Resources
- JS7 - How to cancel orders using the REST Web Service API from the Shell
- JS7 - How to delete notices using the REST Web Service API from the Shell
...
Overview
Content Tools