Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------------------------------------

Expand Down
15 changes: 15 additions & 0 deletions examples/v2/reference-tables/ListReferenceTableRows.py
Original file line number Diff line number Diff line change
@@ -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)
68 changes: 68 additions & 0 deletions src/datadog_api_client/v2/api/reference_tables_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,),
Expand Down Expand Up @@ -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,
*,
Expand Down
48 changes: 48 additions & 0 deletions src/datadog_api_client/v2/model/list_rows_response.py
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions src/datadog_api_client/v2/model/list_rows_response_links.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -10339,6 +10341,8 @@
"ListPowerpacksResponse",
"ListRelationCatalogResponse",
"ListRelationCatalogResponseLinks",
"ListRowsResponse",
"ListRowsResponseLinks",
"ListRulesResponse",
"ListRulesResponseDataItem",
"ListRulesResponseLinks",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-15T19:32:21.293Z
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-15T19:32:23.068Z
Loading
Loading