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
131 changes: 79 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 @@ -51089,32 +51076,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 +51131,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 @@ -73470,6 +73445,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
43 changes: 29 additions & 14 deletions examples/v2/reference-tables/CreateReferenceTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataCloudStorage;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchema;
import com.datadog.api.client.v2.model.CreateTableRequestDataAttributesSchemaFieldsItems;
import com.datadog.api.client.v2.model.CreateTableRequestDataType;
Expand All @@ -30,32 +32,45 @@ public static void main(String[] args) {
new CreateTableRequestData()
.attributes(
new CreateTableRequestDataAttributes()
.description("this is a cloud table generated via a cloud bucket sync")
.fileMetadata(
new CreateTableRequestDataAttributesFileMetadata(
new CreateTableRequestDataAttributesFileMetadataCloudStorage()
.accessDetails(
new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails()
.awsDetail(
new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail()
.awsAccountId("test-account-id")
.awsBucketName("test-bucket")
.filePath("test_rt.csv")))
.syncEnabled(true)))
.awsAccountId("123456789000")
.awsBucketName("example-data-bucket")
.filePath("reference-tables/users.csv"))
.azureDetail(
new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail()
.azureClientId(
"aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb")
.azureContainerName("reference-data")
.azureStorageAccountName(
"examplestorageaccount")
.azureTenantId(
"cccccccc-4444-5555-6666-dddddddddddd")
.filePath("tables/users.csv"))
.gcpDetail(
new CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail()
.filePath("data/reference_tables/users.csv")
.gcpBucketName("example-data-bucket")
.gcpProjectId("example-gcp-project-12345")
.gcpServiceAccountEmail(
"example-service@example-gcp-project-12345.iam.gserviceaccount.com")))
.syncEnabled(false)))
.schema(
new CreateTableRequestDataAttributesSchema()
.fields(
Arrays.asList(
Collections.singletonList(
new CreateTableRequestDataAttributesSchemaFieldsItems()
.name("name")
.type(ReferenceTableSchemaFieldType.STRING),
new CreateTableRequestDataAttributesSchemaFieldsItems()
.name("account_id")
.name("field_1")
.type(ReferenceTableSchemaFieldType.STRING)))
.primaryKeys(Collections.singletonList("account_id")))
.source(ReferenceTableCreateSourceType.S3)
.tableName("test_reference_table")
.tags(Collections.singletonList("test_tag")))
.primaryKeys(Collections.singletonList("field_1")))
.source(ReferenceTableCreateSourceType.LOCAL_FILE)
.tableName("table_1")
.tags(Arrays.asList("tag_1", "tag_2")))
.type(CreateTableRequestDataType.REFERENCE_TABLE));

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ public TableResultV2DataAttributes fileMetadata(
/**
* Metadata specifying where and how to access the reference table's data file.
*
* <p>For cloud storage tables (S3/GCS/Azure): - sync_enabled and access_details will always be
* present - error fields (error_message, error_row_count, error_type) are present only when
* errors occur
*
* <p>For local file tables: - error fields (error_message, error_row_count) are present only when
* errors occur - sync_enabled, access_details are never present
*
* @return fileMetadata
*/
@jakarta.annotation.Nullable
Expand Down
Loading
Loading