Creating a composite event trigger
To create a composite event trigger for a new reload 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 composite event configuration. Configure the task event trigger and note the event trigger name.
- Call the qrs/compositeevent API endpoint to retrieve the composite event entities for all tasks: GET qrs/compositeevent.
- In the response body of the API call, locate the composite event entity with the event trigger name that you entered in the QMC. Note the ID for this composite event entity.
- Call the qrs/compositeevent API endpoint with the composite event entity ID appended to the path to retrieve the detailed event configuration: GET qrs/compositeevent/{id}.
- Copy the entire content of the response body and paste it within compositeEvents: [] in the text editor.
- Remove the compositeEvents entity ID and compositeRules entity ID from the content.
-
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": [], "compositeEvents":[{ "createdDate": "2017-01-24T20:19:53.342Z", "modifiedDate": "2017-01-24T20:19:53.342Z", "modifiedByUserName": "INTERNAL\\sa_repository", "timeConstraint": { "id": "4a829520-dd58-495f-8666-79ee612a4463", "createdDate": "2017-01-24T20:19:53.342Z", "modifiedDate": "2017-01-24T20:19:53.342Z", "modifiedByUserName": "INTERNAL\\sa_repository", "days": 0, "hours": 0, "minutes": 360, "seconds": 0, "impactSecurityAccess": false, "schemaPath": "CompositeEvent.TimeConstraint" }, "compositeRules": [ { "createdDate": "2017-01-24T20:19:53.342Z", "modifiedDate": "2017-01-24T20:19:53.342Z", "modifiedByUserName": "INTERNAL\\sa_repository", "ruleState": 1, "reloadTask": { "id": "cf958691-4e4d-40ef-9510-48b39ef862d0", "operational": null, "name": "Reload task for app xyz", "taskType": 0, "enabled": true, "taskSessionTimeout": 1440, "maxRetries": 4, "privileges": null }, "userSyncTask": null, "externalProgramTask": null, "operational": { "id": "df8edf4e-61e0-4fd6-9c80-f8137f9f40d1", "timeStamp": "1753-01-01T00:00:00.000Z", "currentState": 0, "privileges": null }, "impactSecurityAccess": false, "schemaPath": "CompositeEvent.Rule" } ], "operational": { "id": "5d2ba538-0e28-45c1-97cb-b377bda8735f", "timesTriggered": 0, "privileges": null }, "name": "taskEventTrig", "enabled": true, "eventType": 1, "reloadTask": { "id": "4971c9dd-c0ba-4cd6-9d86-d2e16cf0332f", "operational": { "id": "78af94b7-0b6f-468a-9371-9b33afe39d65", "lastExecutionResult": { "id": "73e006c0-e9dc-4fe1-a78e-3a4cc3a0749a", "executingNodeName": "", "status": 0, "startTime": "1753-01-01T00:00:00.000Z", "stopTime": "1753-01-01T00:00:00.000Z", "duration": 0, "fileReferenceID": "00000000-0000-0000-0000-000000000000", "scriptLogAvailable": false, "details": [], "privileges": null }, "nextExecution": "1753-01-01T00:00:00.000Z", "privileges": null }, "name": "Relaod task for ooo", "taskType": 0, "enabled": true, "taskSessionTimeout": 1440, "maxRetries": 0, "privileges": null }, "userSyncTask": null, "externalProgramTask": null, "privileges": null, "impactSecurityAccess": false, "schemaPath": "CompositeEvent" }] }
- Copy the entire content from the text editor and paste it into the request body of the /qrs/reloadtask/create call to create a new reload task with the configured composite event trigger.