-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Powerpack pagination and test fixes (#1716)
* fix error during glom * Regenerate client from commit 6653b14d of spec repo --------- Co-authored-by: Kevin Zou <[email protected]> Co-authored-by: ci.datadog-api-spec <[email protected]>
- Loading branch information
1 parent
8463fa3
commit 4dab98b
Showing
30 changed files
with
300 additions
and
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
y=0, | ||
), | ||
), | ||
name="Sample Powerpack", | ||
name="Example-Powerpack", | ||
tags=[ | ||
"tag:sample", | ||
], | ||
|
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 powerpacks returns "OK" response with pagination | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.powerpack_api import PowerpackApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = PowerpackApi(api_client) | ||
items = api_instance.list_powerpacks_with_pagination( | ||
page_limit=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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
y=0, | ||
), | ||
), | ||
name="Sample Powerpack", | ||
name="Example-Powerpack", | ||
tags=[ | ||
"tag:sample", | ||
], | ||
|
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
2 changes: 1 addition & 1 deletion
2
tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.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 |
---|---|---|
@@ -1 +1 @@ | ||
2023-09-26T21:29:30.230Z | ||
2023-10-11T18:44:47.026Z |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
interactions: | ||
- request: | ||
body: '{"data":{"attributes":{"description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Sample | ||
Powerpack","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Test-Create_a_new_dashboard_with_powerpack_widget-1697049887","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
headers: | ||
accept: | ||
- application/json | ||
|
@@ -12,9 +11,9 @@ interactions: | |
uri: https://api.datadoghq.com/api/v2/powerpacks | ||
response: | ||
body: | ||
string: '{"data":{"type":"powerpack","id":"c71559ce-5cb3-11ee-9164-da7ad0900002","attributes":{"name":"Sample | ||
Powerpack","description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":8492163139927418}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
string: '{"data":{"type":"powerpack","id":"40778356-6866-11ee-812e-da7ad0900002","attributes":{"name":"Test-Create_a_new_dashboard_with_powerpack_widget-1697049887","description":"Sample | ||
powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":6750168893668334}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
' | ||
headers: | ||
|
@@ -24,8 +23,8 @@ interactions: | |
code: 200 | ||
message: OK | ||
- request: | ||
body: '{"description":"description","is_read_only":false,"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_powerpack_widget-1695763770 | ||
with powerpack widget","widgets":[{"definition":{"powerpack_id":"c71559ce-5cb3-11ee-9164-da7ad0900002","template_variables":{"controlled_by_powerpack":[{"name":"foo","prefix":"bar","values":["baz","qux","quuz"]}],"controlled_externally":[]},"type":"powerpack"},"layout":{"height":2,"is_column_break":false,"width":2,"x":1,"y":1}}]}' | ||
body: '{"description":"description","is_read_only":false,"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_powerpack_widget-1697049887 | ||
with powerpack widget","widgets":[{"definition":{"powerpack_id":"40778356-6866-11ee-812e-da7ad0900002","template_variables":{"controlled_by_powerpack":[{"name":"foo","prefix":"bar","values":["baz","qux","quuz"]}],"controlled_externally":[]},"type":"powerpack"},"layout":{"height":2,"is_column_break":false,"width":2,"x":1,"y":1}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
|
@@ -35,8 +34,8 @@ interactions: | |
uri: https://api.datadoghq.com/api/v1/dashboard | ||
response: | ||
body: | ||
string: '{"id":"qk3-bn8-9pa","title":"Test-Create_a_new_dashboard_with_powerpack_widget-1695763770 | ||
with powerpack widget","description":"description","author_handle":"[email protected]","author_name":null,"layout_type":"ordered","url":"/dashboard/qk3-bn8-9pa/test-createanewdashboardwithpowerpackwidget-1695763770-with-powerpack-widget","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"powerpack_id":"c71559ce-5cb3-11ee-9164-da7ad0900002","template_variables":{"controlled_by_powerpack":[{"name":"foo","prefix":"bar","values":["baz","qux","quuz"]}],"controlled_externally":[]},"type":"powerpack"},"layout":{"height":2,"is_column_break":false,"width":2,"x":1,"y":1},"id":5618921727592736}],"notify_list":null,"created_at":"2023-09-26T21:29:30.677263+00:00","modified_at":"2023-09-26T21:29:30.677263+00:00","restricted_roles":[]} | ||
string: '{"id":"wap-jgr-c99","title":"Test-Create_a_new_dashboard_with_powerpack_widget-1697049887 | ||
with powerpack widget","description":"description","author_handle":"[email protected]","author_name":null,"layout_type":"ordered","url":"/dashboard/wap-jgr-c99/test-createanewdashboardwithpowerpackwidget-1697049887-with-powerpack-widget","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"powerpack_id":"40778356-6866-11ee-812e-da7ad0900002","template_variables":{"controlled_by_powerpack":[{"name":"foo","prefix":"bar","values":["baz","qux","quuz"]}],"controlled_externally":[]},"type":"powerpack"},"layout":{"height":2,"is_column_break":false,"width":2,"x":1,"y":1},"id":2124665012947075}],"notify_list":null,"created_at":"2023-10-11T18:44:47.485150+00:00","modified_at":"2023-10-11T18:44:47.485150+00:00","restricted_roles":[]} | ||
' | ||
headers: | ||
|
@@ -51,10 +50,10 @@ interactions: | |
accept: | ||
- application/json | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v1/dashboard/qk3-bn8-9pa | ||
uri: https://api.datadoghq.com/api/v1/dashboard/wap-jgr-c99 | ||
response: | ||
body: | ||
string: '{"deleted_dashboard_id":"qk3-bn8-9pa"} | ||
string: '{"deleted_dashboard_id":"wap-jgr-c99"} | ||
' | ||
headers: | ||
|
@@ -69,7 +68,7 @@ interactions: | |
accept: | ||
- '*/*' | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/c71559ce-5cb3-11ee-9164-da7ad0900002 | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/40778356-6866-11ee-812e-da7ad0900002 | ||
response: | ||
body: | ||
string: '' | ||
|
2 changes: 1 addition & 1 deletion
2
tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.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 |
---|---|---|
@@ -1 +1 @@ | ||
2023-09-19T20:34:19.014Z | ||
2023-10-11T15:48:55.126Z |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
interactions: | ||
- request: | ||
body: '{"data":{"attributes":{"description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Sample | ||
Powerpack","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Test-Create_a_new_powerpack_returns_OK_response-1697039335","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
headers: | ||
accept: | ||
- application/json | ||
|
@@ -12,9 +11,9 @@ interactions: | |
uri: https://api.datadoghq.com/api/v2/powerpacks | ||
response: | ||
body: | ||
string: '{"data":{"type":"powerpack","id":"e88f5556-572b-11ee-b081-da7ad0900002","attributes":{"name":"Sample | ||
Powerpack","description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":5644443297535288}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
string: '{"data":{"type":"powerpack","id":"aef5d85a-684d-11ee-ae79-da7ad0900002","attributes":{"name":"Test-Create_a_new_powerpack_returns_OK_response-1697039335","description":"Sample | ||
powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":5789473441337322}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
' | ||
headers: | ||
|
@@ -29,7 +28,7 @@ interactions: | |
accept: | ||
- '*/*' | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/e88f5556-572b-11ee-b081-da7ad0900002 | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/aef5d85a-684d-11ee-ae79-da7ad0900002 | ||
response: | ||
body: | ||
string: '' | ||
|
2 changes: 1 addition & 1 deletion
2
tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.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 |
---|---|---|
@@ -1 +1 @@ | ||
2023-09-19T20:34:19.880Z | ||
2023-10-11T15:48:55.488Z |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
interactions: | ||
- request: | ||
body: '{"data":{"attributes":{"description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Sample | ||
Powerpack","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"}}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"name":"Test-Delete_a_powerpack_returns_OK_response-1697039335","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' | ||
headers: | ||
accept: | ||
- application/json | ||
|
@@ -12,9 +11,9 @@ interactions: | |
uri: https://api.datadoghq.com/api/v2/powerpacks | ||
response: | ||
body: | ||
string: '{"data":{"type":"powerpack","id":"e918c048-572b-11ee-8cec-da7ad0900002","attributes":{"name":"Sample | ||
Powerpack","description":"Sample powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":8519959434065727}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
string: '{"data":{"type":"powerpack","id":"af2eedc0-684d-11ee-bf6c-da7ad0900002","attributes":{"name":"Test-Delete_a_powerpack_returns_OK_response-1697039335","description":"Sample | ||
powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample | ||
Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":6052073873114005}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"[email protected]"}}]} | ||
' | ||
headers: | ||
|
@@ -29,7 +28,7 @@ interactions: | |
accept: | ||
- '*/*' | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/e918c048-572b-11ee-8cec-da7ad0900002 | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/af2eedc0-684d-11ee-bf6c-da7ad0900002 | ||
response: | ||
body: | ||
string: '' | ||
|
@@ -45,10 +44,10 @@ interactions: | |
accept: | ||
- '*/*' | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/e918c048-572b-11ee-8cec-da7ad0900002 | ||
uri: https://api.datadoghq.com/api/v2/powerpacks/af2eedc0-684d-11ee-bf6c-da7ad0900002 | ||
response: | ||
body: | ||
string: '{"errors":["Powerpack with ID e918c048-572b-11ee-8cec-da7ad0900002 | ||
string: '{"errors":["Powerpack with ID af2eedc0-684d-11ee-bf6c-da7ad0900002 | ||
not found"]}' | ||
headers: | ||
content-type: | ||
|
2 changes: 1 addition & 1 deletion
2
tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.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 |
---|---|---|
@@ -1 +1 @@ | ||
2023-09-19T20:34:21.001Z | ||
2023-10-11T15:48:56.104Z |
Oops, something went wrong.