- Created by Meytal Ben-Tzvi on Mar 22, 2022
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
Version 1 Next »
Available alert actions via APIs
Get / Create / Update / Execute / Delete alerts
Authorization:
Authentication: Basic authentication
Roles: it is recommended to read Role Based Access Control page for understanding build-in and custom roles permissions.
From CLI (example):
curl -u username:password https://<dpod hostname>/op/api/v2/alerts/{{productView}}
GET Retrieve All Alerts
URL:
GET - https://{{dpodHostname}}
/op/api/v2/alerts/{{productView}}
Request - None.
URL Parameters:
Name | Is required | Description | Parameter Type | Data options |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alerts retrieved successfully, "result": { "alerts": [{ "isSystemHealthMetric": false, "isActive": false, "name": "API Error Message Count Alert", "description": "Alert when more than 10 API trans. ended with a specific error message", "productView": "APIC", "indexSets": "apic-log", "documentType": "APIC_LOGICAL_TRANS", "jsonQuery": "{\"_source\":{\"includes\":[\"apiName\",\"errorMessage\"]},... }", "jsonParameters": "{\"messageTextSubstring\":\"Failed to establish a backside connection\"}", "schedule": "", "recipients": [], "filtersParameters": { "timeRangeType": "recent",.....}, "lastUpdateTimeInMillis": 1646655197926, "lastUpdateUserName": "admin", "isPublishToMail": false, "isPublishToSyslog": false, "isPublishToMailWs": false, "errorThreshold": 10.0, "alertType": "Frequency", "comparator": "GreaterThan", "apiReference": "EDBD6F2B-A576-4619-AC63-2594A10F7EC6", "drillDownDashboardToken": "apicTransactions:" }, {....} ] } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alerts retrieved successfully"
|
GET Get Specific Alert Details
URL:
GET - https://{{dpodHostname}}
/op/api/v2/alert/{{productView}}
/{{alertApiReferenceId}}
Request - None.
URL Parameters:
Name | Is required | Description | Parameter Type | Data options |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
alertApiReferenceId | True | The alert apiReferenceId (can be retrieved from “Retrieved all alerts” response) | String |
|
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert retrieved successfully", "result": { "isSystemHealthMetric": <true/false>, "isActive": <true/false>, "name": "<alert name>", "description": "<alert description>", "productView": "<alert product view>", "indexSets": "<alert indexSet>", "documentType": "<alert documentType>", "jsonQuery": "{\"_source\":{\"includes\":[\"apiName\",... }", "jsonParameters": "<json parameters>", "schedule": "", "recipients": [], "filtersParameters": { "timeRangeType": "recent",.....}, "lastUpdateTimeInMillis": 1644768927839, "lastUpdateUserName": "Installer", "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": 10.0, "alertType": "<alert type>", "comparator": "<comparator>", "apiReference": "<alert uuid>", "drillDownDashboardToken": "<...>" } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert retrieved successfully” |
POST Execute (Async) Alert
URL:
POST - https://{{dpodHostname}}
/op/api/v2/alert/{{productView}}
/{{alertApiReferenceId}}
/executeAsync
URL Parameters:
Name | Is required | Description | Parameter Type | Data options |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
alertApiReferenceId | True | The alert apiReferenceId you wish to execute ( id can be retrieved from “Retrieved all alerts” response) | String |
|
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Request body:
Type | Parameters | Example Json | Description |
---|---|---|---|
Required |
| { "recipients" :[], "filtersParameters" : {} } |
|
Additional parameter | Available filters: | { "recipients" :[“address1@mail.com“...], "filtersParameters" : { "deviceNameOp":"eq", "deviceName":"<device name>", "timeRangeType":"recent", "timeRangePeriod":"600000" } } |
|
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert executed successfully", "result": { "executionId": <ID> } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert executed successfully” result → executionId → The alert execution id (integer). |
GET Get Alert Execution Details
URL:
GET - https://{{dpodHostname}}
/op/api/v2/alertexecution/{{productView}}
/{{executionId}}
Request - None.
URL Parameters:
Name | Is required | Description | Parameter Type | Data options |
---|---|---|---|---|
productView | True | Relevant product view APIC / IDG | String |
|
executionId | True | The alert execution ID (can be retrieved from “execute alert” api response) | String | The alert Id |
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert retrieved successfully", "result": { "executionId": <ID>, "recipients": "", "filters": "...", "executingUserName": "<user name>", "status": "OK", "requestTimeInMillis": 1646827094043, "executionTimeInMillis": 1646827094948, "completionTimeInMillis": 1646827101507 "message": "Execution finished with no alerts." } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert retrieved successfully” result →
|
Failure | { "resultCode": "ERROR", "resultErrorCode": "ALERT_NOT_FOUND", "resultMessage": "Alert execution not found" }
| Status code: 200 resultCode → ERROR resultErrorCode → ALERT_NOT_FOUND resultMessage → “Alert execution not found” |
GET Download Alert Execution
URL:
GET - https://{{dpodHostname}}
/op/api/v2/alertexecution/{{productView}}
/{{executionId}}
/download
Request - None.
URL Parameters:
Name | Is required | Description | Parameter Type | Data options |
---|---|---|---|---|
productView | True | Relevant product view APIC / IDG | String |
|
executionId | True | The alert execution ID (can be retrieved from “execute alert” api response) | String | The alert Id |
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Value | Description |
---|---|---|
Successful | xls file type | Status code: 200 |
POST Duplicate Alert
URL:
POST - https://{{dpodHostname}}
/op/api/v2/alert/{{productView}}
/{{alertApiReferenceId}}
/duplicate
Request - None.
URL Parameters:
Name | Is Required | Description | Parameter Type | Data Type |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
alertApiReferenceId | True | The alert apiReferenceId you wish to duplicate ( id can be retrieved from “Retrieved all alerts” response) | String | ‘apiReferenceId’ value from the original alert |
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert duplicated successfully", "result": { "isSystemHealthMetric": <true/false>, "isActive": <true/false>, "name": "<source alert name> Copy", "description": "<source alert description>", "productView": "<source alert productView>", "indexSets": "<source alert indexSet>", "documentType": "<source alert documentType>", "jsonQuery": "<source alert query>", "jsonParameters": "<source alert json parameters>", "schedule": "", "recipients": [], "filtersParameters": { "timeRangeType": "recent",.....}, "lastUpdateTimeInMillis": 1646826210928, "lastUpdateUserName": "<current userName>", "apiReference": "<New unique alert uuid>", "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": 10.0, "alertType": "<alert type>", "comparator": "<comparator>", "drillDownDashboardToken": "..." } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert duplicated successfully” |
POST Add Alert
URL:
POST - https://{{dpodHostname}}
/op/api/v2/alerts/{{productView}}
URL Parameters:
Name | Is required | Description | Parameter Type | Data Type |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Request body:
Type | Parameters | Example Json | Description |
---|---|---|---|
Required |
| { "isSystemHealthMetric": <true/false>, "isActive": <true/false>, "name": "<new alert name>", "description": "<new alert description>", "productView": "<new alert productView type>", "indexSets": "<new alert indexSet>", "documentType": "<new alert documentType>", "jsonQuery": "<new alert query>", "jsonParameters": "<new alert json parameters>" "schedule": "", "recipients": [], "filtersParameters": {...}, "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": <new alert error threshold>, "alertType": "<new alert type>", "comparator": "<new alert comparator>", "drillDownDashboardToken": "..." } |
|
Additional parameter | Available | { .... "filtersParameters": { "timeRangeType": "recent", "timeRangePeriod": "86400000" }, .... }
|
|
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert added successfully", "result": { "isSystemHealthMetric": <true/false>, "isActive": <true/false>, "name": "<new alert name>", "description": "<new alert description>", "productView": "<new alert productView type>", "indexSets": "<new alert indexSet>", "documentType": "<new alert documentType>", "jsonQuery": "<new alert query>", "jsonParameters": "<new alert json parameters>" "schedule": "", "recipients": [], "filtersParameters": { "timeRangeType": "recent",.....}, "lastUpdateTimeInMillis": 1646826210928, "lastUpdateUserName": "<current userName>", "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": <new alert error threshold>, "alertType": "<new alert type>", "comparator": "<new alert comparator>", "apiReference": "New alert unique uuid", "drillDownDashboardToken": "..." } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert added successfully” |
PUT Edit Alert
URL:
PUT - https://{{dpodHostname}}
/op/api/v2/alert/{{productView}}
/{{alertApiReferenceId}}
URL Parameters:
Name | Is required | Description | Parameter Type | Data Type |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
alertApiReferenceId | True | The alert apiReferenceId you wish to edit ( id can be retrieved from “Retrieved all alerts” response) | String | ‘apiReferenceId’ of the alert you want to edit |
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Request:
Type | Parameters | Example Json | Description |
---|---|---|---|
Required |
| { "isSystemHealthMetric": <true/false>, "isActive": <true/false>, "name": "<alert edited/source name>", "description": "<alert edited/source description>", "productView": "<alert edited/source productView>", "indexSets": "<alert edited/source indexSet>", "documentType": "<alert edited/source documentType>", "jsonQuery": "<alert edited/source query>", "jsonParameters": "<alert edited/source json parameters>" "schedule": "", "recipients": [], "filtersParameters": {...}, "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": <alert edited/source error threshold>, "alertType": "<alert edite/source type>", "comparator": "<alert edited/source comparator>", "drillDownDashboardToken": "..." } |
|
Additional parameter | Available | { .... "filtersParameters": { "timeRangeType": "recent", "timeRangePeriod": "86400000" }, .... }
|
|
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert updated successfully", "result": { "name": "<alert edited/source name>", "description": "<alert edited/source description>", "productView": "<alert edited/source productView>", "indexSets": "<alert edited/source indexSet>", "documentType": "<alert edited/source documentType>", "jsonQuery": "<alert edited/source query>", "jsonParameters": "<alert edited/source json parameters>" "schedule": "", "recipients": [], "filtersParameters": { "timeRangeType": "recent",.....}, "lastUpdateTimeInMillis": 1646826210928, "lastUpdateUserName": "<current userName>", "isPublishToMail": <true/false>, "isPublishToSyslog": <true/false>, "isPublishToMailWs": <true/false>, "errorThreshold": <alert edited/source error threshold>, "alertType": "<alert edite/source type>", "comparator": "<alert edited/source comparator>", "apiReference": "<alert uuid>", "drillDownDashboardToken": "..." } } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert updated successfully” |
DELETE Delete Alert
URL:
DELETE - https://{{dpodHostname}}
/op/api/v2/alert/{{productView}}
/{{alertApiReferenceId}}
Request - None.
URL Parameters:
Name | Is required | Description | Parameter Type | Data Type |
---|---|---|---|---|
productView | True | Product view APIC / IDG | String |
|
alertApiReferenceId | True | The alert apiReferenceId you wish to delete ( id can be retrieved from “Retrieved all alerts” response) | String | ‘apiReferenceId’ of the alert to delete |
Authorization:
Required Permissions | More info |
---|---|
| See roles information here: Role Based Access Control |
Response:
Response Type | Example value | Description |
---|---|---|
Successful | { "resultCode": "SUCCESS", "resultMessage": "Alert deleted successfully" } | Status code: 200 resultCode → SUCCESS resultMessage → “Alert deleted successfully” |
- No labels