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
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Create reference table returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new

body = DatadogAPIClient::V2::CreateTableRequest.new({
data: DatadogAPIClient::V2::CreateTableRequestData.new({
attributes: DatadogAPIClient::V2::CreateTableRequestDataAttributes.new({
description: "this is a cloud table generated via a cloud bucket sync",
file_metadata: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataCloudStorage.new({
access_details: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.new({
aws_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.new({
aws_account_id: "test-account-id",
aws_bucket_name: "test-bucket",
file_path: "test_rt.csv",
}),
}),
sync_enabled: true,
}),
schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({
fields: [
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "name",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "account_id",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
],
primary_keys: [
"account_id",
],
}),
source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::S3,
table_name: "test_reference_table",
tags: [
"test_tag",
],
}),
type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE,
}),
})
p api_instance.create_reference_table(body)
21 changes: 21 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTableUpload.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Create reference table upload returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new

body = DatadogAPIClient::V2::CreateUploadRequest.new({
data: DatadogAPIClient::V2::CreateUploadRequestData.new({
attributes: DatadogAPIClient::V2::CreateUploadRequestDataAttributes.new({
headers: [
"id",
"name",
"value",
],
table_name: "test_upload_table_Example-Reference-Table",
part_count: 1,
part_size: 1024,
}),
type: DatadogAPIClient::V2::CreateUploadRequestDataType::UPLOAD,
}),
})
p api_instance.create_reference_table_upload(body)
41 changes: 41 additions & 0 deletions examples/v2/reference-tables/CreateReferenceTable_3196130987.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Create reference table with upload returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new

body = DatadogAPIClient::V2::CreateTableRequest.new({
data: DatadogAPIClient::V2::CreateTableRequestData.new({
attributes: DatadogAPIClient::V2::CreateTableRequestDataAttributes.new({
description: "Test reference table created via BDD test Example-Reference-Table",
source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::LOCAL_FILE,
file_metadata: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataLocalFile.new({
upload_id: "test-upload-id-Example-Reference-Table",
}),
schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({
fields: [
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "id",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "name",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "value",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::INT32,
}),
],
primary_keys: [
"id",
],
}),
table_name: "test_reference_table_Example-Reference-Table",
tags: [
"test_tag",
],
}),
type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE,
}),
})
p api_instance.create_reference_table(body)
5 changes: 5 additions & 0 deletions examples/v2/reference-tables/DeleteTable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete table returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.delete_table("id")
5 changes: 5 additions & 0 deletions examples/v2/reference-tables/GetRowsByID.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get rows by id returns "Some or all requested rows were found." response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.get_rows_by_id("id", [])
5 changes: 5 additions & 0 deletions examples/v2/reference-tables/GetTable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get table returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.get_table("id")
5 changes: 5 additions & 0 deletions examples/v2/reference-tables/ListTables.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List tables returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.list_tables()
44 changes: 44 additions & 0 deletions examples/v2/reference-tables/UpdateReferenceTable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Update reference table returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new

