...
Available
...
alert actions via APIs
Get / Create / Update / Execute / Delete reportsalerts
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):
Code Block |
---|
curl -u username:password https://<dpod hostname>/op/api/v2/reportsalerts/{{productView}} |
...
Retrieve All Alerts
Expand |
---|
title | /op/api/v2/alerts/{{productView}} |
---|
|
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 |
---|
View or Edit alert Access permissions for required product
| See roles information here: Role Based Access Control |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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" |
|
...
Expand |
---|
title | /op/api/v2/alert/{{productView}}/{{reportApiReferenceIdalertApiReferenceId}} |
---|
|
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 |
---|
View or Edit alert Access permissions for required product related to the alert
| See roles information here: Role Based Access Control |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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” |
|
...
Expand |
---|
title | /op/api/v2/alert/{{productView}}/{{alertApiReferenceId}}/executeAsync |
---|
|
URL:POST - https://{{dpodHostname}} /op/api/v2/alert/{{productView}} /{{alertApiReferenceId}} /executeAsyncURL 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 |
---|
View or Edit alert Access permissions for required product related to the alert
| See roles information here: Role Based Access Control |
Request body:Type | Parameters | Example Json | Description |
---|
Required | List<String> recipients Map<String, String>filtersParameters
| Code Block |
---|
| {
"recipients" :[],
"filtersParameters" : {}
} |
| recipients → Recipients' email address. Array can be sent empty.
filtersParameters → List of filters. List can be sent empty.
| Additional parameter | Available filters: | Code Block |
---|
| {
"recipients" :[“address1@mail.com“...],
"filtersParameters" : {
"deviceNameOp":"eq",
"deviceName":"<device name>",
"timeRangeType":"recent",
"timeRangePeriod":"600000"
}
} |
| deviceNameOp →
“eq” for equal “ne” for unequitable
filtersParameters → List of filters. List can be sent empty.
|
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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). |
|
...
Expand |
---|
title | /op/api/v2/alertexecution/{{productView}}/{{executionId}} |
---|
|
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 |
---|
View or Edit alert Access permissions for required product related to the alert
| See roles information here: Role Based Access Control |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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 → executionId → The alert execution ID
recipients → Recipients' email address. Array can be sent empty.
filters → List of filters. List can be sent empty.
executingUserName → The user who executed this alert execution
status → Alert execution status
requestTimeInMillis → Request time in Millis
executionTimeInMillis → Execution time in Millis
completionTimeInMillis → Completion time in Millis
message →
| Failure | Code Block |
---|
| {
"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” |
|
...
Expand |
---|
title | /op/api/v2/alertexecution/{{productView}}/{{executionId}}/download |
---|
|
URL:GET - https://{{dpodHostname}} /op/api/v2/alertexecution/{{productView}} /{{executionId}} /downloadRequest - 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 |
---|
View or Edit alert Access permissions for required product related to the alert
| See roles information here: Role Based Access Control |
Response:Response Type | Value | Description |
---|
Successful | xls file type | Status code: 200 |
|
Duplicate Alert
Expand |
---|
title | /op/api/v2/alert/{{productView}}/{{alertApiReferenceId}}/duplicate |
---|
|
URL:POST - https://{{dpodHostname}} /op/api/v2/alert/{{productView}} /{{alertApiReferenceId}} /duplicateRequest - 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 |
---|
Edit alert Access permissions for required product related to the alertyou wish to duplicate
| See roles information here: Role Based Access Control |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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” |
|
...
Expand |
---|
title | /op/api/v2/alerts/{{productView}} |
---|
|
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 |
---|
Edit alert Access permissions for product view of new alert
| See roles information here: Role Based Access Control |
Request body:Type | Parameters | Example Json | Description |
---|
Required | boolean isSystemHealthMetric boolean isActive String name String description String productView String indexSets String documentType String jsonQuery String jsonParameters String schedule List<String>recipients Map<String, String>filtersParameters boolean isPublishToMail boolean isPublishToSyslog boolean isPublishToMailWs double errorThreshold String alertType String comparator String drillDownDashboardToken
| Code Block |
---|
| {
"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": "..."
} |
| recipients → recipients' email address. Array can be sent empty.
filtersParameters → list of filters. List can be sent empty.
| Additional parameter | Available filtersParameters : | Code Block |
---|
| {
....
"filtersParameters": {
"timeRangeType": "recent",
"timeRangePeriod": "86400000"
},
....
} |
| |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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” |
|
...
Expand |
---|
title | /op/api/v2/alert/{{productView}}/{{alertApiReferenceId}} |
---|
|
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 |
---|
Edit alert Access permissions for product view of the alert
| See roles information here: Role Based Access Control |
Request:Type | Parameters | Example Json | Description |
---|
Required | boolean isSystemHealthMetric boolean isActive String name String description String productView String indexSets String documentType String jsonQuery String jsonParameters String schedule List<String>recipients Map<String, String>filtersParameters boolean isPublishToMail boolean isPublishToSyslog boolean isPublishToMailWs double errorThreshold String alertType String comparator String drillDownDashboardToken
| Code Block |
---|
| {
"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": "..."
} |
| recipients → recipients' email address. Array can be sent empty.
filtersParameters → list of filters. List can be sent empty.
| Additional parameter | Available filtersParameters : | Code Block |
---|
| {
....
"filtersParameters": {
"timeRangeType": "recent",
"timeRangePeriod": "86400000"
},
....
} |
| |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"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” |
|
...
Expand |
---|
title | /op/api/v2/alert/{{productView}}/{{alertApiReferenceId}} |
---|
|
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 |
---|
Edit alert Access permissions for required product related to the alert you wish to delete
| See roles information here: Role Based Access Control |
Response:Response Type | Example value | Description |
---|
Successful | Code Block |
---|
| {
"resultCode": "SUCCESS",
"resultMessage": "Alert deleted successfully"
} |
| Status code: 200 resultCode → SUCCESS resultMessage → “Alert deleted successfully” |
|
...