{"type":"api","title":"Get device centric view of alerts","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/280afeb1-5ea4-33e3-8618-f92d3ecedf8f","info":{"contact":{"email":"support@cisco.com","name":"Crosswork Team, Cisco"},"description":"Health Insights(HI) is a software system that provides smart KPI monitoring and remediation for service provider networks. This document contains details of the HI RESTful APIs that can be used to manage KPIs, enable/disable KPIs on groups or devices, query KPIs and device alerts, remediate alerting KPIs etc.","license":{"name":"Cisco Software License Agreement","url":"https://www.cisco.com/public/sw-license-agreement.html"},"title":"Crosswork Health Insights API","version":"7.1.0"},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/CAHI/health_insights_overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://{server_ip}:30603/crosswork/hi/v1","description":"Generated server url"}],"securitySchemes":{"bearerAuth":{"description":"token","in":"header","name":"Authorization","type":"apiKey"}}},"spec":{"description":"Response is returned as an array of DeviceAlerts. The API currently supports retrieving all alerts for specified device(s) and can be filtered by alert level(s), kpi(s) and time duration. Pagination is supported by specifying limit and offset in the POST request arguments. The api can be used to return a sorted list of devices by number of alerts in the specified duration by passing top_devices request parameter as true. If no filter parameters are passed in to the query endpoints, the API will return alerts by applying the default limit of 50 and default time interval of 1h.","operationId":"GetAlertsDevices","requestBody":{"content":{"application/json":{"schema":{"description":"Description for pulseAlertsDevReq","example":{"devices":["RouterSFO"],"kpis":[""],"levels":[""],"limit":"5","offset":"0","time_ago":"0m","time_interval":"1d","top_devices":true},"properties":{"devices":{"description":"devices","items":{"type":"string"},"title":"Optional comma separated list of devices for which alerts are being requested\nIf nothing is passed alerts for all devices are returned","type":"array"},"kpis":{"description":"kpis","items":{"type":"string"},"title":"Optional comma separated list of KPI Ids(kpi_id) to filter the alerts","type":"array"},"levels":{"description":"levels","items":{"type":"string"},"title":"Optional comma separated list of alert levels to filter the alerts\nValid values include CRITICAL,WARNING,INFO,OK","type":"array"},"limit":{"description":"limit","title":"Specifies limit on number of devices to return in a single request\ne.g if limit = 4 then the api will return alerts for 4 devices\nDefault is 50","type":"string"},"offset":{"description":"offset","title":"For pagination, specify the offset while fetching records. \ne.g.: if limit is 10, then in the first API call offset will be 0, in the 2nd call offset=10, 3rd call offset=20 etc","type":"string"},"start_time":{"description":"startTime is the timestamp returned by the api to be used in subsequent calls for pagination\nIn all subsequent calls to this api, the starttime should be sent back in the request parameters\nIn a time series DB where data is continuously being written, the startTime helps preserve the data set of a query by fixing the starttime of the data so that during pagination, data is returned from the same data set that was returned in the first API call.","type":"array"},"time_ago":{"description":"time_ago","title":"Optional start time of the Time period in terms of minutes(m) or hours(h)\ne.g if time_ago = 4 then the api wil consider alerts that came in prior to alst 4hours \nDefault is now","type":"string"},"time_interval":{"description":"time_interval","title":"Specifies the length of the time period in terms of hours or minutes\ne.g. if timeInterval = 12h, the query will aggregate all alerts for past 12 hours and so on\nDefault is 1h","type":"string"},"top_devices":{"description":"top_devices","format":"boolean","title":"Optional flag indicating if a sorted list of devices by number of alerts should be returned by the api","type":"boolean"}},"title":"AlertsDevReq defines the parameters used in POST request to get Device View of alerts for devices","type":"object","$$ref":"#/components/schemas/pulseAlertsDevReq"}}},"description":"Response is returned as an array of DeviceAlerts. The API currently supports retrieving all alerts for specified device(s) and can be filtered by alert level(s), kpi(s) and time duration. Pagination is supported by specifying limit and offset in the POST request arguments. The api can be used to return a sorted list of devices by number of alerts in the specified duration by passing top_devices request parameter as true. If no filter parameters are passed in to the query endpoints, the API will return alerts by applying the default limit of 50 and default time interval of 1h.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Description for pulseAlertsDevViewResp","example":{},"properties":{"device_alerts":{"description":"device_alerts","items":{"description":"Description for pulseDeviceAlerts","properties":{"device_IP":{"description":"device_IP","title":"device_IP is the device IP for the specified device","type":"array"},"device_id":{"description":"device_id","title":"device_id is the device for which alerts are returned","type":"array"},"device_type":{"description":"device_type","title":"device_type is the device type for the specified device","type":"array"},"impact_score":{"description":"impact_score","format":"int64","title":"impact_score is the impact score value of the specified device\nCurrent implementation of impact_score derivation logic is as below:\nImpact Score = 4 * (# of critical alerts) + 3 * (# of major alerts) + 2 * (# of warning alerts) + 1 * (# of info alerts)","type":"array"},"summary":{"description":"summary","type":"array","properties":{"levels":{"description":"levels","items":{"description":"Description for pulseAlertView","properties":{"alert":{"description":"alert","format":"int64","title":"Count of alerts","type":"array"},"level":{"description":"level","title":"Valid alert level e.g. CRITICAL,WARNING,INFO,OK","type":"array"}},"type":"object","$$ref":"#/components/schemas/pulseAlertView"},"type":"array"}},"$$ref":"#/components/schemas/pulseAlertSummaryGroup"},"total_alerts":{"description":"total_alerts","format":"int64","title":"total_alerts is the total number of alerts for the specified device","type":"array"}},"type":"object","$$ref":"#/components/schemas/pulseDeviceAlerts"},"title":"device_alerts contains a device specific view of alerts filtered by various parameters passed to the api\nit is populated when a device view of alerts is requested for device(s) or device tag(s)","type":"array"},"start_time":{"description":"startTime is the timestamp returned by the api to be used in subsequent calls for pagination\nIn all subsequent calls to this api, the starttime should be sent back in the request parameters\nIn a time series DB where data is continuously being written, the startTime helps preserve the data set of a query by fixing the starttime of the data so that during pagination, data is returned from the same data set that was returned in the first API call.","format":"int64","type":"array"}},"type":"object","$$ref":"#/components/schemas/pulseAlertsDevViewResp"}}},"description":"A successful response."},"400":{"content":{},"description":"Bad Request"}},"summary":"Get device centric view of alerts","tags":["Alerts"],"x-codegen-request-body-name":"body","__originalOperationId":"GetAlertsDevices","security":[{"bearerAuth":[]}],"method":"post","path":"/alerts/device/devices"}}