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
1,297 changes: 1,297 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-10-01T20:51:23.877Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"log": {
"_recordingName": "Reference Tables/Create reference table without upload or access details returns \"Bad Request\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "b227430e09eacae9d1cd62ee343d2443",
"_order": 0,
"cache": {},
"request": {
"bodySize": 371,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 578,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"data\":{\"attributes\":{\"description\":\"Test reference table without upload or access details\",\"schema\":{\"fields\":[{\"name\":\"id\",\"type\":\"STRING\"}],\"primary_keys\":[\"id\"]},\"source\":\"LOCAL_FILE\",\"table_name\":\"test_invalid_table_Test-Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response-1759351883\",\"tags\":[\"test_tag\"]},\"type\":\"reference_table\"}}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/reference-tables/tables"
},
"response": {
"bodySize": 107,
"content": {
"mimeType": "application/vnd.api+json",
"size": 107,
"text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"upload_id is required for tables with 'LOCAL_FILE' source\"}]}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 670,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 400,
"statusText": "Bad Request"
},
"startedDateTime": "2025-10-01T20:51:24.507Z",
"time": 129
}
],
"pages": [],
"version": "1.2"
}
}
4 changes: 2 additions & 2 deletions examples/v1/logs-pipelines/CreateLogsPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const params: v1.LogsPipelinesApiCreateLogsPipelineRequest = {
processors: [
{
grok: {
matchRules: "rule_name_1 foo\nrule_name_2 bar\n",
supportRules: "rule_name_1 foo\nrule_name_2 bar\n",
matchRules: "rule_name_1 foo\nrule_name_2 bar",
supportRules: "rule_name_1 foo\nrule_name_2 bar",
},
isEnabled: false,
samples: [],
Expand Down
4 changes: 2 additions & 2 deletions examples/v1/logs-pipelines/UpdateLogsPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const params: v1.LogsPipelinesApiUpdateLogsPipelineRequest = {
processors: [
{
grok: {
matchRules: "rule_name_1 foo\nrule_name_2 bar\n",
supportRules: "rule_name_1 foo\nrule_name_2 bar\n",
matchRules: "rule_name_1 foo\nrule_name_2 bar",
supportRules: "rule_name_1 foo\nrule_name_2 bar",
},
isEnabled: false,
samples: [],
Expand Down
54 changes: 54 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Create reference table returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiCreateReferenceTableRequest = {
body: {
data: {
attributes: {
description: "this is a cloud table generated via a cloud bucket sync",
fileMetadata: {
accessDetails: {
awsDetail: {
awsAccountId: "test-account-id",
awsBucketName: "test-bucket",
filePath: "test_rt.csv",
},
},
syncEnabled: true,
},
schema: {
fields: [
{
name: "name",
type: "STRING",
},
{
name: "account_id",
type: "STRING",
},
],
primaryKeys: ["account_id"],
},
source: "S3",
tableName: "test_reference_table",
tags: ["test_tag"],
},
type: "reference_table",
},
},
};

apiInstance
.createReferenceTable(params)
.then((data: v2.TableResultV2) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
31 changes: 31 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTableUpload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Create reference table upload returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiCreateReferenceTableUploadRequest = {
body: {
data: {
attributes: {
headers: ["id", "name", "value"],
tableName: "test_upload_table_Example-Reference-Table",
partCount: 1,
partSize: 1024,
},
type: "upload",
},
},
};

apiInstance
.createReferenceTableUpload(params)
.then((data: v2.CreateUploadResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
52 changes: 52 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTable_3196130987.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Create reference table with upload returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiCreateReferenceTableRequest = {
body: {
data: {
attributes: {
description:
"Test reference table created via BDD test Example-Reference-Table",
source: "LOCAL_FILE",
fileMetadata: {
uploadId: "test-upload-id-Example-Reference-Table",
},
schema: {
fields: [
{
name: "id",
type: "STRING",
},
{
name: "name",
type: "STRING",
},
{
name: "value",
type: "INT32",
},
],
primaryKeys: ["id"],
},
tableName: "test_reference_table_Example-Reference-Table",
tags: ["test_tag"],
},
type: "reference_table",
},
},
};

apiInstance
.createReferenceTable(params)
.then((data: v2.TableResultV2) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
21 changes: 21 additions & 0 deletions examples/v2/reference-tables/DeleteTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Delete table returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiDeleteTableRequest = {
id: "id",
};

apiInstance
.deleteTable(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/reference-tables/GetRowsByID.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Get rows by id returns "Some or all requested rows were found." response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiGetRowsByIDRequest = {
rowId: [],
id: "id",
};

apiInstance
.getRowsByID(params)
.then((data: v2.TableRowResourceArray) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
21 changes: 21 additions & 0 deletions examples/v2/reference-tables/GetTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Get table returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiGetTableRequest = {
id: "id",
};

apiInstance
.getTable(params)
.then((data: v2.TableResultV2) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
17 changes: 17 additions & 0 deletions examples/v2/reference-tables/ListTables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* List tables returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

apiInstance
.listTables()
.then((data: v2.TableResultV2Array) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
55 changes: 55 additions & 0 deletions examples/v2/reference-tables/UpdateReferenceTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Update reference table returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiUpdateReferenceTableRequest = {
body: {
data: {
attributes: {
description: "this is a cloud table generated via a cloud bucket sync",
fileMetadata: {
accessDetails: {
awsDetail: {
awsAccountId: "test-account-id",
awsBucketName: "test-bucket",
filePath: "test_rt.csv",
},
},
syncEnabled: true,
},
schema: {
fields: [
{
name: "id",
type: "INT32",
},
{
name: "name",
type: "STRING",
},
],
primaryKeys: ["id"],
},
syncEnabled: false,
tags: ["test_tag"],
},
id: "00000000-0000-0000-0000-000000000000",
type: "reference_table",
},
},
id: "id",
};

apiInstance
.updateReferenceTable(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Loading