Skip to content
Merged
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
141 changes: 135 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7475,23 +7475,89 @@ components:
properties:
data:
items:
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
$ref: '#/components/schemas/TableRowResourceIdentifier'
maxItems: 200
type: array
required:
- data
type: object
BatchDeleteRowsRequestData:
description: Row resource containing a single row identifier for deletion.
BatchRowsQueryDataType:
default: reference-tables-batch-rows-query
description: Resource type identifier for batch queries of reference table rows.
enum:
- reference-tables-batch-rows-query
example: reference-tables-batch-rows-query
type: string
x-enum-varnames:
- REFERENCE_TABLES_BATCH_ROWS_QUERY
BatchRowsQueryRequest:
properties:
data:
$ref: '#/components/schemas/BatchRowsQueryRequestData'
type: object
BatchRowsQueryRequestData:
properties:
attributes:
$ref: '#/components/schemas/BatchRowsQueryRequestDataAttributes'
type:
$ref: '#/components/schemas/BatchRowsQueryDataType'
required:
- type
type: object
BatchRowsQueryRequestDataAttributes:
properties:
row_ids:
example:
- row_id_1
- row_id_2
items:
type: string
type: array
table_id:
example: 00000000-0000-0000-0000-000000000000
type: string
required:
- row_ids
- table_id
type: object
BatchRowsQueryResponse:
example:
data:
id: 00000000-0000-0000-0000-000000000000
relationships:
rows:
data:
- id: row_id_1
type: row
- id: row_id_2
type: row
type: reference-tables-batch-rows-query
properties:
data:
$ref: '#/components/schemas/BatchRowsQueryResponseData'
type: object
BatchRowsQueryResponseData:
properties:
id:
example: primary_key_value
type: string
relationships:
$ref: '#/components/schemas/BatchRowsQueryResponseDataRelationships'
type:
$ref: '#/components/schemas/TableRowResourceDataType'
$ref: '#/components/schemas/BatchRowsQueryDataType'
required:
- type
- id
type: object
BatchRowsQueryResponseDataRelationships:
properties:
rows:
$ref: '#/components/schemas/BatchRowsQueryResponseDataRelationshipsRows'
type: object
BatchRowsQueryResponseDataRelationshipsRows:
properties:
data:
items:
$ref: '#/components/schemas/TableRowResourceIdentifier'
type: array
type: object
BatchUpsertRowsRequestArray:
description: The request body for creating or updating multiple rows into a
Expand Down Expand Up @@ -66953,6 +67019,18 @@ components:
type: string
x-enum-varnames:
- ROW
TableRowResourceIdentifier:
description: Row resource containing a single row identifier.
properties:
id:
example: primary_key_value
type: string
type:
$ref: '#/components/schemas/TableRowResourceDataType'
required:
- type
- id
type: object
TagsEventAttribute:
description: Array of tags associated with your event.
example:
Expand Down Expand Up @@ -96388,6 +96466,57 @@ paths:
operator: OR
permissions:
- timeseries_query
/api/v2/reference-tables/queries/batch-rows:
post:
description: Batch query reference table rows by their primary key values. Returns
only found rows in the included array.
operationId: BatchRowsQuery
requestBody:
content:
application/json:
examples:
happy_path:
summary: Batch query reference table rows by their primary key values.
value:
data:
attributes:
row_ids:
- row_id_1
- row_id_2
table_id: 00000000-0000-0000-0000-000000000000
type: reference-tables-batch-rows-query
schema:
$ref: '#/components/schemas/BatchRowsQueryRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BatchRowsQueryResponse'
description: Successfully retrieved rows. Some or all requested rows were
found. Response includes found rows in the included section.
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Batch rows query
tags:
- Reference Tables
/api/v2/reference-tables/tables:
get:
description: List all reference tables in this organization.
Expand Down
21 changes: 21 additions & 0 deletions features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ Feature: Reference Tables
And a valid "appKeyAuth" key in the system
And an instance of "ReferenceTables" API

@generated @skip @team:DataDog/redapl-experiences
Scenario: Batch rows query returns "Bad Request" response
Given new "BatchRowsQuery" request
And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Batch rows query returns "Not Found" response
Given new "BatchRowsQuery" request
And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/redapl-experiences
Scenario: Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section." response
Given new "BatchRowsQuery" request
And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}}
When the request is sent
Then the response status is 200 Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section.

@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table returns "Bad Request" response
Given new "CreateReferenceTable" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3963,6 +3963,12 @@
"type": "idempotent"
}
},
"BatchRowsQuery": {
"tag": "Reference Tables",
"undo": {
"type": "safe"
}
},
"ListTables": {
"tag": "Reference Tables",
"undo": {
Expand Down
7 changes: 7 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9167,6 +9167,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "ListConnectionsResponse",
},
"ReferenceTablesApi.V2.BatchRowsQuery": {
body: {
type: "BatchRowsQueryRequest",
format: "",
},
operationResponseType: "BatchRowsQueryResponse",
},
"ReferenceTablesApi.V2.ListTables": {
pageLimit: {
type: "number",
Expand Down
2 changes: 1 addition & 1 deletion services/reference_tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const configuration = createConfiguration();
const apiInstance = new ReferenceTablesApiV2(configuration);
const params = {/* parameters */};

apiInstance.listTables(params).then((data) => {
apiInstance.batchRowsQuery(params).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}).catch((error) => {
console.error("Error calling API: " + error);
Expand Down
Loading
Loading