Skip to content
Open
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
28 changes: 28 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49957,10 +49957,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
Expand Down Expand Up @@ -50016,10 +50030,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
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/logs-archives/CreateLogsArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/logs-archives/UpdateLogsArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v2/model/logs_archive_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],),
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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

Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],),
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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

Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions tests/v2/features/logs_archives.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -150,23 +150,23 @@ 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

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding
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

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding
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

Expand Down
Loading