Skip to content

Commit 49b9f83

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add examples to Reference Tables API documentation, update cloud file and local file metadata (#2924)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent c76392e commit 49b9f83

File tree

48 files changed

+356
-352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+356
-352
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 181 additions & 152 deletions
Large diffs are not rendered by default.

examples/v2/reference-tables/UpdateReferenceTable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"test_tag",
5858
],
5959
),
60-
id="00000000-0000-0000-0000-000000000000",
6160
type=PatchTableRequestDataType.REFERENCE_TABLE,
6261
),
6362
)

src/datadog_api_client/v2/api/reference_tables_api.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ def create_reference_table(
233233
) -> TableResultV2:
234234
"""Create reference table.
235235
236-
Create a new reference table. You can provide data in two ways: 1) Call POST api/v2/reference-tables/upload first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this POST endpoint with the upload_id in file_metadata, OR 2) Provide access_details in file_metadata pointing to a CSV file in cloud storage (Amazon S3, Azure Blob Storage, or GCP Cloud Storage).
236+
Creates a reference table. You can provide data in two ways:
237+
238+
#. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data
239+
(not the file itself) in chunks to each URL in the request body. Finally, call this
240+
POST endpoint with ``upload_id`` in ``file_metadata``.
241+
#. Provide ``access_details`` in ``file_metadata`` pointing to a CSV file in cloud storage.
237242
238243
:type body: CreateTableRequest
239244
:rtype: TableResultV2
@@ -267,7 +272,7 @@ def delete_table(
267272
268273
Delete a reference table by ID
269274
270-
:param id: The ID of the reference table to delete
275+
:param id: Unique identifier of the reference table to delete
271276
:type id: str
272277
:rtype: None
273278
"""
@@ -285,7 +290,7 @@ def get_rows_by_id(
285290
286291
Get reference table rows by their primary key values.
287292
288-
:param id: The ID of the reference table
293+
:param id: Unique identifier of the reference table to get rows from
289294
:type id: str
290295
:param row_id: List of row IDs (primary key values) to retrieve from the reference table.
291296
:type row_id: [str]
@@ -306,7 +311,7 @@ def get_table(
306311
307312
Get a reference table by ID
308313
309-
:param id: The ID of the reference table to retrieve
314+
:param id: Unique identifier of the reference table to retrieve
310315
:type id: str
311316
:rtype: TableResultV2
312317
"""
@@ -333,7 +338,7 @@ def list_tables(
333338
:type page_limit: int, optional
334339
:param page_offset: Number of tables to skip for pagination.
335340
:type page_offset: int, optional
336-
:param sort: Sort field and direction. Use field name for ascending, prefix with "-" for descending.
341+
:param sort: Sort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending.
337342
:type sort: ReferenceTableSortType, optional
338343
:param filter_status: Filter by table status.
339344
:type filter_status: str, optional
@@ -373,7 +378,7 @@ def update_reference_table(
373378
374379
Update a reference table by ID. You can update the table's data, description, and tags. Note: The source type cannot be changed after table creation. For data updates: For existing tables of type `source:LOCAL_FILE`, call POST api/v2/reference-tables/uploads first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this PATCH endpoint with the upload_id in file_metadata. For existing tables with `source:` types of `S3 ``,`` GCS ``, or`` AZURE`, provide updated access_details in file_metadata pointing to a CSV file in the same type of cloud storage.
375380
376-
:param id: The ID of the reference table to update
381+
:param id: Unique identifier of the reference table to update
377382
:type id: str
378383
:type body: PatchTableRequest
379384
:rtype: None

src/datadog_api_client/v2/model/create_table_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def openapi_types(_):
3232

3333
def __init__(self_, data: Union[CreateTableRequestData, UnsetType] = unset, **kwargs):
3434
"""
35-
The definition of ``CreateTableRequest`` object.
35+
Request body for creating a new reference table from a local file or cloud storage.
3636
37-
:param data: The definition of ``CreateTableRequestData`` object.
37+
:param data: The data object containing the table definition.
3838
:type data: CreateTableRequestData, optional
3939
"""
4040
if data is not unset:

src/datadog_api_client/v2/model/create_table_request_data.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,42 @@
1919

2020

2121
class CreateTableRequestData(ModelNormal):
22+
@cached_property
23+
def additional_properties_type(_):
24+
return None
25+
2226
@cached_property
2327
def openapi_types(_):
2428
from datadog_api_client.v2.model.create_table_request_data_attributes import CreateTableRequestDataAttributes
2529
from datadog_api_client.v2.model.create_table_request_data_type import CreateTableRequestDataType
2630

2731
return {
2832
"attributes": (CreateTableRequestDataAttributes,),
29-
"id": (str,),
3033
"type": (CreateTableRequestDataType,),
3134
}
3235

3336
attribute_map = {
3437
"attributes": "attributes",
35-
"id": "id",
3638
"type": "type",
3739
}
3840

3941
def __init__(
4042
self_,
4143
type: CreateTableRequestDataType,
4244
attributes: Union[CreateTableRequestDataAttributes, UnsetType] = unset,
43-
id: Union[str, UnsetType] = unset,
4445
**kwargs,
4546
):
4647
"""
47-
The definition of ``CreateTableRequestData`` object.
48+
The data object containing the table definition.
4849
49-
:param attributes: The definition of ``CreateTableRequestDataAttributes`` object.
50+
:param attributes: Attributes that define the reference table's configuration and properties.
5051
:type attributes: CreateTableRequestDataAttributes, optional
5152
52-
:param id: The ID of the reference table.
53-
:type id: str, optional
54-
5553
:param type: Reference table resource type.
5654
:type type: CreateTableRequestDataType
5755
"""
5856
if attributes is not unset:
5957
kwargs["attributes"] = attributes
60-
if id is not unset:
61-
kwargs["id"] = id
6258
super().__init__(kwargs)
6359

6460
self_.type = type

src/datadog_api_client/v2/model/create_table_request_data_attributes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,24 @@ def __init__(
7474
**kwargs,
7575
):
7676
"""
77-
The definition of ``CreateTableRequestDataAttributes`` object.
77+
Attributes that define the reference table's configuration and properties.
7878
79-
:param description: The description of the reference table.
79+
:param description: Optional text describing the purpose or contents of this reference table.
8080
:type description: str, optional
8181
82-
:param file_metadata: The definition of ``CreateTableRequestDataAttributesFileMetadata`` object.
82+
:param file_metadata: Metadata specifying where and how to access the reference table's data file.
8383
:type file_metadata: CreateTableRequestDataAttributesFileMetadata, optional
8484
85-
:param schema: The definition of ``CreateTableRequestDataAttributesSchema`` object.
85+
:param schema: Schema defining the structure and columns of the reference table.
8686
:type schema: CreateTableRequestDataAttributesSchema
8787
8888
:param source: The source type for creating reference table data. Only these source types can be created through this API.
8989
:type source: ReferenceTableCreateSourceType
9090
91-
:param table_name: The name of the reference table.
91+
:param table_name: Name to identify this reference table.
9292
:type table_name: str
9393
94-
:param tags: The tags of the reference table.
94+
:param tags: Tags for organizing and filtering reference tables.
9595
:type tags: [str], optional
9696
"""
9797
if description is not unset:

src/datadog_api_client/v2/model/create_table_request_data_attributes_file_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
class CreateTableRequestDataAttributesFileMetadata(ModelComposed):
1414
def __init__(self, **kwargs):
1515
"""
16-
The definition of ``CreateTableRequestDataAttributesFileMetadata`` object.
16+
Metadata specifying where and how to access the reference table's data file.
1717
18-
:param access_details: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
18+
:param access_details: Cloud storage access configuration for the reference table data file.
1919
:type access_details: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails
2020
2121
:param sync_enabled: Whether this table is synced automatically.

src/datadog_api_client/v2/model/create_table_request_data_attributes_file_metadata_cloud_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
"""
4848
Cloud storage file metadata for create requests. Both access_details and sync_enabled are required.
4949
50-
:param access_details: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails`` object.
50+
:param access_details: Cloud storage access configuration for the reference table data file.
5151
:type access_details: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails
5252
5353
:param sync_enabled: Whether this table is synced automatically.

src/datadog_api_client/v2/model/create_table_request_data_attributes_file_metadata_one_of_access_details.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def __init__(
6060
**kwargs,
6161
):
6262
"""
63-
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails`` object.
63+
Cloud storage access configuration for the reference table data file.
6464
65-
:param aws_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail`` object.
65+
:param aws_detail: Amazon Web Services S3 storage access configuration.
6666
:type aws_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail, optional
6767
68-
:param azure_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail`` object.
68+
:param azure_detail: Azure Blob Storage access configuration.
6969
:type azure_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail, optional
7070
71-
:param gcp_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail`` object.
71+
:param gcp_detail: Google Cloud Platform storage access configuration.
7272
:type gcp_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail, optional
7373
"""
7474
if aws_detail is not unset:

src/datadog_api_client/v2/model/create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def openapi_types(_):
2727

2828
def __init__(self_, aws_account_id: str, aws_bucket_name: str, file_path: str, **kwargs):
2929
"""
30-
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail`` object.
30+
Amazon Web Services S3 storage access configuration.
3131
32-
:param aws_account_id: The ID of the AWS account.
32+
:param aws_account_id: AWS account ID where the S3 bucket is located.
3333
:type aws_account_id: str
3434
35-
:param aws_bucket_name: The name of the Amazon S3 bucket.
35+
:param aws_bucket_name: S3 bucket containing the CSV file.
3636
:type aws_bucket_name: str
3737
3838
:param file_path: The relative file path from the S3 bucket root to the CSV file.

0 commit comments

Comments
 (0)