Please note the following changes introduced as part of AIOps 2.4 release.
For adding device priority for devices, the following steps should be followed:
Priority configuration should be added to the AIOps Configuration collection. The swagger details of scheduler are as below:
Swagger: AIOpsConfiguration Request body: { "projectId": <projectId (int)>, "configType": "devicePriorityMapping", "configData": { "priorityMapping": [ { "priorityKey": <priority>, "priorityValue": <priority description> }, { "priorityKey": <priority>, "priorityValue": <priority description> } ] } } Example { "projectId": 1068, "configType": "devicePriorityMapping", "configData": { "priorityMapping": [ { "priorityKey": "1", "priorityValue": "1" }, { "priorityKey": "2", "priorityValue": "2" }, { "priorityKey": "3", "priorityValue": "3" }, { "priorityKey": "4", "priorityValue": "4" }, { "priorityKey": "5", "priorityValue": "5" }, { "priorityKey": "6", "priorityValue": "6" }, { "priorityKey": "7", "priorityValue": "7" }, { "priorityKey": "8", "priorityValue": "8" }, { "priorityKey": "9", "priorityValue": "9" } ] } } |
Excel for device import should contain “Device Priority” field and its value should be in string format and any of the priority key available in the configuration details. As it is an optional filed empty value also accepted:
AIOps 2.4 enables users to create policies and rules that control ticket creation time. To use this feature, following steps should be followed.
Enable the scheduling of the ticketing job at required intervals using below API:https://smartops-dev03.eastus.cloudapp.azure.com/paas/itops/itopsscheduler/swagger#/Scheduler/schedulers
PFB Below API contract for setting auto ticketing job
Method: POST Request Body: { "projectId": < projectId (int)> "job": "api/autoTicketing", "schedule": { "interval": { "minutes": 1 } }, "maximumInstances": 1, "smartopsTokenAvailable": true, "smartopsTokenKey": "offline-token", "jobData": { "requestMethod": "POST", "authType": "NO_AUTH", "requestBody": { "projectId": <projectId>, "errorResponseEmailId": <From mail address given in error configuration>, "errorResponseEmailPassword": <From mail password given in error configuration>, "errorResponseRecipientEmailId": <To mail address given in error configuration> }, "headers": { "Organization-name": <organization-name>, "Organization-key": <organization-key>, "user": <user>, "offline-token": <offline-token>, "Content-Type": "application/json" } } } |
Note:
For getting error mail response "errorResponseEmailId", "errorResponseEmailPassword", "errorResponseRecipientEmailId" should have the same value as in the error response configuration in Project Configuration.
Ticket trigger policy/rule for custom fields in an existing project
If an existing project contains custom fields that should be available as ticket triggering rule/policy fields, please follow the below steps to achieve the desired functionality.
Get all the attribute details of “tckt-trgrPolicyField” and “tckt-trgrRuleField” using the fetchReferenceData API. For getting all the ‘ticket trigger policy’ attributes, use reference type as “tckt-trgrPolicyField” in fetchReferenceData API. Similarly use reference type as “tckt-trgrRuleField” for getting ‘ticket trigger rule’ attributes.
Add the policy attributes and rule attributes to the project, using /api/projectMasterData API. The input should be a list of dictionaries where the key should be the ‘referenceValueCode’ and the value should be the ‘referenceValue’ from the output of fetchReferenceData API. Also add the ‘customFields’ in the project that needs to be added as ticket trigger policy/rule fields. The ‘referenceType’ should be “tckt-trgrPolicyField” and “tckt-trgrRuleField”.
Example:
{ "projectId": <projectId>, "referenceType": "tckt-trgrPolicyField", "referenceValues": [ {“source”: "Alert Source”}, {“alertName”: "Alert Name"}, {“customField.customName”: "Custom Name"} ] } |
The swagger for scheduler APIs are available at the below location:
https://smartops-dev03.eastus.cloudapp.azure.com/paas/itops/itopsscheduler/swagger#/Scheduler
Please refer below instructions for each parameter while creating schedulers:
job:
For testing purpose, below jobs can be used:
job1 – Execution completes instantly
job2 – Execution takes more than 1.5 minutes to complete
job3 – Execution takes more than 3 minutes to complete
job4 – Execution takes more than 7 minutes to complete
job5 – Execution takes more than 15 minutes to complete
maximumInstances:
This refers to number of instances of jobs that can run concurrently. If maximumInstances is set to 1, only after completion of current instance of a job, the next instance would be triggered, even if the trigger time is meet.
jobData:
The parametes to be passed to job for as arguments for execution. Here in case of these defined projects, any json can be passed.
smartopsTokenAvailable:
Flag to check if the requestBody/Headers in jobData contains smartops offlineToken. The accepted values are: true/false
smartopsTokenKey
Field to update smartops offline-token label. Currently the smartops offline-token label is “offline-token”
schedule:
Currently jobs can be scheduled using two methods – Cron and Interval.
Cron : Available duration keys and their default values:
year=None : 4-digit year
month=None : month (1-12)
day=None : day of month (1-31)
week=None : ISO week (1-53)
day_of_week=None : number or name of weekday (0-6 or mon,tue,wed,thu,fri,sat,sun)
hour=None : hour (0-23)
minute=None : minute (0-59)
second=None : second (0-59)
start_date=None : earliest possible date/time to trigger on (inclusive)
end_date=None : latest possible date/time to trigger on (inclusive)
timezone=None : time zone to use for the date/time calculations (defaults to scheduler timezone)
Cron values to be used:
Expression |
Field |
Description |
* |
any |
Fire on every value Eg: second=’*’ : Fire every second |
*/a |
any |
Fire every a values, starting from the minimum. Eg: minute=’*/2’ : Fire every 2nd minute |
a-b |
any |
Fire on any value within the a-b range (a must be smaller than b) Eg: hour='0-3': Fire at 00:00, 01:00, 02:00 and 03:00 |
a-b/c |
any |
Fire every c values within the a-b range Eg: minute='0-50/5': Fire every 5th minute from 0 to 50 minutes |
xth y |
day |
Fire on the x -th occurrence of weekday y within the month Eg: day='3rd fri': Fire every 3rd Friday of every month |
last x |
day |
Fire on the last occurrence of weekday x within the month Eg: day='last sun': Fire on last Sunday of every month |
Last |
day |
Fire on the last day within the month |
x,y,z |
any |
Fire on any matching expression; can combine any number of any of the above expressions |
Interval : Available duration keys, their default values and description:
weeks=0 : number of weeks to wait
days=0 : number of days to wait
hours=0 : number of hours to wait
minutes=0 : number of minutes to wait
seconds=0 : number of seconds to wait
start_date=None : starting point for the interval calculation
end_date=None : latest possible date/time to trigger on
timezone=None : time zone to use for the date/time calculations
Eg:
hours=2 : Executes every 2 hours,
start_date='2010-10-10 09:30:00' : Execution starts on 2010-10-10 at 9:30
end_date='2014-06-15 11:00:00' : : Execution ends on 2014-06-15 at 11:00
timezone=UTC : Considers timestamps in UTC timezone