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
333 changes: 181 additions & 152 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/v2/reference-tables/UpdateReferenceTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"test_tag",
],
),
id="00000000-0000-0000-0000-000000000000",
type=PatchTableRequestDataType.REFERENCE_TABLE,
),
)
Expand Down
17 changes: 11 additions & 6 deletions src/datadog_api_client/v2/api/reference_tables_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ def create_reference_table(
) -> TableResultV2:
"""Create reference table.

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).
Creates a reference table. You can provide data in two ways:

#. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data
(not the file itself) in chunks to each URL in the request body. Finally, call this
POST endpoint with ``upload_id`` in ``file_metadata``.
#. Provide ``access_details`` in ``file_metadata`` pointing to a CSV file in cloud storage.

:type body: CreateTableRequest
:rtype: TableResultV2
Expand Down Expand Up @@ -267,7 +272,7 @@ def delete_table(

Delete a reference table by ID

:param id: The ID of the reference table to delete
:param id: Unique identifier of the reference table to delete
:type id: str
:rtype: None
"""
Expand All @@ -285,7 +290,7 @@ def get_rows_by_id(

Get reference table rows by their primary key values.

:param id: The ID of the reference table
:param id: Unique identifier of the reference table to get rows from
:type id: str
:param row_id: List of row IDs (primary key values) to retrieve from the reference table.
:type row_id: [str]
Expand All @@ -306,7 +311,7 @@ def get_table(

Get a reference table by ID

:param id: The ID of the reference table to retrieve
:param id: Unique identifier of the reference table to retrieve
:type id: str
:rtype: TableResultV2
"""
Expand All @@ -333,7 +338,7 @@ def list_tables(
:type page_limit: int, optional
:param page_offset: Number of tables to skip for pagination.
:type page_offset: int, optional
:param sort: Sort field and direction. Use field name for ascending, prefix with "-" for descending.
:param sort: Sort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending.
:type sort: ReferenceTableSortType, optional
:param filter_status: Filter by table status.
:type filter_status: str, optional
Expand Down Expand Up @@ -373,7 +378,7 @@ def update_reference_table(

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.

:param id: The ID of the reference table to update
:param id: Unique identifier of the reference table to update
:type id: str
:type body: PatchTableRequest
:rtype: None
Expand Down
4 changes: 2 additions & 2 deletions src/datadog_api_client/v2/model/create_table_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def openapi_types(_):

def __init__(self_, data: Union[CreateTableRequestData, UnsetType] = unset, **kwargs):
"""
The definition of ``CreateTableRequest`` object.
Request body for creating a new reference table from a local file or cloud storage.

:param data: The definition of ``CreateTableRequestData`` object.
:param data: The data object containing the table definition.
:type data: CreateTableRequestData, optional
"""
if data is not unset:
Expand Down
16 changes: 6 additions & 10 deletions src/datadog_api_client/v2/model/create_table_request_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,42 @@


class CreateTableRequestData(ModelNormal):
@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.create_table_request_data_attributes import CreateTableRequestDataAttributes
from datadog_api_client.v2.model.create_table_request_data_type import CreateTableRequestDataType

return {
"attributes": (CreateTableRequestDataAttributes,),
"id": (str,),
"type": (CreateTableRequestDataType,),
}

attribute_map = {
"attributes": "attributes",
"id": "id",
"type": "type",
}

def __init__(
self_,
type: CreateTableRequestDataType,
attributes: Union[CreateTableRequestDataAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
**kwargs,
):
"""
The definition of ``CreateTableRequestData`` object.
The data object containing the table definition.

:param attributes: The definition of ``CreateTableRequestDataAttributes`` object.
:param attributes: Attributes that define the reference table's configuration and properties.
:type attributes: CreateTableRequestDataAttributes, optional

:param id: The ID of the reference table.
:type id: str, optional

:param type: Reference table resource type.
:type type: CreateTableRequestDataType
"""
if attributes is not unset:
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
super().__init__(kwargs)

self_.type = type
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ def __init__(
**kwargs,
):
"""
The definition of ``CreateTableRequestDataAttributes`` object.
Attributes that define the reference table's configuration and properties.

:param description: The description of the reference table.
:param description: Optional text describing the purpose or contents of this reference table.
:type description: str, optional

:param file_metadata: The definition of ``CreateTableRequestDataAttributesFileMetadata`` object.
:param file_metadata: Metadata specifying where and how to access the reference table's data file.
:type file_metadata: CreateTableRequestDataAttributesFileMetadata, optional

:param schema: The definition of ``CreateTableRequestDataAttributesSchema`` object.
:param schema: Schema defining the structure and columns of the reference table.
:type schema: CreateTableRequestDataAttributesSchema

:param source: The source type for creating reference table data. Only these source types can be created through this API.
:type source: ReferenceTableCreateSourceType

:param table_name: The name of the reference table.
:param table_name: Name to identify this reference table.
:type table_name: str

:param tags: The tags of the reference table.
:param tags: Tags for organizing and filtering reference tables.
:type tags: [str], optional
"""
if description is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class CreateTableRequestDataAttributesFileMetadata(ModelComposed):
def __init__(self, **kwargs):
"""
The definition of ``CreateTableRequestDataAttributesFileMetadata`` object.
Metadata specifying where and how to access the reference table's data file.

:param access_details: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
:param access_details: Cloud storage access configuration for the reference table data file.
:type access_details: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails

:param sync_enabled: Whether this table is synced automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
"""
Cloud storage file metadata for create requests. Both access_details and sync_enabled are required.

:param access_details: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails`` object.
:param access_details: Cloud storage access configuration for the reference table data file.
:type access_details: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails

:param sync_enabled: Whether this table is synced automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ def __init__(
**kwargs,
):
"""
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails`` object.
Cloud storage access configuration for the reference table data file.

:param aws_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail`` object.
:param aws_detail: Amazon Web Services S3 storage access configuration.
:type aws_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail, optional

:param azure_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail`` object.
:param azure_detail: Azure Blob Storage access configuration.
:type azure_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail, optional

:param gcp_detail: The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail`` object.
:param gcp_detail: Google Cloud Platform storage access configuration.
:type gcp_detail: CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail, optional
"""
if aws_detail is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def openapi_types(_):

def __init__(self_, aws_account_id: str, aws_bucket_name: str, file_path: str, **kwargs):
"""
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail`` object.
Amazon Web Services S3 storage access configuration.

:param aws_account_id: The ID of the AWS account.
:param aws_account_id: AWS account ID where the S3 bucket is located.
:type aws_account_id: str

:param aws_bucket_name: The name of the Amazon S3 bucket.
:param aws_bucket_name: S3 bucket containing the CSV file.
:type aws_bucket_name: str

:param file_path: The relative file path from the S3 bucket root to the CSV file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ def __init__(
**kwargs,
):
"""
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail`` object.
Azure Blob Storage access configuration.

:param azure_client_id: The Azure client ID.
:param azure_client_id: Azure service principal (application) client ID with permissions to read from the container.
:type azure_client_id: str

:param azure_container_name: The name of the Azure container.
:param azure_container_name: Azure Blob Storage container containing the CSV file.
:type azure_container_name: str

:param azure_storage_account_name: The name of the Azure storage account.
:param azure_storage_account_name: Azure storage account where the container is located.
:type azure_storage_account_name: str

:param azure_tenant_id: The ID of the Azure tenant.
:param azure_tenant_id: Azure Active Directory tenant ID.
:type azure_tenant_id: str

:param file_path: The relative file path from the Azure container root to the CSV file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def __init__(
self_, file_path: str, gcp_bucket_name: str, gcp_project_id: str, gcp_service_account_email: str, **kwargs
):
"""
The definition of ``CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail`` object.
Google Cloud Platform storage access configuration.

:param file_path: The relative file path from the GCS bucket root to the CSV file.
:type file_path: str

:param gcp_bucket_name: The name of the GCP bucket.
:param gcp_bucket_name: GCP bucket containing the CSV file.
:type gcp_bucket_name: str

:param gcp_project_id: The ID of the GCP project.
:param gcp_project_id: GCP project ID where the bucket is located.
:type gcp_project_id: str

:param gcp_service_account_email: The email of the GCP service account.
:param gcp_service_account_email: Service account email with read permissions for the GCS bucket.
:type gcp_service_account_email: str
"""
super().__init__(kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def __init__(
self_, fields: List[CreateTableRequestDataAttributesSchemaFieldsItems], primary_keys: List[str], **kwargs
):
"""
The definition of ``CreateTableRequestDataAttributesSchema`` object.
Schema defining the structure and columns of the reference table.

:param fields: The ``schema`` ``fields``.
:param fields: The schema fields.
:type fields: [CreateTableRequestDataAttributesSchemaFieldsItems]

:param primary_keys: List of field names that serve as primary keys for the table. Only one primary key is supported, and it is used as an ID to retrieve rows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def openapi_types(_):

def __init__(self_, name: str, type: ReferenceTableSchemaFieldType, **kwargs):
"""
The definition of ``CreateTableRequestDataAttributesSchemaFieldsItems`` object.
A single field (column) in the reference table schema to be created.

:param name: The field name.
:type name: str
Expand Down
4 changes: 2 additions & 2 deletions src/datadog_api_client/v2/model/create_upload_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def openapi_types(_):

def __init__(self_, data: Union[CreateUploadRequestData, UnsetType] = unset, **kwargs):
"""
The definition of ``CreateUploadRequest`` object.
Request to create an upload for a file to be ingested into a reference table.

:param data: The definition of ``CreateUploadRequestData`` object.
:param data: Request data for creating an upload for a file to be ingested into a reference table.
:type data: CreateUploadRequestData, optional
"""
if data is not unset:
Expand Down
16 changes: 6 additions & 10 deletions src/datadog_api_client/v2/model/create_upload_request_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,42 @@


class CreateUploadRequestData(ModelNormal):
@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.create_upload_request_data_attributes import CreateUploadRequestDataAttributes
from datadog_api_client.v2.model.create_upload_request_data_type import CreateUploadRequestDataType

return {
"attributes": (CreateUploadRequestDataAttributes,),
"id": (str,),
"type": (CreateUploadRequestDataType,),
}

attribute_map = {
"attributes": "attributes",
"id": "id",
"type": "type",
}

def __init__(
self_,
type: CreateUploadRequestDataType,
attributes: Union[CreateUploadRequestDataAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
**kwargs,
):
"""
The definition of ``CreateUploadRequestData`` object.
Request data for creating an upload for a file to be ingested into a reference table.

:param attributes: The definition of ``CreateUploadRequestDataAttributes`` object.
:param attributes: Upload configuration specifying how data is uploaded by the user, and properties of the table to associate the upload with.
:type attributes: CreateUploadRequestDataAttributes, optional

:param id: The ID of the upload.
:type id: str, optional

:param type: Upload resource type.
:type type: CreateUploadRequestDataType
"""
if attributes is not unset:
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
super().__init__(kwargs)

self_.type = type
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ def openapi_types(_):

def __init__(self_, headers: List[str], part_count: int, part_size: int, table_name: str, **kwargs):
"""
The definition of ``CreateUploadRequestDataAttributes`` object.
Upload configuration specifying how data is uploaded by the user, and properties of the table to associate the upload with.

:param headers: The headers of the file to upload.
:param headers: The CSV file headers that define the schema fields, provided in the same order as the columns in the uploaded file.
:type headers: [str]

:param part_count: The number of parts in the upload.
:param part_count: Number of parts to split the file into for multipart upload.
:type part_count: int

:param part_size: The size of each part in the upload in bytes. For multipart uploads (part_count > 1), all parts except the last one must be at least 5,000,000 bytes. For single-part uploads (part_count = 1), any size is allowed.
:param part_size: The size of each part in the upload in bytes. All parts except the last one must be at least 5,000,000 bytes.
:type part_size: int

:param table_name: The name of the reference table.
:param table_name: Name of the table to associate with this upload.
:type table_name: str
"""
super().__init__(kwargs)
Expand Down
4 changes: 2 additions & 2 deletions src/datadog_api_client/v2/model/create_upload_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def openapi_types(_):

def __init__(self_, data: Union[CreateUploadResponseData, UnsetType] = unset, **kwargs):
"""
The definition of ``CreateUploadResponse`` object.
Information about the upload created containing the upload ID and pre-signed URLs to PUT chunks of the CSV file to.

:param data: The definition of ``CreateUploadResponseData`` object.
:param data: Upload ID and attributes of the created upload.
:type data: CreateUploadResponseData, optional
"""
if data is not unset:
Expand Down
Loading
Loading