body = DatadogAPIClient::V2::PatchTableRequest.new({
data: DatadogAPIClient::V2::PatchTableRequestData.new({
attributes: DatadogAPIClient::V2::PatchTableRequestDataAttributes.new({
description: "this is a cloud table generated via a cloud bucket sync",
file_metadata: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataCloudStorage.new({
access_details: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.new({
aws_detail: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.new({
aws_account_id: "test-account-id",
aws_bucket_name: "test-bucket",
file_path: "test_rt.csv",
}),
}),
sync_enabled: true,
}),
schema: DatadogAPIClient::V2::PatchTableRequestDataAttributesSchema.new({
fields: [
DatadogAPIClient::V2::PatchTableRequestDataAttributesSchemaFieldsItems.new({
name: "id",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::INT32,
}),
DatadogAPIClient::V2::PatchTableRequestDataAttributesSchemaFieldsItems.new({
name: "name",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
],
primary_keys: [
"id",
],
}),
sync_enabled: false,
tags: [
"test_tag",
],
}),
id: "00000000-0000-0000-0000-000000000000",
type: DatadogAPIClient::V2::PatchTableRequestDataType::REFERENCE_TABLE,
}),
})
p api_instance.update_reference_table("id", body)
28 changes: 28 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2555,6 +2555,34 @@
"page_limit" => "Integer",
"page_cursor" => "String",
},
"v2.ListTables" => {
"limit" => "Integer",
"offset" => "Integer",
"sort" => "ReferenceTableSortType",
"filter_status" => "String",
"filter_table_name_exact" => "String",
"filter_table_name_contains" => "String",
},
"v2.CreateReferenceTable" => {
"body" => "CreateTableRequest",
},
"v2.DeleteTable" => {
"id" => "String",
},
"v2.GetTable" => {
"id" => "String",
},
"v2.UpdateReferenceTable" => {
"id" => "String",
"body" => "PatchTableRequest",
},
"v2.GetRowsByID" => {
"id" => "String",
"row_id" => "Array<String>",
},
"v2.CreateReferenceTableUpload" => {
"body" => "CreateUploadRequest",
},
"v2.CreateApplicationSecurityWafCustomRule" => {
"body" => "ApplicationSecurityWafCustomRuleCreateRequest",
},
Expand Down
121 changes: 121 additions & 0 deletions features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
@endpoint(reference-tables) @endpoint(reference-tables-v2)
Feature: Reference Tables
Auto-generated tag Reference Tables

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "ReferenceTables" API

@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table returns "Bad Request" response
Given new "CreateReferenceTable" request
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table returns "Created" response
Given new "CreateReferenceTable" request
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table upload returns "Bad Request" response
Given new "CreateReferenceTableUpload" request
And body with value {"data": {"attributes": {"headers": [""], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}}
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/redapl-experiences
Scenario: Create reference table upload returns "Created" response
Given new "CreateReferenceTableUpload" request
And body with value {"data": {"attributes": {"headers": ["id", "name", "value"], "table_name": "test_upload_table_{{ unique }}", "part_count": 1, "part_size": 1024}, "type": "upload"}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "upload"
And the response "data.attributes.table_name" is equal to "test_upload_table_{{ unique }}"

@skip @team:DataDog/redapl-experiences
Scenario: Create reference table with upload returns "Created" response
Given new "CreateReferenceTable" request
And body with value {"data": {"attributes": {"description": "Test reference table created via BDD test {{ unique }}", "source": "LOCAL_FILE", "file_metadata": {"upload_id": "test-upload-id-{{ unique }}"}, "schema": {"fields": [{"name": "id", "type": "STRING"}, {"name": "name", "type": "STRING"}, {"name": "value", "type": "INT32"}], "primary_keys": ["id"]}, "table_name": "test_reference_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "reference_table"
And the response "data.attributes.table_name" is equal to "test_reference_table_{{ unique }}"

@team:DataDog/redapl-experiences
Scenario: Create reference table without upload or access details returns "Bad Request" response
Given new "CreateReferenceTable" request
And body with value {"data": {"attributes": {"description": "Test reference table without upload or access details", "source": "LOCAL_FILE", "schema": {"fields": [{"name": "id", "type": "STRING"}], "primary_keys": ["id"]}, "table_name": "test_invalid_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Delete table returns "Not Found" response
Given new "DeleteTable" 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: Delete table returns "OK" response
Given new "DeleteTable" request
And request contains "id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/redapl-experiences
Scenario: Get rows by id returns "Not Found" response
Given new "GetRowsByID" request
And request contains "id" parameter from "REPLACE.ME"
And request contains "row_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: Get rows by id returns "Some or all requested rows were found." response
Given new "GetRowsByID" request
And request contains "id" parameter from "REPLACE.ME"
And request contains "row_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 Some or all requested rows were found.

@generated @skip @team:DataDog/redapl-experiences
Scenario: Get table returns "Not Found" response
Given new "GetTable" 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: Get table returns "OK" response
Given new "GetTable" 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
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1

@generated @skip @team:DataDog/redapl-experiences
Scenario: Update reference table returns "Bad Request" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Update reference table returns "OK" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}}
When the request is sent
Then the response status is 200 OK
Loading
Loading