-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pagination extension to monitors (#1633)
* Support page param * Regenerate client from commit fee86b40 of spec repo --------- Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
f9bda90
commit 0a40161
Showing
13 changed files
with
208 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Get all monitor details returns "OK" response with pagination | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v1.api.monitors_api import MonitorsApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = MonitorsApi(api_client) | ||
items = api_instance.list_monitors_with_pagination( | ||
page_size=2, | ||
) | ||
for item in items: | ||
print(item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...es/test_scenarios/test_get_all_monitor_details_returns_ok_response_with_pagination.frozen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-08-28T07:51:42.436Z |
50 changes: 50 additions & 0 deletions
50
...ttes/test_scenarios/test_get_all_monitor_details_returns_ok_response_with_pagination.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
accept: | ||
- application/json | ||
method: GET | ||
uri: https://api.datadoghq.com/api/v1/monitor?page_size=2&page=0 | ||
response: | ||
body: | ||
string: '[{"id":34822915,"org_id":321813,"type":"query alert","name":"SLO Monitor: | ||
aws_alb_latency_p95 for splunk","message":"Latency SLO violation for splunk | ||
load balancer(s)","tags":["environment:test","generator:slops","release:e6a2686","sli:latency","slotype:alb","systemid:splunk","team:developer_insights"],"query":"avg(last_1m):avg:aws.applicationelb.target_response_time.p95{systemid:splunk,aws_account_type:production} | ||
by {region} > 0.2","options":{"notify_audit":false,"locked":false,"include_tags":true,"thresholds":{"critical":0.2},"new_host_delay":300,"require_full_window":true,"notify_no_data":false,"silenced":{}},"multi":true,"created_at":1620047024000,"created":"2021-05-03T13:03:44.905085+00:00","modified":"2021-05-03T13:03:44.905085+00:00","deleted":null,"restricted_roles":null,"priority":null,"overall_state_modified":"2021-05-03T13:06:23+00:00","overall_state":"No | ||
Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416},"matching_downtimes":[]},{"id":34822916,"org_id":321813,"type":"query | ||
alert","name":"SLO Monitor: aws_classic_elb_latency_p99 for splunk","message":"Latency | ||
SLO violation for splunk load balancer(s)","tags":["environment:test","generator:slops","release:e6a2686","sli:latency","slotype:elb","systemid:splunk","team:developer_insights"],"query":"avg(last_1m):avg:aws.elb.latency.p99{systemid:splunk,aws_account_type:production} | ||
by {region} > 0.2","options":{"notify_audit":false,"locked":false,"include_tags":true,"thresholds":{"critical":0.2},"new_host_delay":300,"require_full_window":true,"notify_no_data":false,"silenced":{}},"multi":true,"created_at":1620047024000,"created":"2021-05-03T13:03:44.909928+00:00","modified":"2021-05-03T13:03:44.909928+00:00","deleted":null,"restricted_roles":null,"priority":null,"overall_state_modified":"2021-05-03T13:06:18+00:00","overall_state":"No | ||
Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416},"matching_downtimes":[]}] | ||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
accept: | ||
- application/json | ||
method: GET | ||
uri: https://api.datadoghq.com/api/v1/monitor?page_size=2&page=1 | ||
response: | ||
body: | ||
string: '[{"id":34822917,"org_id":321813,"type":"query alert","name":"SLO Monitor: | ||
aws_alb_latency_p50 for splunk","message":"Latency SLO violation for splunk | ||
load balancer(s)","tags":["environment:test","generator:slops","release:e6a2686","sli:latency","slotype:alb","systemid:splunk","team:developer_insights"],"query":"avg(last_1m):avg:aws.applicationelb.target_response_time.p50{systemid:splunk,aws_account_type:production} | ||
by {region} > 0.2","options":{"notify_audit":false,"locked":false,"include_tags":true,"thresholds":{"critical":0.2},"new_host_delay":300,"require_full_window":true,"notify_no_data":false,"silenced":{}},"multi":true,"created_at":1620047024000,"created":"2021-05-03T13:03:44.920644+00:00","modified":"2021-05-03T13:03:44.920644+00:00","deleted":null,"restricted_roles":null,"priority":null,"overall_state_modified":"2021-05-03T13:06:37+00:00","overall_state":"No | ||
Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416},"matching_downtimes":[]}] | ||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters