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
143 changes: 91 additions & 52 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13142,30 +13142,6 @@ components:
CreateTableRequest:
description: Request body for creating a new reference table from a local file
or cloud storage.
example:
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
properties:
data:
$ref: '#/components/schemas/CreateTableRequestData'
Expand Down Expand Up @@ -13387,6 +13363,17 @@ components:
CreateUploadRequest:
description: Request to create an upload for a file to be ingested into a reference
table.
example:
data:
attributes:
headers:
- product_id
- product_name
- price
part_count: 3
part_size: 10000000
table_name: my_products_table
type: upload
properties:
data:
$ref: '#/components/schemas/CreateUploadRequestData'
Expand Down Expand Up @@ -28217,6 +28204,10 @@ components:
description: The date/time when the rotation starts (ISO 8601).
format: date-time
type: string
time_zone:
description: The time zone for this layer.
example: America/New_York
type: string
type: object
LayerAttributesInterval:
description: Defines how often the rotation repeats, using a combination of
Expand Down Expand Up @@ -44321,6 +44312,10 @@ components:
example: '2025-01-01T00:00:00Z'
format: date-time
type: string
time_zone:
description: The time zone for this layer.
example: America/New_York
type: string
required:
- name
- interval
Expand Down Expand Up @@ -44671,6 +44666,10 @@ components:
example: '2025-02-01T00:00:00Z'
format: date-time
type: string
time_zone:
description: The time zone for this layer.
example: America/New_York
type: string
required:
- effective_date
- interval
Expand Down Expand Up @@ -51089,32 +51088,35 @@ components:
type: string
type: object
TableResultV2DataAttributesFileMetadata:
description: Metadata specifying where and how to access the reference table's
data file.
oneOf:
- $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorage'
- $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataLocalFile'
TableResultV2DataAttributesFileMetadataCloudStorage:
additionalProperties: false
description: File metadata for reference tables created by cloud storage.
description: "Metadata specifying where and how to access the reference table's
data file.\n\nFor cloud storage tables (S3/GCS/Azure):\n - sync_enabled and
access_details will always be present\n - error fields (error_message, error_row_count,
error_type) are present only when errors occur\n\nFor local file tables:\n
\ - error fields (error_message, error_row_count) are present only when errors
occur\n - sync_enabled, access_details are never present"
properties:
access_details:
$ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetails'
description: Cloud storage access configuration. Only present for cloud
storage sources (S3, GCS, Azure).
error_message:
description: The error message returned from the sync.
description: The error message returned from the last operation (sync for
cloud storage, upload for local file).
type: string
error_row_count:
description: The number of rows that failed to sync.
description: The number of rows that failed to process.
format: int64
type: integer
error_type:
$ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorageErrorType'
description: The type of error that occurred during file processing. Only
applicable for cloud storage sources.
sync_enabled:
description: Whether this table is synced automatically.
description: Whether this table is synced automatically from cloud storage.
Only applicable for cloud storage sources.
type: boolean
required:
- access_details
title: CloudFileMetadataV2
title: FileMetadataV2
type: object
TableResultV2DataAttributesFileMetadataCloudStorageErrorType:
description: The type of error that occurred during file processing. This field
Expand All @@ -51141,21 +51143,6 @@ components:
- STATE_ERROR
- OPERATION_ERROR
- SYSTEM_ERROR
TableResultV2DataAttributesFileMetadataLocalFile:
additionalProperties: false
description: File metadata for reference tables created by upload. Note that
upload_id is only returned in the immediate create/replace response and is
not available in subsequent GET requests.
properties:
error_message:
description: The error message returned from the creation/update.
type: string
error_row_count:
description: The number of rows that failed to create/update.
format: int64
type: integer
title: LocalFileMetadataV2
type: object
TableResultV2DataAttributesFileMetadataOneOfAccessDetails:
description: Cloud storage access configuration for the reference table data
file.
Expand Down Expand Up @@ -73511,6 +73498,58 @@ paths:
requestBody:
content:
application/json:
examples:
cloud_storage:
summary: Create table from cloud storage (S3)
value:
data:
attributes:
description: Customer reference data synced from S3
file_metadata:
access_details:
aws_detail:
aws_account_id: '924305315327'
aws_bucket_name: my-data-bucket
file_path: customers.csv
sync_enabled: true
schema:
fields:
- name: customer_id
type: STRING
- name: customer_name
type: STRING
- name: email
type: STRING
primary_keys:
- customer_id
source: S3
table_name: customer_reference_data
tags:
- team:data-platform
type: reference_table
local_file:
summary: Create table from local file upload
value:
data:
attributes:
description: Product catalog uploaded via local file
file_metadata:
upload_id: 00000000-0000-0000-0000-000000000000
schema:
fields:
- name: product_id
type: STRING
- name: product_name
type: STRING
- name: price
type: DOUBLE
primary_keys:
- product_id
source: LOCAL_FILE
table_name: product_catalog
tags:
- team:ecommerce
type: reference_table
schema:
$ref: '#/components/schemas/CreateTableRequest'
required: true
Expand Down
37 changes: 23 additions & 14 deletions examples/v2/reference-tables/CreateReferenceTable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,45 @@
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",
aws_account_id: "123456789000",
aws_bucket_name: "example-data-bucket",
file_path: "reference-tables/users.csv",
}),
azure_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.new({
azure_client_id: "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb",
azure_container_name: "reference-data",
azure_storage_account_name: "examplestorageaccount",
azure_tenant_id: "cccccccc-4444-5555-6666-dddddddddddd",
file_path: "tables/users.csv",
}),
gcp_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.new({
file_path: "data/reference_tables/users.csv",
gcp_bucket_name: "example-data-bucket",
gcp_project_id: "example-gcp-project-12345",
gcp_service_account_email: "example-service@example-gcp-project-12345.iam.gserviceaccount.com",
}),
}),
sync_enabled: true,
sync_enabled: false,
}),
schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({
fields: [
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "name",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({
name: "account_id",
name: "field_1",
type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING,
}),
],
primary_keys: [
"account_id",
"field_1",
],
}),
source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::S3,
table_name: "test_reference_table",
source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::LOCAL_FILE,
table_name: "table_1",
tags: [
"test_tag",
"tag_1",
"tag_2",
],
}),
type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE,
Expand Down
6 changes: 3 additions & 3 deletions features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ Feature: Reference Tables
@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"}}
And body with value {"data": {"attributes": {"file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "123456789000", "aws_bucket_name": "example-data-bucket", "file_path": "reference-tables/users.csv"}, "azure_detail": {"azure_client_id": "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "azure_container_name": "reference-data", "azure_storage_account_name": "examplestorageaccount", "azure_tenant_id": "cccccccc-4444-5555-6666-dddddddddddd", "file_path": "tables/users.csv"}, "gcp_detail": {"file_path": "data/reference_tables/users.csv", "gcp_bucket_name": "example-data-bucket", "gcp_project_id": "example-gcp-project-12345", "gcp_service_account_email": "example-service@example-gcp-project-12345.iam.gserviceaccount.com"}}, "sync_enabled": false}, "schema": {"fields": [{"name": "field_1", "type": "STRING"}], "primary_keys": ["field_1"]}, "source": "LOCAL_FILE", "table_name": "table_1", "tags": ["tag_1", "tag_2"]}, "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"}}
And body with value {"data": {"attributes": {"file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "123456789000", "aws_bucket_name": "example-data-bucket", "file_path": "reference-tables/users.csv"}, "azure_detail": {"azure_client_id": "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "azure_container_name": "reference-data", "azure_storage_account_name": "examplestorageaccount", "azure_tenant_id": "cccccccc-4444-5555-6666-dddddddddddd", "file_path": "tables/users.csv"}, "gcp_detail": {"file_path": "data/reference_tables/users.csv", "gcp_bucket_name": "example-data-bucket", "gcp_project_id": "example-gcp-project-12345", "gcp_service_account_email": "example-service@example-gcp-project-12345.iam.gserviceaccount.com"}}, "sync_enabled": false}, "schema": {"fields": [{"name": "field_1", "type": "STRING"}], "primary_keys": ["field_1"]}, "source": "LOCAL_FILE", "table_name": "table_1", "tags": ["tag_1", "tag_2"]}, "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": ["field_1", "field_2"], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}}
And body with value {"data": {"attributes": {"headers": ["product_id", "product_name", "price"], "part_count": 3, "part_size": 10000000, "table_name": "my_products_table"}, "type": "upload"}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down
2 changes: 0 additions & 2 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4158,9 +4158,7 @@ def overrides
"v2.table_result_v2_data" => "TableResultV2Data",
"v2.table_result_v2_data_attributes" => "TableResultV2DataAttributes",
"v2.table_result_v2_data_attributes_file_metadata" => "TableResultV2DataAttributesFileMetadata",
"v2.table_result_v2_data_attributes_file_metadata_cloud_storage" => "TableResultV2DataAttributesFileMetadataCloudStorage",
"v2.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type" => "TableResultV2DataAttributesFileMetadataCloudStorageErrorType",
"v2.table_result_v2_data_attributes_file_metadata_local_file" => "TableResultV2DataAttributesFileMetadataLocalFile",
"v2.table_result_v2_data_attributes_file_metadata_one_of_access_details" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetails",
"v2.table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail",
"v2.table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail",
Expand Down
16 changes: 13 additions & 3 deletions lib/datadog_api_client/v2/models/layer_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class LayerAttributes
# The date/time when the rotation starts (ISO 8601).
attr_accessor :rotation_start

# The time zone for this layer.
attr_accessor :time_zone

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
Expand All @@ -50,7 +53,8 @@ def self.attribute_map
:'interval' => :'interval',
:'name' => :'name',
:'restrictions' => :'restrictions',
:'rotation_start' => :'rotation_start'
:'rotation_start' => :'rotation_start',
:'time_zone' => :'time_zone'
}
end

Expand All @@ -63,7 +67,8 @@ def self.openapi_types
:'interval' => :'LayerAttributesInterval',
:'name' => :'String',
:'restrictions' => :'Array<TimeRestriction>',
:'rotation_start' => :'Time'
:'rotation_start' => :'Time',
:'time_zone' => :'String'
}
end

Expand Down Expand Up @@ -110,6 +115,10 @@ def initialize(attributes = {})
if attributes.key?(:'rotation_start')
self.rotation_start = attributes[:'rotation_start']
end

if attributes.key?(:'time_zone')
self.time_zone = attributes[:'time_zone']
end
end

# Returns the object in the form of hash, with additionalProperties support.
Expand Down Expand Up @@ -144,14 +153,15 @@ def ==(o)
name == o.name &&
restrictions == o.restrictions &&
rotation_start == o.rotation_start &&
time_zone == o.time_zone &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[effective_date, end_date, interval, name, restrictions, rotation_start, additional_properties].hash
[effective_date, end_date, interval, name, restrictions, rotation_start, time_zone, additional_properties].hash
end
end
end
Loading
Loading