Skip to content

Commit

Permalink
Merge pull request #103 from liketic/alert-api
Browse files Browse the repository at this point in the history
Create dashboard for creating alert
  • Loading branch information
wjo1212 committed Dec 11, 2018
2 parents 9d600ef + 83bfff7 commit 3b8afc9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/integration_test/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"description": ""
}

dashboard_for_alert = 'dashboard_' + str(time.time()).replace('.', '-')

alert_detail = {
"name": 'alert_' + str(time.time()).replace('.', '-'),
"displayName": "Alert for testing",
Expand All @@ -72,7 +74,7 @@
},
"configuration": {
"condition": "total >= 100",
"dashboard": "dashboardtest",
"dashboard": dashboard_for_alert,
"queryList": [
{
"logStore": "test-logstore",
Expand Down Expand Up @@ -143,6 +145,10 @@ def main():
res = client.delete_dashboard(project, dashboard)
res.log_print()

dashboard_detail['dashboardName'] = dashboard_for_alert
res = client.create_dashboard(project, dashboard_detail)
res.log_print()

alert = alert_detail.get('name')

res = client.create_alert(project, alert_detail)
Expand All @@ -160,6 +166,8 @@ def main():

res = client.delete_alert(project, alert)
res.log_print()
res = client.delete_dashboard(project, dashboard_for_alert)
res.log_print()

savedsearch = savedsearch_detail.get('savedsearchName')

Expand Down

0 comments on commit 3b8afc9

Please sign in to comment.