From 79db404b8a438c4dac08c73cdfcd41c124714fa7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Sat, 16 May 2026 03:44:23 +0000 Subject: [PATCH] Regenerate client from commit 99e84ba of spec repo --- .generator/schemas/v2/openapi.yaml | 112 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 14 +++ .../ListReferenceTableRows.py | 15 +++ .../v2/api/reference_tables_api.py | 68 +++++++++++ .../v2/model/list_rows_response.py | 48 ++++++++ .../v2/model/list_rows_response_links.py | 49 ++++++++ src/datadog_api_client/v2/models/__init__.py | 4 + ..._request_response_for_invalid_limit.frozen | 1 + ...ad_request_response_for_invalid_limit.yaml | 19 +++ ...ble_rows_returns_not_found_response.frozen | 1 + ...table_rows_returns_not_found_response.yaml | 19 +++ tests/v2/features/reference_tables.feature | 35 ++++++ tests/v2/features/undo.json | 6 + 13 files changed, 391 insertions(+) create mode 100644 examples/v2/reference-tables/ListReferenceTableRows.py create mode 100644 src/datadog_api_client/v2/model/list_rows_response.py create mode 100644 src/datadog_api_client/v2/model/list_rows_response_links.py create mode 100644 tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c554255f13..2d9b7ddd35 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43548,6 +43548,51 @@ components: example: "/api/v2/catalog/relation?filter[from_ref]=service:service-catalog&include=entity&page[limit]=2&page[offset]=0" type: string type: object + ListRowsResponse: + description: Paginated list of reference table rows. + example: + data: + - attributes: + values: + category: tor + intention: suspicious + ip_address: 102.130.113.9 + id: 102.130.113.9 + type: row + links: + first: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Blimit%5D=100" + self: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Bcontinuation_token%5D=eyJzaWQiOjEyMzQ1LCJwayI6ImV4YW1wbGVfcGsifQ%3D%3D&page%5Blimit%5D=100" + properties: + data: + description: The rows. + items: + $ref: "#/components/schemas/TableRowResourceData" + type: array + links: + $ref: "#/components/schemas/ListRowsResponseLinks" + required: + - data + - links + type: object + ListRowsResponseLinks: + description: Pagination links for the list rows response. + properties: + first: + description: Link to the first page of results. + example: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Blimit%5D=100" + type: string + next: + description: Link to the next page of results. Only present when more rows are available. + example: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Bcontinuation_token%5D=eyJzaWQiOjEyMzQ1LCJwayI6ImV4YW1wbGVfcGsifQ%3D%3D&page%5Blimit%5D=100" + type: string + self: + description: Link to the current page of results. + example: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Bcontinuation_token%5D=eyJzaWQiOjEyMzQ1LCJwayI6ImV4YW1wbGVfcGsifQ%3D%3D&page%5Blimit%5D=100" + type: string + required: + - self + - first + type: object ListRulesResponse: description: Scorecard rules response. properties: @@ -127568,6 +127613,73 @@ paths: summary: Upsert rows tags: - Reference Tables + /api/v2/reference-tables/tables/{id}/rows/list: + get: + description: List all rows in a reference table using cursor-based pagination. Pass the `page[continuation_token]` from the previous response to fetch the next page on the same consistent snapshot. Returns 400 for tables with more than 10,000,000 rows. + operationId: ListReferenceTableRows + parameters: + - description: Unique identifier of the reference table to list rows from. + example: "00000000-0000-0000-0000-000000000000" + in: path + name: id + required: true + schema: + type: string + - description: Number of rows to return per page. Defaults to 100, maximum is 1000. + example: 100 + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: Opaque cursor from the previous response's next link. Pass this to retrieve the next page on the same consistent snapshot. + example: "eyJzaWQiOjEyMzQ1LCJwayI6ImV4YW1wbGVfcGsifQ==" + in: query + name: page[continuation_token] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + values: + category: tor + intention: suspicious + ip_address: 102.130.113.9 + id: 102.130.113.9 + type: row + links: + first: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Blimit%5D=100" + next: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Bcontinuation_token%5D=eyJzaWQiOjY5NzA0ODkwNDE4ODA3MTAzOTgsInBrIjoiMTAyLjEzMC4xMjcuMTE3In0%3D&page%5Blimit%5D=100" + self: "/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list?page%5Bcontinuation_token%5D=eyJzaWQiOjEyMzQ1LCJwayI6ImV4YW1wbGVfcGsifQ%3D%3D&page%5Blimit%5D=100" + schema: + $ref: "#/components/schemas/ListRowsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List rows + tags: + - Reference Tables /api/v2/reference-tables/uploads: post: description: Create a reference table upload for bulk data ingestion diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 0c5968992f..539c7e5f0f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -17399,6 +17399,20 @@ datadog\_api\_client.v2.model.list\_relation\_catalog\_response\_links module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_rows\_response module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_rows_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_rows\_response\_links module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_rows_response_links + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_rules\_response module ---------------------------------------------------------- diff --git a/examples/v2/reference-tables/ListReferenceTableRows.py b/examples/v2/reference-tables/ListReferenceTableRows.py new file mode 100644 index 0000000000..13a6f82b81 --- /dev/null +++ b/examples/v2/reference-tables/ListReferenceTableRows.py @@ -0,0 +1,15 @@ +""" +List rows returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ReferenceTablesApi(api_client) + response = api_instance.list_reference_table_rows( + id="id", + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/reference_tables_api.py b/src/datadog_api_client/v2/api/reference_tables_api.py index ff381a18e6..9641953c83 100644 --- a/src/datadog_api_client/v2/api/reference_tables_api.py +++ b/src/datadog_api_client/v2/api/reference_tables_api.py @@ -21,6 +21,7 @@ from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray from datadog_api_client.v2.model.table_row_resource_array import TableRowResourceArray from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray +from datadog_api_client.v2.model.list_rows_response import ListRowsResponse from datadog_api_client.v2.model.create_upload_response import CreateUploadResponse from datadog_api_client.v2.model.create_upload_request import CreateUploadRequest @@ -197,6 +198,43 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_reference_table_rows_endpoint = _Endpoint( + settings={ + "response_type": (ListRowsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/reference-tables/tables/{id}/rows/list", + "operation_id": "list_reference_table_rows", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "page_limit": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_continuation_token": { + "openapi_types": (str,), + "attribute": "page[continuation_token]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_tables_endpoint = _Endpoint( settings={ "response_type": (TableResultV2Array,), @@ -433,6 +471,36 @@ def get_table( return self._get_table_endpoint.call_with_http_info(**kwargs) + def list_reference_table_rows( + self, + id: str, + *, + page_limit: Union[int, UnsetType] = unset, + page_continuation_token: Union[str, UnsetType] = unset, + ) -> ListRowsResponse: + """List rows. + + List all rows in a reference table using cursor-based pagination. Pass the ``page[continuation_token]`` from the previous response to fetch the next page on the same consistent snapshot. Returns 400 for tables with more than 10,000,000 rows. + + :param id: Unique identifier of the reference table to list rows from. + :type id: str + :param page_limit: Number of rows to return per page. Defaults to 100, maximum is 1000. + :type page_limit: int, optional + :param page_continuation_token: Opaque cursor from the previous response's next link. Pass this to retrieve the next page on the same consistent snapshot. + :type page_continuation_token: str, optional + :rtype: ListRowsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_continuation_token is not unset: + kwargs["page_continuation_token"] = page_continuation_token + + return self._list_reference_table_rows_endpoint.call_with_http_info(**kwargs) + def list_tables( self, *, diff --git a/src/datadog_api_client/v2/model/list_rows_response.py b/src/datadog_api_client/v2/model/list_rows_response.py new file mode 100644 index 0000000000..9c1ffaddf2 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_rows_response.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.table_row_resource_data import TableRowResourceData + from datadog_api_client.v2.model.list_rows_response_links import ListRowsResponseLinks + + +class ListRowsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.table_row_resource_data import TableRowResourceData + from datadog_api_client.v2.model.list_rows_response_links import ListRowsResponseLinks + + return { + "data": ([TableRowResourceData],), + "links": (ListRowsResponseLinks,), + } + + attribute_map = { + "data": "data", + "links": "links", + } + + def __init__(self_, data: List[TableRowResourceData], links: ListRowsResponseLinks, **kwargs): + """ + Paginated list of reference table rows. + + :param data: The rows. + :type data: [TableRowResourceData] + + :param links: Pagination links for the list rows response. + :type links: ListRowsResponseLinks + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links diff --git a/src/datadog_api_client/v2/model/list_rows_response_links.py b/src/datadog_api_client/v2/model/list_rows_response_links.py new file mode 100644 index 0000000000..b2c8b9c1c2 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_rows_response_links.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ListRowsResponseLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first": (str,), + "next": (str,), + "self": (str,), + } + + attribute_map = { + "first": "first", + "next": "next", + "self": "self", + } + + def __init__(self_, first: str, self: str, next: Union[str, UnsetType] = unset, **kwargs): + """ + Pagination links for the list rows response. + + :param first: Link to the first page of results. + :type first: str + + :param next: Link to the next page of results. Only present when more rows are available. + :type next: str, optional + + :param self: Link to the current page of results. + :type self: str + """ + if next is not unset: + kwargs["next"] = next + super().__init__(kwargs) + + self_.first = first + self_.self = self diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a3fe5f6f9d..71700f08e6 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3504,6 +3504,8 @@ from datadog_api_client.v2.model.list_powerpacks_response import ListPowerpacksResponse from datadog_api_client.v2.model.list_relation_catalog_response import ListRelationCatalogResponse from datadog_api_client.v2.model.list_relation_catalog_response_links import ListRelationCatalogResponseLinks +from datadog_api_client.v2.model.list_rows_response import ListRowsResponse +from datadog_api_client.v2.model.list_rows_response_links import ListRowsResponseLinks from datadog_api_client.v2.model.list_rules_response import ListRulesResponse from datadog_api_client.v2.model.list_rules_response_data_item import ListRulesResponseDataItem from datadog_api_client.v2.model.list_rules_response_links import ListRulesResponseLinks @@ -10339,6 +10341,8 @@ "ListPowerpacksResponse", "ListRelationCatalogResponse", "ListRelationCatalogResponseLinks", + "ListRowsResponse", + "ListRowsResponseLinks", "ListRulesResponse", "ListRulesResponseDataItem", "ListRulesResponseLinks", diff --git a/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.frozen b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.frozen new file mode 100644 index 0000000000..84c1983149 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.frozen @@ -0,0 +1 @@ +2026-05-15T19:32:21.293Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.yaml b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.yaml new file mode 100644 index 0000000000..5bc1c4c758 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_bad_request_response_for_invalid_limit.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/reference-tables/tables/not-a-valid-uuid/rows/list + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"table ID must be a valid + UUID format"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.frozen new file mode 100644 index 0000000000..58c81afc5e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-05-15T19:32:23.068Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.yaml new file mode 100644 index 0000000000..9f14c587b2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_reference_table_rows_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/reference-tables/tables/00000000-0000-0000-0000-000000000000/rows/list + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"table not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/features/reference_tables.feature b/tests/v2/features/reference_tables.feature index 0ba8738c6b..859f70c13e 100644 --- a/tests/v2/features/reference_tables.feature +++ b/tests/v2/features/reference_tables.feature @@ -142,6 +142,41 @@ Feature: Reference Tables When the request is sent Then the response status is 200 OK + @team:DataDog/redapl-experiences + Scenario: List reference table rows returns "Bad Request" response for invalid limit + Given new "ListReferenceTableRows" request + And request contains "id" parameter with value "not-a-valid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/redapl-experiences + Scenario: List reference table rows returns "Not Found" response + Given new "ListReferenceTableRows" request + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: List rows returns "Bad Request" response + Given new "ListReferenceTableRows" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: List rows returns "Not Found" response + Given new "ListReferenceTableRows" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: List rows returns "OK" response + Given new "ListReferenceTableRows" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/redapl-experiences Scenario: List tables returns "OK" response Given new "ListTables" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index faa660d7de..5a00daefda 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4820,6 +4820,12 @@ "type": "unsafe" } }, + "ListReferenceTableRows": { + "tag": "Reference Tables", + "undo": { + "type": "safe" + } + }, "CreateReferenceTableUpload": { "tag": "Reference Tables", "undo": {