diff --git a/.apigentools-info b/.apigentools-info index 56a5f00e60..57db6342ea 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.5", - "regenerated": "2023-07-05 21:53:47.988269", - "spec_repo_commit": "aee1c6e4" + "regenerated": "2023-07-06 20:39:52.417261", + "spec_repo_commit": "45b9e51d" }, "v2": { "apigentools_version": "1.6.5", - "regenerated": "2023-07-05 21:53:48.144607", - "spec_repo_commit": "aee1c6e4" + "regenerated": "2023-07-06 20:39:52.441657", + "spec_repo_commit": "45b9e51d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 761a542d16..545ecdc4fb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21255,15 +21255,21 @@ paths: required: false schema: type: string - - description: 'For customers with multiple indexes, the indexes to search + - description: 'For customers with multiple indexes, the indexes to search. Defaults to ''*'' which means all indexes' - example: main + example: + - main + - web + explode: false in: query - name: filter[index] + name: filter[indexes] required: false schema: - type: string + items: + description: The name of a log index. + type: string + type: array - description: Minimum timestamp for requested logs. example: '2019-01-02T09:42:36.320Z' in: query diff --git a/examples/v2/logs/ListLogsGet_2034110533.py b/examples/v2/logs/ListLogsGet_2034110533.py index f34f59bcf3..669a62d8f0 100644 --- a/examples/v2/logs/ListLogsGet_2034110533.py +++ b/examples/v2/logs/ListLogsGet_2034110533.py @@ -12,7 +12,9 @@ api_instance = LogsApi(api_client) response = api_instance.list_logs_get( filter_query="datadog-agent", - filter_index="main", + filter_indexes=[ + "main", + ], filter_from=datetime(2020, 9, 17, 11, 48, 36, tzinfo=tzoffset(None, 3600)), filter_to=datetime(2020, 9, 17, 12, 48, 36, tzinfo=tzoffset(None, 3600)), page_limit=5, diff --git a/src/datadog_api_client/v2/api/logs_api.py b/src/datadog_api_client/v2/api/logs_api.py index 228c1d35f0..6ee98ff36c 100644 --- a/src/datadog_api_client/v2/api/logs_api.py +++ b/src/datadog_api_client/v2/api/logs_api.py @@ -4,7 +4,7 @@ from __future__ import annotations import collections -from typing import Any, Dict, Union +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration @@ -90,10 +90,11 @@ def __init__(self, api_client=None): "attribute": "filter[query]", "location": "query", }, - "filter_index": { - "openapi_types": (str,), - "attribute": "filter[index]", + "filter_indexes": { + "openapi_types": ([str],), + "attribute": "filter[indexes]", "location": "query", + "collection_format": "csv", }, "filter_from": { "openapi_types": (datetime,), @@ -294,7 +295,7 @@ def list_logs_get( self, *, filter_query: Union[str, UnsetType] = unset, - filter_index: Union[str, UnsetType] = unset, + filter_indexes: Union[List[str], UnsetType] = unset, filter_from: Union[datetime, UnsetType] = unset, filter_to: Union[datetime, UnsetType] = unset, filter_storage_tier: Union[LogsStorageTier, UnsetType] = unset, @@ -315,9 +316,9 @@ def list_logs_get( :param filter_query: Search query following logs syntax. :type filter_query: str, optional - :param filter_index: For customers with multiple indexes, the indexes to search + :param filter_indexes: For customers with multiple indexes, the indexes to search. Defaults to '*' which means all indexes - :type filter_index: str, optional + :type filter_indexes: [str], optional :param filter_from: Minimum timestamp for requested logs. :type filter_from: datetime, optional :param filter_to: Maximum timestamp for requested logs. @@ -336,8 +337,8 @@ def list_logs_get( if filter_query is not unset: kwargs["filter_query"] = filter_query - if filter_index is not unset: - kwargs["filter_index"] = filter_index + if filter_indexes is not unset: + kwargs["filter_indexes"] = filter_indexes if filter_from is not unset: kwargs["filter_from"] = filter_from @@ -363,7 +364,7 @@ def list_logs_get_with_pagination( self, *, filter_query: Union[str, UnsetType] = unset, - filter_index: Union[str, UnsetType] = unset, + filter_indexes: Union[List[str], UnsetType] = unset, filter_from: Union[datetime, UnsetType] = unset, filter_to: Union[datetime, UnsetType] = unset, filter_storage_tier: Union[LogsStorageTier, UnsetType] = unset, @@ -377,9 +378,9 @@ def list_logs_get_with_pagination( :param filter_query: Search query following logs syntax. :type filter_query: str, optional - :param filter_index: For customers with multiple indexes, the indexes to search + :param filter_indexes: For customers with multiple indexes, the indexes to search. Defaults to '*' which means all indexes - :type filter_index: str, optional + :type filter_indexes: [str], optional :param filter_from: Minimum timestamp for requested logs. :type filter_from: datetime, optional :param filter_to: Maximum timestamp for requested logs. @@ -400,8 +401,8 @@ def list_logs_get_with_pagination( if filter_query is not unset: kwargs["filter_query"] = filter_query - if filter_index is not unset: - kwargs["filter_index"] = filter_index + if filter_indexes is not unset: + kwargs["filter_indexes"] = filter_indexes if filter_from is not unset: kwargs["filter_from"] = filter_from diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.frozen index bdfd9c7f81..aef7285a76 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.frozen @@ -1 +1 @@ -2022-01-06T00:51:50.622Z \ No newline at end of file +2023-07-05T20:27:06.820Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.yaml index 5dcf1a9c81..699d4675b6 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_a_quick_list_of_logs_returns_ok_response.yaml @@ -5,10 +5,12 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/logs/events?filter%5Bquery%5D=datadog-agent&filter%5Bindex%5D=main&filter%5Bfrom%5D=2020-09-17T11%3A48%3A36%2B01%3A00&filter%5Bto%5D=2020-09-17T12%3A48%3A36%2B01%3A00&page%5Blimit%5D=5 + uri: https://api.datadoghq.com/api/v2/logs/events?filter%5Bquery%5D=datadog-agent&filter%5Bindexes%5D=main&filter%5Bfrom%5D=2020-09-17T11%3A48%3A36%2B01%3A00&filter%5Bto%5D=2020-09-17T12%3A48%3A36%2B01%3A00&page%5Blimit%5D=5 response: body: - string: '{"data":[]}' + string: '{"data":[],"meta":{"elapsed":0,"request_id":"pddv1ChZVZjdFSUNKdlM3LVBKNXNPcjR6R1hnIiwKHP4qJC1KWavJCGIvcezlUg3AhhLxU4JfitQ_QFESDFVjhmcEEEIN8NN7KA","status":"done"}} + + ' headers: content-type: - application/json diff --git a/tests/v2/features/logs.feature b/tests/v2/features/logs.feature index 3285929828..a3bf22f42a 100644 --- a/tests/v2/features/logs.feature +++ b/tests/v2/features/logs.feature @@ -69,7 +69,7 @@ Feature: Logs Given a valid "appKeyAuth" key in the system And new "ListLogsGet" request And request contains "filter[query]" parameter with value "datadog-agent" - And request contains "filter[index]" parameter with value "main" + And request contains "filter[indexes]" parameter with value ["main"] And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00" And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00" And request contains "page[limit]" parameter with value 5