diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a02697caa7..8672c66d61 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51361,10 +51361,24 @@ components: If it is set to "false", the tags will be deleted when the logs are sent to the archive. example: false type: boolean + lookup_attributes: + description: An array of attributes to use as lookup keys for the archive. + example: ["trace_id", "user_id"] + items: + description: A lookup attribute name. + type: string + type: array name: description: The archive name. example: Nginx Archive type: string + partitioning_attributes: + description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + example: ["service", "status"] + items: + description: A partition attribute name. + type: string + type: array query: description: The archive query/filter. Logs matching this query are included in the archive. example: source:nginx @@ -51420,10 +51434,24 @@ components: If it is set to "false", the tags will be deleted when the logs are sent to the archive. example: false type: boolean + lookup_attributes: + description: An array of attributes to use as lookup keys for the archive. + example: ["trace_id", "user_id"] + items: + description: A lookup attribute name. + type: string + type: array name: description: The archive name. example: Nginx Archive type: string + partitioning_attributes: + description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + example: ["service", "status"] + items: + description: A partition attribute name. + type: string + type: array query: description: The archive query/filter. Logs matching this query are included in the archive. example: source:nginx diff --git a/examples/v2/logs-archives/CreateLogsArchive.py b/examples/v2/logs-archives/CreateLogsArchive.py index 47de53abf7..b8edbabbb1 100644 --- a/examples/v2/logs-archives/CreateLogsArchive.py +++ b/examples/v2/logs-archives/CreateLogsArchive.py @@ -28,7 +28,15 @@ type=LogsArchiveDestinationAzureType.AZURE, ), include_tags=False, + lookup_attributes=[ + "trace_id", + "user_id", + ], name="Nginx Archive", + partitioning_attributes=[ + "service", + "status", + ], query="source:nginx", rehydration_max_scan_size_in_gb=100, rehydration_tags=[ diff --git a/examples/v2/logs-archives/UpdateLogsArchive.py b/examples/v2/logs-archives/UpdateLogsArchive.py index febc6efc24..bbc63459d1 100644 --- a/examples/v2/logs-archives/UpdateLogsArchive.py +++ b/examples/v2/logs-archives/UpdateLogsArchive.py @@ -28,7 +28,15 @@ type=LogsArchiveDestinationAzureType.AZURE, ), include_tags=False, + lookup_attributes=[ + "trace_id", + "user_id", + ], name="Nginx Archive", + partitioning_attributes=[ + "service", + "status", + ], query="source:nginx", rehydration_max_scan_size_in_gb=100, rehydration_tags=[ diff --git a/src/datadog_api_client/v2/model/logs_archive_attributes.py b/src/datadog_api_client/v2/model/logs_archive_attributes.py index c92e560c3c..e462de1566 100644 --- a/src/datadog_api_client/v2/model/logs_archive_attributes.py +++ b/src/datadog_api_client/v2/model/logs_archive_attributes.py @@ -38,7 +38,9 @@ def openapi_types(_): "compression_method": (LogsArchiveAttributesCompressionMethod,), "destination": (LogsArchiveDestination,), "include_tags": (bool,), + "lookup_attributes": ([str],), "name": (str,), + "partitioning_attributes": ([str],), "query": (str,), "rehydration_max_scan_size_in_gb": (int, none_type), "rehydration_tags": ([str],), @@ -49,7 +51,9 @@ def openapi_types(_): "compression_method": "compression_method", "destination": "destination", "include_tags": "include_tags", + "lookup_attributes": "lookup_attributes", "name": "name", + "partitioning_attributes": "partitioning_attributes", "query": "query", "rehydration_max_scan_size_in_gb": "rehydration_max_scan_size_in_gb", "rehydration_tags": "rehydration_tags", @@ -68,6 +72,8 @@ def __init__( query: str, compression_method: Union[LogsArchiveAttributesCompressionMethod, UnsetType] = unset, include_tags: Union[bool, UnsetType] = unset, + lookup_attributes: Union[List[str], UnsetType] = unset, + partitioning_attributes: Union[List[str], UnsetType] = unset, rehydration_max_scan_size_in_gb: Union[int, none_type, UnsetType] = unset, rehydration_tags: Union[List[str], UnsetType] = unset, state: Union[LogsArchiveState, UnsetType] = unset, @@ -86,9 +92,15 @@ def __init__( If it is set to "false", the tags will be deleted when the logs are sent to the archive. :type include_tags: bool, optional + :param lookup_attributes: An array of attributes to use as lookup keys for the archive. + :type lookup_attributes: [str], optional + :param name: The archive name. :type name: str + :param partitioning_attributes: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + :type partitioning_attributes: [str], optional + :param query: The archive query/filter. Logs matching this query are included in the archive. :type query: str @@ -105,6 +117,10 @@ def __init__( kwargs["compression_method"] = compression_method if include_tags is not unset: kwargs["include_tags"] = include_tags + if lookup_attributes is not unset: + kwargs["lookup_attributes"] = lookup_attributes + if partitioning_attributes is not unset: + kwargs["partitioning_attributes"] = partitioning_attributes if rehydration_max_scan_size_in_gb is not unset: kwargs["rehydration_max_scan_size_in_gb"] = rehydration_max_scan_size_in_gb if rehydration_tags is not unset: diff --git a/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py b/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py index 55fc7cf446..974e3eafe3 100644 --- a/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py +++ b/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py @@ -38,7 +38,9 @@ def openapi_types(_): "compression_method": (LogsArchiveAttributesCompressionMethod,), "destination": (LogsArchiveCreateRequestDestination,), "include_tags": (bool,), + "lookup_attributes": ([str],), "name": (str,), + "partitioning_attributes": ([str],), "query": (str,), "rehydration_max_scan_size_in_gb": (int, none_type), "rehydration_tags": ([str],), @@ -48,7 +50,9 @@ def openapi_types(_): "compression_method": "compression_method", "destination": "destination", "include_tags": "include_tags", + "lookup_attributes": "lookup_attributes", "name": "name", + "partitioning_attributes": "partitioning_attributes", "query": "query", "rehydration_max_scan_size_in_gb": "rehydration_max_scan_size_in_gb", "rehydration_tags": "rehydration_tags", @@ -66,6 +70,8 @@ def __init__( query: str, compression_method: Union[LogsArchiveAttributesCompressionMethod, UnsetType] = unset, include_tags: Union[bool, UnsetType] = unset, + lookup_attributes: Union[List[str], UnsetType] = unset, + partitioning_attributes: Union[List[str], UnsetType] = unset, rehydration_max_scan_size_in_gb: Union[int, none_type, UnsetType] = unset, rehydration_tags: Union[List[str], UnsetType] = unset, **kwargs, @@ -83,9 +89,15 @@ def __init__( If it is set to "false", the tags will be deleted when the logs are sent to the archive. :type include_tags: bool, optional + :param lookup_attributes: An array of attributes to use as lookup keys for the archive. + :type lookup_attributes: [str], optional + :param name: The archive name. :type name: str + :param partitioning_attributes: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + :type partitioning_attributes: [str], optional + :param query: The archive query/filter. Logs matching this query are included in the archive. :type query: str @@ -99,6 +111,10 @@ def __init__( kwargs["compression_method"] = compression_method if include_tags is not unset: kwargs["include_tags"] = include_tags + if lookup_attributes is not unset: + kwargs["lookup_attributes"] = lookup_attributes + if partitioning_attributes is not unset: + kwargs["partitioning_attributes"] = partitioning_attributes if rehydration_max_scan_size_in_gb is not unset: kwargs["rehydration_max_scan_size_in_gb"] = rehydration_max_scan_size_in_gb if rehydration_tags is not unset: diff --git a/tests/v2/features/logs_archives.feature b/tests/v2/features/logs_archives.feature index 4b58769df5..752be13634 100644 --- a/tests/v2/features/logs_archives.feature +++ b/tests/v2/features/logs_archives.feature @@ -12,14 +12,14 @@ Feature: Logs Archives @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "Bad Request" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "OK" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK @@ -150,7 +150,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Bad Request" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @@ -158,7 +158,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Not found" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 404 Not found @@ -166,7 +166,7 @@ Feature: Logs Archives Scenario: Update an archive returns "OK" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK