AIOps 2.4 - Usage Document

 

Please note the following changes introduced as part of AIOps 2.4 release.

Device priority for devices

For adding device priority for devices, the following steps should be followed:

  1. 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"

    }

    ]

    }

    }

  2. 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:
    Picture 388589712

Ticket Trigger Wait Time Policies and Rules

AIOps 2.4 enables users to create policies and rules that control ticket creation time. To use this feature, following steps should be followed.

  1. Create ticket triggering policies and rules as required using the AIOps UI.
  2. 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

  3. 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.

 

  1. 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.

  2. 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"}

]

}


AIOps Scheduler Component

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:

  1. job:

 

For testing purpose, below jobs can be used:

  1. job1 – Execution completes instantly

  2. job2 – Execution takes more than 1.5 minutes to complete

  3. job3 – Execution takes more than 3 minutes to complete

  4. job4 – Execution takes more than 7 minutes to complete

  5. job5 – Execution takes more than 15 minutes to complete

 

  1. 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.

     

  2. 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.

     

  3. smartopsTokenAvailable:

     

    Flag to check if the requestBody/Headers in jobData contains smartops offlineToken. The accepted values are: true/false

     

  4. smartopsTokenKey

     

    Field to update smartops offline-token label. Currently the smartops offline-token label is “offline-token”

     

  5. schedule:

Currently jobs can be scheduled using two methods – Cron and Interval.

Cron : Available duration keys and their default values:

  1. year=None : 4-digit year

  2. month=None : month (1-12)

  3. day=None : day of month (1-31)

  4. week=None : ISO week (1-53)

  5. day_of_week=None : number or name of weekday (0-6 or mon,tue,wed,thu,fri,sat,sun)

  6. hour=None : hour (0-23)

  7. minute=None : minute (0-59)

  8. second=None : second (0-59)

  9. start_date=None : earliest possible date/time to trigger on (inclusive)

  10. end_date=None : latest possible date/time to trigger on (inclusive) 

  11. 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: