Configure schedules in static configuration
When you create or update your schedule definition by using a PUT
request against the /openidm/config/schedule/
endpoint, this endpoint creates the schedule as a static configuration and includes it in promotions.
Create ESV variables
When you configure schedules in a static configuration, you can use environment secrets and variables (ESVs) in schedules to allow different settings between environments.
Example ESVs include:
esv-schedule-enabled
-
This ESV controls whether the schedule is enabled and should be set to
true
orfalse
in each environment as needed. esv-sync-schedule
-
This ESV controls when the schedule is run for cron triggers. For example, you could set the ESV to
0 0 10 ? * WED
to run the schedule every Wednesday at 10 AM in one environment and then set the ESV to0 0 17 * * ?
to run the schedule every day at 5 PM in another environment.To avoid a known issue where day
1
is Monday rather than Sunday, use three letters to specify the day instead. Learn more in Schedule configuration properties.
Learn more about creating ESV variables and applying updates in the Introduction to ESVs and in Set up configuration placeholders to reference an ESV.
Create schedules using ESV variables
You can create the two example ESVs (&{esv.schedule.enabled} and &{esv.sync.schedule}) described in the Create ESV variables section to control whether a schedule is enabled and when a schedule will run.
To create your schedule or update an existing schedule using these example variables, ensure you use a PUT
request against the /openidm/config/schedule/
endpoint.
For example:
curl \ --header "Authorization: Bearer <token>" \ (1) --header "content-type: application/json" \ --header "Accept-API-Version: resource=1.0" \ --header "If-None-Match: *" \ --request PUT "https://<tenant-env-fqdn>/openidm/config/schedule/<schedule-name>" \ (2) (3) --data '{ "isCron": true, "enabled": { "$bool": "&{esv.schedule.enabled}" (4) }, "persisted": true, "type": "cron", "misfirePolicy": "fireAndProceed", "invokeService": "sync", "invokeLogLevel": "info", "invokeContext": { "action": "reconcile", "mapping": "systemLdapAccounts_managedAlpha_user" }, "concurrentExecution": false, "schedule": "&{esv.sync.schedule}" (5) }'
1 | The access token you obtained when you authenticated to the Identity Cloud REST API. The access token is set as a bearer token in the Authorization HTTP header for each API request. Learn more in Authenticate to Advanced Identity Cloud with access token. |
2 | Your Advanced Identity Cloud tenant name. |
3 | The name of your schedule. |
4 | Placeholder for the ESV you created. |
5 | Placeholder for the ESV you created. |
After you’ve created or updated your schedule through REST, you should restart Advanced Identity Cloud services to substitute the placeholders with the corresponding ESV values. Learn more about how to Restart Advanced Identity Cloud services.
You can view your schedules in the Advanced Identity Cloud user interface (UI), but you should only update them using the ESVs you created. Alternatively, manage schedules using REST to keep your schedules using the ESV placeholders. If you make changes to the schedule in the UI, the ESV placeholders will be overwritten with the actual values. |