All URIs are relative to https://YOUR_INSTANCE.wavefront.com
Method | HTTP request | Description |
---|---|---|
add_alert_access | POST /api/v2/alert/acl/add | Adds the specified ids to the given alerts' ACL |
add_alert_tag | PUT /api/v2/alert/{id}/tag/{tagValue} | Add a tag to a specific alert |
check_query_type | POST /api/v2/alert/checkQuery | Return the type of provided query. |
clone_alert | POST /api/v2/alert/{id}/clone | Clones the specified alert |
create_alert | POST /api/v2/alert | Create a specific alert |
delete_alert | DELETE /api/v2/alert/{id} | Delete a specific alert |
get_alert | GET /api/v2/alert/{id} | Get a specific alert |
get_alert_access_control_list | GET /api/v2/alert/acl | Get Access Control Lists' union for the specified alerts |
get_alert_history | GET /api/v2/alert/{id}/history | Get the version history of a specific alert |
get_alert_tags | GET /api/v2/alert/{id}/tag | Get all tags associated with a specific alert |
get_alert_version | GET /api/v2/alert/{id}/history/{version} | Get a specific historical version of a specific alert |
get_alerts_summary | GET /api/v2/alert/summary | Count alerts of various statuses for a customer |
get_alerts_with_pagination | GET /api/v2/alert/paginated | Get all alerts for a customer with pagination |
get_all_alert | GET /api/v2/alert | Get all alerts for a customer |
hide_alert | POST /api/v2/alert/{id}/uninstall | Hide a specific integration alert |
preview_alert_notification | POST /api/v2/alert/preview | Get all the notification preview for a specific alert |
remove_alert_access | POST /api/v2/alert/acl/remove | Removes the specified ids from the given alerts' ACL |
remove_alert_tag | DELETE /api/v2/alert/{id}/tag/{tagValue} | Remove a tag from a specific alert |
set_alert_acl | PUT /api/v2/alert/acl/set | Set ACL for the specified alerts |
set_alert_tags | POST /api/v2/alert/{id}/tag | Set all tags associated with a specific alert |
snooze_alert | POST /api/v2/alert/{id}/snooze | Snooze a specific alert for some number of seconds |
undelete_alert | POST /api/v2/alert/{id}/undelete | Undelete a specific alert |
unhide_alert | POST /api/v2/alert/{id}/install | Unhide a specific integration alert |
unsnooze_alert | POST /api/v2/alert/{id}/unsnooze | Unsnooze a specific alert |
update_alert | PUT /api/v2/alert/{id} | Update a specific alert |
add_alert_access(body=body)
Adds the specified ids to the given alerts' ACL
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
body = [wavefront_api_client.AccessControlListWriteDTO()] # list[AccessControlListWriteDTO] | (optional)
try:
# Adds the specified ids to the given alerts' ACL
api_instance.add_alert_access(body=body)
except ApiException as e:
print("Exception when calling AlertApi->add_alert_access: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | list[AccessControlListWriteDTO] | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerVoid add_alert_tag(id, tag_value)
Add a tag to a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
tag_value = 'tag_value_example' # str | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre>
try:
# Add a tag to a specific alert
api_response = api_instance.add_alert_tag(id, tag_value)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->add_alert_tag: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
tag_value | str | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerQueryTypeDTO check_query_type(body=body)
Return the type of provided query.
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
body = wavefront_api_client.QueryTypeDTO() # QueryTypeDTO | (optional)
try:
# Return the type of provided query.
api_response = api_instance.check_query_type(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->check_query_type: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | QueryTypeDTO | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert clone_alert(id, name=name, v=v)
Clones the specified alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
name = 'name_example' # str | (optional)
v = 789 # int | (optional)
try:
# Clones the specified alert
api_response = api_instance.clone_alert(id, name=name, v=v)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->clone_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
name | str | [optional] | |
v | int | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert create_alert(use_multi_query=use_multi_query, body=body)
Create a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
use_multi_query = false # bool | A flag indicates whether to use the new multi-query alert structures when thefeature is enabled.<br/> When the flag is true, the $.alertSources is the source of truth and will update $.condition and $.displayExpression with the corresponding expanded queries.<br/> When the flag is false, it goes through the old way and the $.condition and$.displayExpression is the source of truth and will auto-create $.alertSources (optional) (default to false)
body = wavefront_api_client.Alert() # Alert | Example Classic Body: <pre>{ \"name\": \"Alert Name\", \"target\": \"{email},pd:{pd_key},target:{alert target ID}\", \"condition\": \"ts(~sample.cpu.loadavg.1m) > 1\", \"conditionQueryType\": \"WQL\", \"displayExpression\": \"ts(~sample.cpu.loadavg.1m)\", \"displayExpressionQueryType\": \"WQL\", \"minutes\": 5, \"resolveAfterMinutes\": 2, \"severity\": \"INFO\", \"alertTriageDashboards\": [{ \"dashboardId\": \"dashboard-name\", \"parameters\": { \"constants\": { \"key\": \"value\" } }, \"description\": \"dashboard description\" } ], \"additionalInformation\": \"Additional Info\", \"tags\": { \"customerTags\": [ \"alertTag1\" ] } }</pre> Example Classic Body with multi queries: <pre>{ \"name\": \"Alert Name\", \"alertType\": \"CLASSIC\", \"target\": \"{email},pd:{pd_key},target:{alert target ID}\", \"alertSources\": [ { \"name\": \"A\", \"query\": \"${B} > 2\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"CONDITION\"] }, { \"name\": \"B\", \"query\": \"sum_over_time(~sample.network.bytes.recv[1m])\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"AUDIT\"] } ], \"severity\": \"WARN\", \"minutes\": 5 }</pre> Example Threshold Body: <pre>{ \"name\": \"Alert Name\", \"alertType\": \"THRESHOLD\", \"targets\": { \"info\": \"{email},pd:{pd_key},target:{alert target ID}\", \"warn\": \"{email},pd:{pd_key},target:{alert target ID}\" }, \"conditions\": { \"info\": \"ts(~sample.cpu.loadavg.1m) > 0\", \"warn\": \"ts(~sample.cpu.loadavg.1m) > 2\" }, \"displayExpression\": \"ts(~sample.cpu.loadavg.1m)\", \"minutes\": 5, \"additionalInformation\": \"conditions value entry needs to be of the form: displayExpression operator threshold\" }</pre> Example Threshold Body with multi queries: <pre>{ \"name\": \"Alert Name\", \"alertType\": \"THRESHOLD\", \"targets\": { \"info\": \"{email},pd:{pd_key},target:{alert target ID}\", \"warn\": \"{email},pd:{pd_key},target:{alert target ID}\" }, \"alertSources\": [ { \"name\": \"A\", \"query\": \"${B}\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"CONDITION\"] }, { \"name\": \"B\", \"query\": \"sum_over_time(~sample.network.bytes.recv[1m])\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"AUDIT\"] } ], \"conditions\": { \"info\": \"${B} > bool 0\", \"warn\": \"${B} > bool 2\" }, \"minutes\": 5 }</pre> Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> Supported Alert Target formats: <pre>Classic Alerts - \"target\": \"{email},pd:{pd_key},target:{alert target ID}\" Threshold Alerts - \"targets\": {\"info\":\"{email},pd:{pd_key},target:{alert target ID}\", \"warn\":\"{email},pd:{pd_key},target:{alert target ID}\"} Note that only target(s) can be used for creating/updating alert targets. targetEndpoints, targetInfo are for informational purpose only.</pre> (optional)
try:
# Create a specific alert
api_response = api_instance.create_alert(use_multi_query=use_multi_query, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->create_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
use_multi_query | bool | A flag indicates whether to use the new multi-query alert structures when thefeature is enabled.<br/> When the flag is true, the |
[optional] [default to false] |
body | Alert | Example Classic Body: <pre>{ "name": "Alert Name", "target": "{email},pd:{pd_key},target:{alert target ID}", "condition": "ts(~sample.cpu.loadavg.1m) > 1", "conditionQueryType": "WQL", "displayExpression": "ts(~sample.cpu.loadavg.1m)", "displayExpressionQueryType": "WQL", "minutes": 5, "resolveAfterMinutes": 2, "severity": "INFO", "alertTriageDashboards": [{ "dashboardId": "dashboard-name", "parameters": { "constants": { "key": "value" } }, "description": "dashboard description" } ], "additionalInformation": "Additional Info", "tags": { "customerTags": [ "alertTag1" ] } }</pre> Example Classic Body with multi queries: <pre>{ "name": "Alert Name", "alertType": "CLASSIC", "target": "{email},pd:{pd_key},target:{alert target ID}", "alertSources": [ { "name": "A", "query": "${B} > 2", "queryType": "PROMQL", "alertSourceType": ["CONDITION"] }, { "name": "B", "query": "sum_over_time(~sample.network.bytes.recv[1m])", "queryType": "PROMQL", "alertSourceType": ["AUDIT"] } ], "severity": "WARN", "minutes": 5 }</pre> Example Threshold Body: <pre>{ "name": "Alert Name", "alertType": "THRESHOLD", "targets": { "info": "{email},pd:{pd_key},target:{alert target ID}", "warn": "{email},pd:{pd_key},target:{alert target ID}" }, "conditions": { "info": "ts(~sample.cpu.loadavg.1m) > 0", "warn": "ts(~sample.cpu.loadavg.1m) > 2" }, "displayExpression": "ts(~sample.cpu.loadavg.1m)", "minutes": 5, "additionalInformation": "conditions value entry needs to be of the form: displayExpression operator threshold" }</pre> Example Threshold Body with multi queries: <pre>{ "name": "Alert Name", "alertType": "THRESHOLD", "targets": { "info": "{email},pd:{pd_key},target:{alert target ID}", "warn": "{email},pd:{pd_key},target:{alert target ID}" }, "alertSources": [ { "name": "A", "query": "${B}", "queryType": "PROMQL", "alertSourceType": ["CONDITION"] }, { "name": "B", "query": "sum_over_time(~sample.network.bytes.recv[1m])", "queryType": "PROMQL", "alertSourceType": ["AUDIT"] } ], "conditions": { "info": "${B} > bool 0", "warn": "${B} > bool 2" }, "minutes": 5 }</pre> Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> Supported Alert Target formats: <pre>Classic Alerts - "target": "{email},pd:{pd_key},target:{alert target ID}" Threshold Alerts - "targets": {"info":"{email},pd:{pd_key},target:{alert target ID}", "warn":"{email},pd:{pd_key},target:{alert target ID}"} Note that only target(s) can be used for creating/updating alert targets. targetEndpoints, targetInfo are for informational purpose only.</pre> | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert delete_alert(id, skip_trash=skip_trash)
Delete a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
skip_trash = false # bool | (optional) (default to false)
try:
# Delete a specific alert
api_response = api_instance.delete_alert(id, skip_trash=skip_trash)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->delete_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
skip_trash | bool | [optional] [default to false] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert get_alert(id)
Get a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
try:
# Get a specific alert
api_response = api_instance.get_alert(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerListAccessControlListReadDTO get_alert_access_control_list(id=id)
Get Access Control Lists' union for the specified alerts
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = ['id_example'] # list[str] | (optional)
try:
# Get Access Control Lists' union for the specified alerts
api_response = api_instance.get_alert_access_control_list(id=id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alert_access_control_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | list[str] | [optional] |
ResponseContainerListAccessControlListReadDTO
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerHistoryResponse get_alert_history(id, offset=offset, limit=limit)
Get the version history of a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
offset = 0 # int | (optional) (default to 0)
limit = 100 # int | (optional) (default to 100)
try:
# Get the version history of a specific alert
api_response = api_instance.get_alert_history(id, offset=offset, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alert_history: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
offset | int | [optional] [default to 0] | |
limit | int | [optional] [default to 100] |
ResponseContainerHistoryResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerTagsResponse get_alert_tags(id)
Get all tags associated with a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
try:
# Get all tags associated with a specific alert
api_response = api_instance.get_alert_tags(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alert_tags: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert get_alert_version(id, version)
Get a specific historical version of a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
version = 789 # int |
try:
# Get a specific historical version of a specific alert
api_response = api_instance.get_alert_version(id, version)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alert_version: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
version | int |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerMapStringInteger get_alerts_summary()
Count alerts of various statuses for a customer
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
try:
# Count alerts of various statuses for a customer
api_response = api_instance.get_alerts_summary()
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alerts_summary: %s\n" % e)
This endpoint does not need any parameter.
ResponseContainerMapStringInteger
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerPagedAlert get_alerts_with_pagination(cursor=cursor, limit=limit)
Get all alerts for a customer with pagination
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
cursor = 789 # int | (optional)
limit = 100 # int | (optional) (default to 100)
try:
# Get all alerts for a customer with pagination
api_response = api_instance.get_alerts_with_pagination(cursor=cursor, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_alerts_with_pagination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cursor | int | [optional] | |
limit | int | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerPagedAlert get_all_alert(offset=offset, limit=limit)
Get all alerts for a customer
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
offset = 0 # int | (optional) (default to 0)
limit = 100 # int | (optional) (default to 100)
try:
# Get all alerts for a customer
api_response = api_instance.get_all_alert(offset=offset, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->get_all_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
offset | int | [optional] [default to 0] | |
limit | int | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert hide_alert(id)
Hide a specific integration alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 789 # int |
try:
# Hide a specific integration alert
api_response = api_instance.hide_alert(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->hide_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerListNotificationMessages preview_alert_notification(body=body)
Get all the notification preview for a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
body = wavefront_api_client.Alert() # Alert | (optional)
try:
# Get all the notification preview for a specific alert
api_response = api_instance.preview_alert_notification(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->preview_alert_notification: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | Alert | [optional] |
ResponseContainerListNotificationMessages
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
remove_alert_access(body=body)
Removes the specified ids from the given alerts' ACL
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
body = [wavefront_api_client.AccessControlListWriteDTO()] # list[AccessControlListWriteDTO] | (optional)
try:
# Removes the specified ids from the given alerts' ACL
api_instance.remove_alert_access(body=body)
except ApiException as e:
print("Exception when calling AlertApi->remove_alert_access: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | list[AccessControlListWriteDTO] | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerVoid remove_alert_tag(id, tag_value)
Remove a tag from a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
tag_value = 'tag_value_example' # str | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre>
try:
# Remove a tag from a specific alert
api_response = api_instance.remove_alert_tag(id, tag_value)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->remove_alert_tag: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
tag_value | str | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
set_alert_acl(body=body)
Set ACL for the specified alerts
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
body = [wavefront_api_client.AccessControlListWriteDTO()] # list[AccessControlListWriteDTO] | (optional)
try:
# Set ACL for the specified alerts
api_instance.set_alert_acl(body=body)
except ApiException as e:
print("Exception when calling AlertApi->set_alert_acl: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | list[AccessControlListWriteDTO] | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerVoid set_alert_tags(id, body=body)
Set all tags associated with a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
body = [wavefront_api_client.list[str]()] # list[str] | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> (optional)
try:
# Set all tags associated with a specific alert
api_response = api_instance.set_alert_tags(id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->set_alert_tags: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
body | list[str] | Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert snooze_alert(id, seconds=seconds)
Snooze a specific alert for some number of seconds
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
seconds = 789 # int | (optional)
try:
# Snooze a specific alert for some number of seconds
api_response = api_instance.snooze_alert(id, seconds=seconds)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->snooze_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
seconds | int | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert undelete_alert(id)
Undelete a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 789 # int |
try:
# Undelete a specific alert
api_response = api_instance.undelete_alert(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->undelete_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert unhide_alert(id)
Unhide a specific integration alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 789 # int |
try:
# Unhide a specific integration alert
api_response = api_instance.unhide_alert(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->unhide_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert unsnooze_alert(id)
Unsnooze a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 789 # int |
try:
# Unsnooze a specific alert
api_response = api_instance.unsnooze_alert(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->unsnooze_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponseContainerAlert update_alert(id, use_multi_query=use_multi_query, body=body)
Update a specific alert
from __future__ import print_function
import time
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = wavefront_api_client.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# create an instance of the API class
api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration))
id = 'id_example' # str |
use_multi_query = false # bool | A flag indicates whether to use the new multi-query alert structures when the feature is enabled.<br/> When the flag is true, the $.alertSources is the source of truth and will update $.condition and $.displayExpression with the corresponding expanded queries.<br/> When the flag is false, it goes through the old way and the $.condition and$.displayExpression is the source of truth and will auto-update $.alertSources (optional) (default to false)
body = wavefront_api_client.Alert() # Alert | Example Classic Body: <pre>{ \"id\": \"1459375928549\", \"name\": \"Alert Name\", \"target\": \"{email},pd:{pd_key},target:{alert target ID}\", \"condition\": \"ts(~sample.cpu.loadavg.1m) > 1\", \"conditionQueryType\": \"WQL\", \"displayExpression\": \"ts(~sample.cpu.loadavg.1m)\", \"displayExpressionQueryType\": \"WQL\", \"minutes\": 5, \"resolveAfterMinutes\": 2, \"severity\": \"INFO\", \"additionalInformation\": \"Additional Info\", \"tags\": { \"customerTags\": [ \"alertTag1\" ] } }</pre> Example Classic Body with multi queries: <pre>{ \"id\": \"1459375928549\", \"name\": \"Alert Name\", \"alertType\": \"CLASSIC\", \"target\": \"{email},pd:{pd_key},target:{alert target ID}\", \"alertSources\": [ { \"name\": \"A\", \"query\": \"${B} > 2\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"CONDITION\"] }, { \"name\": \"B\", \"query\": \"sum_over_time(~sample.network.bytes.recv[1m])\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"AUDIT\"] } ], \"severity\": \"WARN\", \"minutes\": 5 }</pre> Example Threshold Body: <pre>{ \"id\": \"1459375928550\", \"name\": \"Alert Name\", \"alertType\": \"THRESHOLD\", \"targets\": { \"info\": \"{email},pd:{pd_key},target:{alert target ID}\", \"warn\": \"{email},pd:{pd_key},target:{alert target ID}\" }, \"conditions\": { \"info\": \"ts(~sample.cpu.loadavg.1m) > 0\", \"warn\": \"ts(~sample.cpu.loadavg.1m) > 5\" }, \"displayExpression\": \"ts(~sample.cpu.loadavg.1m)\", \"minutes\": 5, \"resolveAfterMinutes\": 2, \"additionalInformation\": \"conditions value entry needs to be of the form: displayExpression operator threshold\" }</pre> Example Threshold Body with multi queries: <pre>{ \"id\": \"1459375928549\", \"name\": \"Alert Name\", \"alertType\": \"THRESHOLD\", \"targets\": { \"info\": \"{email},pd:{pd_key},target:{alert target ID}\", \"warn\": \"{email},pd:{pd_key},target:{alert target ID}\" }, \"alertSources\": [ { \"name\": \"A\", \"query\": \"${B}\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"CONDITION\"] }, { \"name\": \"B\", \"query\": \"sum_over_time(~sample.network.bytes.recv[1m])\", \"queryType\": \"PROMQL\", \"alertSourceType\": [\"AUDIT\"] } ], \"conditions\": { \"info\": \"${B} > bool 0\", \"warn\": \"${B} > bool 2\" }, \"minutes\": 5 }</pre> Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> Supported Alert Target formats: <pre>Classic Alerts - \"target\": \"{email},pd:{pd_key},target:{alert target ID}\" Threshold Alerts - \"targets\": {\"info\":\"{email},pd:{pd_key},target:{alert target ID}\", \"warn\":\"{email},pd:{pd_key},target:{alert target ID}\"} Note that only target(s) can be used for creating/updating alert targets. targetEndpoints, targetInfo are for informational purpose only.</pre> (optional)
try:
# Update a specific alert
api_response = api_instance.update_alert(id, use_multi_query=use_multi_query, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->update_alert: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ||
use_multi_query | bool | A flag indicates whether to use the new multi-query alert structures when the feature is enabled.<br/> When the flag is true, the |
[optional] [default to false] |
body | Alert | Example Classic Body: <pre>{ "id": "1459375928549", "name": "Alert Name", "target": "{email},pd:{pd_key},target:{alert target ID}", "condition": "ts(~sample.cpu.loadavg.1m) > 1", "conditionQueryType": "WQL", "displayExpression": "ts(~sample.cpu.loadavg.1m)", "displayExpressionQueryType": "WQL", "minutes": 5, "resolveAfterMinutes": 2, "severity": "INFO", "additionalInformation": "Additional Info", "tags": { "customerTags": [ "alertTag1" ] } }</pre> Example Classic Body with multi queries: <pre>{ "id": "1459375928549", "name": "Alert Name", "alertType": "CLASSIC", "target": "{email},pd:{pd_key},target:{alert target ID}", "alertSources": [ { "name": "A", "query": "${B} > 2", "queryType": "PROMQL", "alertSourceType": ["CONDITION"] }, { "name": "B", "query": "sum_over_time(~sample.network.bytes.recv[1m])", "queryType": "PROMQL", "alertSourceType": ["AUDIT"] } ], "severity": "WARN", "minutes": 5 }</pre> Example Threshold Body: <pre>{ "id": "1459375928550", "name": "Alert Name", "alertType": "THRESHOLD", "targets": { "info": "{email},pd:{pd_key},target:{alert target ID}", "warn": "{email},pd:{pd_key},target:{alert target ID}" }, "conditions": { "info": "ts(~sample.cpu.loadavg.1m) > 0", "warn": "ts(~sample.cpu.loadavg.1m) > 5" }, "displayExpression": "ts(~sample.cpu.loadavg.1m)", "minutes": 5, "resolveAfterMinutes": 2, "additionalInformation": "conditions value entry needs to be of the form: displayExpression operator threshold" }</pre> Example Threshold Body with multi queries: <pre>{ "id": "1459375928549", "name": "Alert Name", "alertType": "THRESHOLD", "targets": { "info": "{email},pd:{pd_key},target:{alert target ID}", "warn": "{email},pd:{pd_key},target:{alert target ID}" }, "alertSources": [ { "name": "A", "query": "${B}", "queryType": "PROMQL", "alertSourceType": ["CONDITION"] }, { "name": "B", "query": "sum_over_time(~sample.network.bytes.recv[1m])", "queryType": "PROMQL", "alertSourceType": ["AUDIT"] } ], "conditions": { "info": "${B} > bool 0", "warn": "${B} > bool 2" }, "minutes": 5 }</pre> Supported Characters of Tags: <pre>Tag names can contain alphanumeric (a-z, A-Z, 0-9), dash (-), underscore (_), and colon (:) characters. The space character is not supported.</pre> Supported Alert Target formats: <pre>Classic Alerts - "target": "{email},pd:{pd_key},target:{alert target ID}" Threshold Alerts - "targets": {"info":"{email},pd:{pd_key},target:{alert target ID}", "warn":"{email},pd:{pd_key},target:{alert target ID}"} Note that only target(s) can be used for creating/updating alert targets. targetEndpoints, targetInfo are for informational purpose only.</pre> | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]