diff --git a/.apigentools-info b/.apigentools-info index 011702c985..9df784e6a1 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-10 13:47:33.127844", - "spec_repo_commit": "afb48804" + "regenerated": "2023-10-12 13:31:17.639000", + "spec_repo_commit": "6653b14d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-10 13:47:33.153228", - "spec_repo_commit": "afb48804" + "regenerated": "2023-10-12 13:31:17.656414", + "spec_repo_commit": "6653b14d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2975fa2f44..3abf3ccc40 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23874,6 +23874,18 @@ paths: get: description: Get a list of all powerpacks. operationId: ListPowerpacks + parameters: + - description: Maximum number of powerpacks in the response. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 1000 + type: integer + - $ref: '#/components/parameters/PageOffset' responses: '200': content: @@ -23891,6 +23903,10 @@ paths: summary: Get all powerpacks tags: - Powerpack + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data post: description: Create a powerpack. operationId: CreatePowerpack diff --git a/examples/v2/powerpack/CreatePowerpack.py b/examples/v2/powerpack/CreatePowerpack.py index 925179aad6..47afe5ac4c 100644 --- a/examples/v2/powerpack/CreatePowerpack.py +++ b/examples/v2/powerpack/CreatePowerpack.py @@ -36,7 +36,7 @@ y=0, ), ), - name="Sample Powerpack", + name="Example-Powerpack", tags=[ "tag:sample", ], diff --git a/examples/v2/powerpack/ListPowerpacks.py b/examples/v2/powerpack/ListPowerpacks.py index bfd88e084e..1bc04beb52 100644 --- a/examples/v2/powerpack/ListPowerpacks.py +++ b/examples/v2/powerpack/ListPowerpacks.py @@ -8,6 +8,8 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = PowerpackApi(api_client) - response = api_instance.list_powerpacks() + response = api_instance.list_powerpacks( + page_limit=1000, + ) print(response) diff --git a/examples/v2/powerpack/ListPowerpacks_1173755071.py b/examples/v2/powerpack/ListPowerpacks_1173755071.py new file mode 100644 index 0000000000..5f0224bcd7 --- /dev/null +++ b/examples/v2/powerpack/ListPowerpacks_1173755071.py @@ -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) diff --git a/examples/v2/powerpack/UpdatePowerpack.py b/examples/v2/powerpack/UpdatePowerpack.py index eed2fca27f..f0eee43d57 100644 --- a/examples/v2/powerpack/UpdatePowerpack.py +++ b/examples/v2/powerpack/UpdatePowerpack.py @@ -40,7 +40,7 @@ y=0, ), ), - name="Sample Powerpack", + name="Example-Powerpack", tags=[ "tag:sample", ], diff --git a/src/datadog_api_client/v2/api/powerpack_api.py b/src/datadog_api_client/v2/api/powerpack_api.py index ec4d764227..1335d71681 100644 --- a/src/datadog_api_client/v2/api/powerpack_api.py +++ b/src/datadog_api_client/v2/api/powerpack_api.py @@ -3,11 +3,19 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +import collections +from typing import Any, Dict, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) from datadog_api_client.v2.model.list_powerpacks_response import ListPowerpacksResponse +from datadog_api_client.v2.model.powerpack_data import PowerpackData from datadog_api_client.v2.model.powerpack_response import PowerpackResponse from datadog_api_client.v2.model.powerpack import Powerpack @@ -105,7 +113,21 @@ def __init__(self, api_client=None): "http_method": "GET", "version": "v2", }, - params_map={}, + params_map={ + "page_limit": { + "validation": { + "inclusive_maximum": 1000, + }, + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + }, headers_map={ "accept": ["application/json"], }, @@ -191,16 +213,66 @@ def get_powerpack( def list_powerpacks( self, + *, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, ) -> ListPowerpacksResponse: """Get all powerpacks. Get a list of all powerpacks. + :param page_limit: Maximum number of powerpacks in the response. + :type page_limit: int, optional + :param page_offset: Specific offset to use as the beginning of the returned page. + :type page_offset: int, optional :rtype: ListPowerpacksResponse """ kwargs: Dict[str, Any] = {} + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + return self._list_powerpacks_endpoint.call_with_http_info(**kwargs) + def list_powerpacks_with_pagination( + self, + *, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + ) -> collections.abc.Iterable[PowerpackData]: + """Get all powerpacks. + + Provide a paginated version of :meth:`list_powerpacks`, returning all items. + + :param page_limit: Maximum number of powerpacks in the response. + :type page_limit: int, optional + :param page_offset: Specific offset to use as the beginning of the returned page. + :type page_offset: int, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[PowerpackData] + """ + kwargs: Dict[str, Any] = {} + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + local_page_size = get_attribute_from_path(kwargs, "page_limit", 25) + endpoint = self._list_powerpacks_endpoint + set_attribute_from_path(kwargs, "page_limit", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_offset_param": "page_offset", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + def update_powerpack( self, powerpack_id: str, diff --git a/tests/conftest.py b/tests/conftest.py index 64320a7e91..62e3e8e99c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -668,12 +668,17 @@ def expect_response_has_field(context, response_path, field): @then(parsers.parse('the response "{response_path}" has item with field "{key_path}" with value {value}')) def expect_array_contains_object(context, response_path, key_path, value): + from glom.core import PathAccessError + response_value = glom(context["api_request"]["response"][0], response_path) test_value = json.loads(Template(value).render(**context)) for response_item in response_value: - response_item_value = glom(response_item, key_path) - if response_item_value == test_value: - return + try: + response_item_value = glom(response_item, key_path) + if response_item_value == test_value: + return + except PathAccessError: + pass raise AssertionError(f'could not find key value pair in object array: "{key_path}": "{test_value}"') diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.frozen index e9f7b08fe2..1ad16723a0 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.frozen @@ -1 +1 @@ -2023-09-26T21:29:30.230Z \ No newline at end of file +2023-10-11T18:44:47.026Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.yaml index 20ef91f826..781a68370b 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_powerpack_widget.yaml @@ -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":"frog@datadoghq.com"}}]} + 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":"frog@datadoghq.com"}}]} ' 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":"frog@datadoghq.com","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":"frog@datadoghq.com","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: '' diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.frozen index 9d1f068553..d85ca8f961 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:19.014Z \ No newline at end of file +2023-10-11T15:48:55.126Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.yaml index 6514616877..bba3bd3539 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_powerpack_returns_ok_response.yaml @@ -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":"frog@datadoghq.com"}}]} + 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":"frog@datadoghq.com"}}]} ' 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: '' diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.frozen index 3f04c2c6ff..aaa1fbb613 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:19.880Z \ No newline at end of file +2023-10-11T15:48:55.488Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.yaml index ae95018cb4..73051d2d43 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_powerpack_returns_ok_response.yaml @@ -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":"frog@datadoghq.com"}}]} + 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":"frog@datadoghq.com"}}]} ' 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: diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.frozen index 77218be98e..6e95c35744 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:21.001Z \ No newline at end of file +2023-10-11T15:48:56.104Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.yaml index af07955bf5..e871888db2 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_ok_response.yaml @@ -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-Get_a_Powerpack_returns_OK_response-1697039336","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":"e9c3a68e-572b-11ee-9921-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":6180231820143192}]},"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":"frog@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"af8c8bc4-684d-11ee-ab74-da7ad0900002","attributes":{"name":"Test-Get_a_Powerpack_returns_OK_response-1697039336","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":4673428095397965}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -29,12 +28,12 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/powerpacks/e9c3a68e-572b-11ee-9921-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/af8c8bc4-684d-11ee-ab74-da7ad0900002 response: body: - string: '{"data":{"type":"powerpack","id":"e9c3a68e-572b-11ee-9921-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":6180231820143192}]},"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":"frog@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"af8c8bc4-684d-11ee-ab74-da7ad0900002","attributes":{"name":"Test-Get_a_Powerpack_returns_OK_response-1697039336","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":4673428095397965}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -49,7 +48,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/powerpacks/e9c3a68e-572b-11ee-9921-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/af8c8bc4-684d-11ee-ab74-da7ad0900002 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_powerpack_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_powerpack_not_found_response.frozen index 0148996058..f51c198ff7 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_powerpack_not_found_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_a_powerpack_returns_powerpack_not_found_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:21.843Z \ No newline at end of file +2023-10-11T15:48:56.601Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.frozen index f1d89bcd5f..6367af5c7b 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:22.163Z \ No newline at end of file +2023-10-11T15:48:56.720Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.yaml index fb009a2e6d..29aaf2bd50 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response.yaml @@ -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-Get_all_powerpacks_returns_OK_response-1697039336","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":"ea79a97a-572b-11ee-95d1-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":4425546308848838}]},"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":"frog@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"afe8ae9a-684d-11ee-acaa-da7ad0900002","attributes":{"name":"Test-Get_all_powerpacks_returns_OK_response-1697039336","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":2076464251986187}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -29,48 +28,18 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/powerpacks + uri: https://api.datadoghq.com/api/v2/powerpacks?page%5Blimit%5D=1000 response: body: - string: '{"data":[{"type":"powerpack","id":"ea79a97a-572b-11ee-95d1-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":4425546308848838}]},"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"}}}},{"type":"powerpack","id":"df854830-5721-11ee-a5cb-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":7074599446492254}]},"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"}}}},{"type":"powerpack","id":"c682402c-5721-11ee-9e3a-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":6284179343997328}]},"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"}}}},{"type":"powerpack","id":"9845ef02-5270-11ee-b156-da7ad0900002","attributes":{"name":"Sample - Powerpack","description":"Please don''t delete - used in public api spec tests.","group_widget":{"layout":{"x":0,"y":0,"width":12,"height":3},"definition":{"title":"Sample - Powerpack","type":"group","layout_type":"ordered","widgets":[{"layout":{"x":0,"y":0,"width":2,"height":2},"definition":{"type":"note","content":"Test","background_color":"white","font_size":"56","text_align":"center","vertical_align":"top","show_tick":false,"tick_pos":"50%","tick_edge":"left","has_padding":true},"id":5480978922393146},{"layout":{"x":2,"y":0,"width":4,"height":2},"definition":{"type":"note","content":"Powerpacks","background_color":"white","font_size":"56","text_align":"center","vertical_align":"top","show_tick":false,"tick_pos":"50%","tick_edge":"left","has_padding":true},"id":8930506491864045}]}},"template_variables":[],"tags":["tag:display"]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},{"type":"powerpack","id":"88575170-5721-11ee-ad58-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":808919002773200}]},"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"}}}},{"type":"powerpack","id":"87dcc80c-5720-11ee-a801-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":8191251878590002}]},"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"}}}},{"type":"powerpack","id":"80d9e6ee-571f-11ee-8b1f-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":8862041995898907}]},"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"}}}},{"type":"powerpack","id":"762dbf4a-571f-11ee-8317-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":687973434806520}]},"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"}}}},{"type":"powerpack","id":"760fce72-571f-11ee-9833-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":4098068431422804}]},"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"}}}},{"type":"powerpack","id":"75f58440-571f-11ee-b1ee-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":1606539530126708}]},"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"}}}},{"type":"powerpack","id":"75024140-571f-11ee-b658-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":8753429084871035}]},"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"}}}},{"type":"powerpack","id":"74cbe5be-571f-11ee-b7f3-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":6566925545234730}]},"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"}}}},{"type":"powerpack","id":"74929fb6-571f-11ee-8b1e-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":432765966992707}]},"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"}}}},{"type":"powerpack","id":"7100a1b8-571f-11ee-8970-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":2190124205654107}]},"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"}}}},{"type":"powerpack","id":"70db12f4-571f-11ee-964e-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":7599696962501486}]},"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"}}}},{"type":"powerpack","id":"70b76822-571f-11ee-ad4d-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":2781058132030543}]},"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"}}}},{"type":"powerpack","id":"7057cd54-571f-11ee-8cb3-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":6920126044100885}]},"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"}}}},{"type":"powerpack","id":"700537b0-571f-11ee-a310-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":7133100708358096}]},"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"}}}},{"type":"powerpack","id":"6f8db988-571f-11ee-8974-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":1212099985738531}]},"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":"frog@datadoghq.com"}}],"meta":{"pagination":{"offset":0,"first_offset":0,"prev_offset":0,"next_offset":25,"last_offset":null,"limit":25,"type":"offset_limit"}},"links":{"self":"https://api.datadoghq.com/api/v2/powerpacks","last":null,"next":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=25&page[limit]=25","prev":null,"first":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=0&page[limit]=25"}} + string: '{"data":[{"type":"powerpack","id":"afe8ae9a-684d-11ee-acaa-da7ad0900002","attributes":{"name":"Test-Get_all_powerpacks_returns_OK_response-1697039336","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":2076464251986187}]},"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"}}}},{"type":"powerpack","id":"1de23daa-67a7-11ee-aeeb-da7ad0900002","attributes":{"name":"","description":"Powerpack + for ABC!","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Powerpack + Test","type":"group","widgets":[]}},"template_variables":null,"tags":[]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},{"type":"powerpack","id":"1aa44f4c-684d-11ee-a69d-da7ad0900002","attributes":{"name":"","description":"Powerpack + for ABCD!","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Powerpack + Test","type":"group","widgets":[{"definition":{"content":"test notes","type":"note"},"id":2505594874009019}]}},"template_variables":null,"tags":[]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}},{"type":"powerpack","id":"17c331c8-67a6-11ee-bad7-da7ad0900002","attributes":{"name":"","description":"Powerpack + for ABC!","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Powerpack + Test","type":"group","widgets":[]}},"template_variables":null,"tags":[]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}],"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"frog@datadoghq.com"}}],"meta":{"pagination":{"offset":0,"first_offset":0,"prev_offset":0,"next_offset":1000,"last_offset":null,"limit":1000,"type":"offset_limit"}},"links":{"self":"https://api.datadoghq.com/api/v2/powerpacks?page%5Blimit%5D=1000","last":null,"next":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=1000&page[limit]=1000","prev":null,"first":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=0&page[limit]=1000"}} ' headers: @@ -85,7 +54,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/powerpacks/ea79a97a-572b-11ee-95d1-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/afe8ae9a-684d-11ee-acaa-da7ad0900002 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.frozen new file mode 100644 index 0000000000..8aa7f07be8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.frozen @@ -0,0 +1 @@ +2023-10-11T19:24:38.025Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.yaml new file mode 100644 index 0000000000..ff6f580f06 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_powerpacks_returns_ok_response_with_pagination.yaml @@ -0,0 +1,85 @@ +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":"Test-Get_all_powerpacks_returns_OK_response_with_pagination-1697052278","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/powerpacks + response: + body: + string: '{"data":{"type":"powerpack","id":"d1938042-686b-11ee-9d56-da7ad0900002","attributes":{"name":"Test-Get_all_powerpacks_returns_OK_response_with_pagination-1697052278","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":4216761608837044}]},"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":"frog@datadoghq.com"}}]} + + ' + 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/v2/powerpacks?page%5Blimit%5D=2 + response: + body: + string: '{"data":[{"type":"powerpack","id":"d1938042-686b-11ee-9d56-da7ad0900002","attributes":{"name":"Test-Get_all_powerpacks_returns_OK_response_with_pagination-1697052278","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":4216761608837044}]},"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"}}}},{"type":"powerpack","id":"cabb74fa-686b-11ee-8326-da7ad0900002","attributes":{"name":"another + powerpack","description":"","group_widget":{"layout":{"x":0,"y":0,"width":4,"height":3},"definition":{"title":"another + powerpack","type":"group","layout_type":"ordered","widgets":[{"layout":{"x":0,"y":0,"width":2,"height":2},"definition":{"type":"note","content":"its + just a ***test***","background_color":"white","font_size":"36","text_align":"center","vertical_align":"center","show_tick":false,"tick_pos":"50%","tick_edge":"left","has_padding":true},"id":2265811261450092}]}},"template_variables":[],"tags":["tag:display"]},"relationships":{"author":{"data":{"type":"users","id":"d5bf7f0a-19b0-11ed-b0df-da7ad0900002"}}}}],"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"frog@datadoghq.com"}},{"type":"users","id":"d5bf7f0a-19b0-11ed-b0df-da7ad0900002","attributes":{"name":"Kevin + Zou","email":"kevin.zou@datadoghq.com"}}],"meta":{"pagination":{"offset":0,"first_offset":0,"prev_offset":0,"next_offset":2,"last_offset":null,"limit":2,"type":"offset_limit"}},"links":{"self":"https://api.datadoghq.com/api/v2/powerpacks?page%5Blimit%5D=2","last":null,"next":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=2&page[limit]=2","prev":null,"first":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=0&page[limit]=2"}} + + ' + 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/v2/powerpacks?page%5Blimit%5D=2&page%5Boffset%5D=2 + response: + body: + string: '{"data":[{"type":"powerpack","id":"7d77332e-6865-11ee-a8bf-da7ad0900002","attributes":{"name":"","description":"Test + Powerpack 2","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Powerpack + Test","type":"group","widgets":[{"definition":{"content":"test test test","type":"note"},"id":887637664261479}]}},"template_variables":null,"tags":[]},"relationships":{"author":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}],"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"email":"frog@datadoghq.com"}}],"meta":{"pagination":{"offset":2,"first_offset":0,"prev_offset":0,"next_offset":4,"last_offset":null,"limit":2,"type":"offset_limit"}},"links":{"self":"https://api.datadoghq.com/api/v2/powerpacks?page%5Blimit%5D=2&page%5Boffset%5D=2","last":null,"next":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=4&page[limit]=2","prev":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=0&page[limit]=2","first":"https://api.datadoghq.com/api/v2/powerpacks?page[offset]=0&page[limit]=2"}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/powerpacks/d1938042-686b-11ee-9d56-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.frozen index 8d5b8f2165..1071753e9f 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.frozen @@ -1 +1 @@ -2023-10-05T15:56:24.178Z \ No newline at end of file +2023-10-11T15:48:57.189Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.yaml index 09c5bba676..f4e6b72b17 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_bad_request_response.yaml @@ -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-Update_a_powerpack_returns_Bad_Request_response-1697039337","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' headers: accept: - application/json @@ -12,10 +11,9 @@ interactions: uri: https://api.datadoghq.com/api/v2/powerpacks response: body: - string: '{"data":{"type":"powerpack","id":"bc22abe4-6397-11ee-865e-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":1043184765896296}]},"layout":{"height":3,"width":12,"x":0,"y":0}},"template_variables":[{"defaults":["*"],"name":"sample"}],"tags":["tag:sample"]},"relationships":{"author":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}},"included":[{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","attributes":{"name":"CI - Account","email":"team-intg-tools-libs-spam@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"b030a42a-684d-11ee-ad9a-da7ad0900002","attributes":{"name":"Test-Update_a_powerpack_returns_Bad_Request_response-1697039337","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":8452824404539211}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -33,7 +31,7 @@ interactions: content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/powerpacks/bc22abe4-6397-11ee-865e-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/b030a42a-684d-11ee-ad9a-da7ad0900002 response: body: string: '{"errors":["Invalid group widget for powerpack. Error: ''group1'' is @@ -51,7 +49,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/powerpacks/bc22abe4-6397-11ee-865e-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/b030a42a-684d-11ee-ad9a-da7ad0900002 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.frozen index 2d3704e417..6794b87fec 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:23.956Z \ No newline at end of file +2023-10-11T15:48:57.662Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.yaml index fc1f0c077e..9364552f47 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_ok_response.yaml @@ -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-Update_a_powerpack_returns_OK_response-1697039337","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":"eb863bda-572b-11ee-a120-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":6171784362108598}]},"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":"frog@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"b07d6fa8-684d-11ee-ac91-da7ad0900002","attributes":{"name":"Test-Update_a_powerpack_returns_OK_response-1697039337","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":8154966623549713}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -25,20 +24,19 @@ interactions: message: OK - 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-Update_a_powerpack_returns_OK_response-1697039337","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' headers: accept: - application/json content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/powerpacks/eb863bda-572b-11ee-a120-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/b07d6fa8-684d-11ee-ac91-da7ad0900002 response: body: - string: '{"data":{"type":"powerpack","id":"eb863bda-572b-11ee-a120-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":4154924957169825}]},"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":"frog@datadoghq.com"}}]} + string: '{"data":{"type":"powerpack","id":"b07d6fa8-684d-11ee-ac91-da7ad0900002","attributes":{"name":"Test-Update_a_powerpack_returns_OK_response-1697039337","description":"Sample + powerpack","group_widget":{"definition":{"layout_type":"ordered","show_title":true,"title":"Sample + Powerpack","type":"group","widgets":[{"definition":{"content":"test","type":"note"},"id":5980827967005331}]},"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":"frog@datadoghq.com"}}]} ' headers: @@ -53,7 +51,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/powerpacks/eb863bda-572b-11ee-a120-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/powerpacks/b07d6fa8-684d-11ee-ac91-da7ad0900002 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.frozen index 4ff3fe5942..2c235aef0f 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.frozen @@ -1 +1 @@ -2023-09-19T20:34:24.805Z \ No newline at end of file +2023-10-11T15:48:58.181Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.yaml index a95ca55489..6145926f24 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_a_powerpack_returns_powerpack_not_found_response.yaml @@ -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-Update_a_powerpack_returns_Powerpack_Not_Found_response-1697039338","tags":["tag:sample"],"template_variables":[{"defaults":["*"],"name":"sample"}]},"type":"powerpack"}}' headers: accept: - application/json diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 3db9325b75..408165d359 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -310,7 +310,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"description\": \"Sample powerpack\",\n \"group_widget\": {\n \"definition\": {\n \"layout_type\": \"ordered\",\n \"show_title\": true,\n \"title\": \"Sample Powerpack\",\n \"type\": \"group\",\n \"widgets\": [\n {\n \"definition\": {\n \"content\": \"test\",\n \"type\": \"note\"\n }\n }\n ]\n },\n \"layout\": {\n \"height\": 3,\n \"width\": 12,\n \"x\": 0,\n \"y\": 0\n }\n },\n \"name\": \"Sample Powerpack\",\n \"tags\": [\n \"tag:sample\"\n ],\n \"template_variables\": [\n {\n \"defaults\": [\n \"*\"\n ],\n \"name\": \"sample\"\n }\n ]\n },\n \"type\": \"powerpack\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"description\": \"Sample powerpack\",\n \"group_widget\": {\n \"definition\": {\n \"layout_type\": \"ordered\",\n \"show_title\": true,\n \"title\": \"Sample Powerpack\",\n \"type\": \"group\",\n \"widgets\": [\n {\n \"definition\": {\n \"content\": \"test\",\n \"type\": \"note\"\n }\n }\n ]\n },\n \"layout\": {\n \"height\": 3,\n \"width\": 12,\n \"x\": 0,\n \"y\": 0\n }\n },\n \"name\": \"{{ unique }}\",\n \"tags\": [\n \"tag:sample\"\n ],\n \"template_variables\": [\n {\n \"defaults\": [\n \"*\"\n ],\n \"name\": \"sample\"\n }\n ]\n },\n \"type\": \"powerpack\"\n }\n}" } ], "step": "there is a valid \"powerpack\" in the system", diff --git a/tests/v2/features/powerpack.feature b/tests/v2/features/powerpack.feature index e14ebfb652..2f622ef349 100644 --- a/tests/v2/features/powerpack.feature +++ b/tests/v2/features/powerpack.feature @@ -24,7 +24,7 @@ Feature: Powerpack When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "powerpack" - And the response "data.attributes.name" is equal to "Sample Powerpack" + And the response "data.attributes.name" is equal to "{{ unique }}" And the response "data.attributes.description" is equal to "Sample powerpack" And the response "data.attributes.template_variables[0].name" is equal to "sample" And the response "data.attributes.template_variables[0].defaults[0]" is equal to "*" @@ -61,7 +61,8 @@ Feature: Powerpack When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "powerpack" - And the response "data.attributes.name" is equal to "Sample Powerpack" + And the response "data.id" has the same value as "powerpack.data.id" + And the response "data.attributes.name" is equal to "{{ unique }}" And the response "data.attributes.description" is equal to "Sample powerpack" And the response "data.attributes.template_variables[0].name" is equal to "sample" And the response "data.attributes.template_variables[0].defaults[0]" is equal to "*" @@ -87,10 +88,12 @@ Feature: Powerpack Scenario: Get all powerpacks returns "OK" response Given there is a valid "powerpack" in the system And new "ListPowerpacks" request + And request contains "page[limit]" parameter with value 1000 When the request is sent Then the response status is 200 OK And the response "data" has item with field "type" with value "powerpack" - And the response "data" has item with field "attributes.name" with value "Sample Powerpack" + And the response "data" has item with field "id" with value "{{ powerpack.data.id }}" + And the response "data" has item with field "attributes.name" with value "{{ unique }}" And the response "data" has item with field "attributes.description" with value "Sample powerpack" And the response "data" has item with field "attributes.template_variables[0].name" with value "sample" And the response "data" has item with field "attributes.template_variables[0].defaults[0]" with value "*" @@ -105,6 +108,15 @@ Feature: Powerpack And the response "data" has item with field "attributes.group_widget.definition.widgets[0].definition.type" with value "note" And the response "data" has item with field "attributes.group_widget.definition.widgets[0].definition.content" with value "test" + @replay-only @skip-validation @team:DataDog/dashboards-backend @with-pagination + Scenario: Get all powerpacks returns "OK" response with pagination + Given there is a valid "powerpack" in the system + And new "ListPowerpacks" request + And request contains "page[limit]" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 3 items + @team:DataDog/dashboards-backend Scenario: Update a powerpack returns "Bad Request" response Given there is a valid "powerpack" in the system @@ -123,7 +135,8 @@ Feature: Powerpack When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "powerpack" - And the response "data.attributes.name" is equal to "Sample Powerpack" + And the response "data.id" has the same value as "powerpack.data.id" + And the response "data.attributes.name" is equal to "{{ unique }}" And the response "data.attributes.description" is equal to "Sample powerpack" And the response "data.attributes.template_variables[0].name" is equal to "sample" And the response "data.attributes.template_variables[0].defaults[0]" is equal to "*" diff --git a/tests/v2/features/powerpack_payload.json b/tests/v2/features/powerpack_payload.json index d0681e3921..32e53416a9 100644 --- a/tests/v2/features/powerpack_payload.json +++ b/tests/v2/features/powerpack_payload.json @@ -24,7 +24,7 @@ "y": 0 } }, - "name": "Sample Powerpack", + "name": "{{ unique }}", "tags": [ "tag:sample" ],