Creating a schema event trigger
To create a schema event trigger and associate it with a task:
- Enter the following into a text editor:
{ "task":{"app": { "id": "bda74c3e-c7e6-4154-845a-139ad7c07390" }, "name": "Reload task for License Monitor" }, "schemaEvents": [], "compositeEvents":[] }
- Update the app ID and name of the task according to your requirements. The app ID is the ID of the app that you want this task to reload.
- In the QMC, create a task that you will use to generate the required schema event configuration. Configure the schema event trigger for the task and note the event trigger name.
- Call the qrs/schemaevent API endpoint to retrieve the schema event entities for all tasks: GET qrs/schemaevent.
- In the response body of the API call, locate the schema event entity with the event trigger name that you entered in the QMC. Note the ID for this schema event entity.
- Call the qrs/schemaevent API endpoint with the schema event entity ID appended to the path to retrieve the detailed event configuration: GET qrs/schemaevent/{id}.
- Copy the entire content of the response body and paste it within schemaEvents: [] in the text editor.
- Remove the schema event entity ID and the ID of the reload task.
- Remove all content related to operational properties.
-
The complete JSON body should look similar to the following:
{ "task": {"app": { "id": "bda74c3e-c7e6-4154-845a-139ad7c07390" }, "name": "Reload task for License Monitor" }, "schemaEvents":[ { "createdDate": "2017-01-17T14:16:49.120Z", "modifiedDate": "2017-01-17T14:16:49.120Z", "modifiedByUserName": "INTERNAL\\sa_repository", "timeZone": "America/New_York", "daylightSavingTime": 0, "startDate": "2017-01-17T09:21:25.000", "expirationDate": "9999-01-01T00:00:00.000", "schemaFilterDescription": [ "* * - 2 1 * * *" ], "incrementDescription": "0 0 1 0", "incrementOption": 3, "name": "WeeklyTrigTues", "enabled": true, "eventType": 0, "reloadTask": { "name": "Reload task for License Monitor 2", "taskType": 0, "enabled": true, "taskSessionTimeout": 1440, "maxRetries": 0, "privileges": null }, "userSyncTask": null, "externalProgramTask": null, "privileges": null, "impactSecurityAccess": false, "schemaPath": "SchemaEvent" } ] }
- Copy the entire content from the text editor and paste it into the request body of the /qrs/reloadtask/create API call to create a new reload task with the configured schema event trigger.