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
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41379,6 +41379,8 @@ components:
LogsArchiveAttributes:
description: The attributes associated with the archive.
properties:
compression_method:
$ref: "#/components/schemas/LogsArchiveAttributesCompressionMethod"
destination:
$ref: "#/components/schemas/LogsArchiveDestination"
include_tags:
Expand Down Expand Up @@ -41416,6 +41418,17 @@ components:
- query
- destination
type: object
LogsArchiveAttributesCompressionMethod:
default: GZIP
description: The type of compression for the archive.
enum:
- GZIP
- ZSTD
example: GZIP
type: string
x-enum-varnames:
- GZIP
- ZSTD
LogsArchiveCreateRequest:
description: The logs archive.
properties:
Expand All @@ -41425,6 +41438,8 @@ components:
LogsArchiveCreateRequestAttributes:
description: The attributes associated with the archive.
properties:
compression_method:
$ref: "#/components/schemas/LogsArchiveAttributesCompressionMethod"
destination:
$ref: "#/components/schemas/LogsArchiveCreateRequestDestination"
include_tags:
Expand Down Expand Up @@ -106036,6 +106051,7 @@ paths:
value:
data:
attributes:
compression_method: GZIP
destination:
container: container-name
storage_account: account-name
Expand Down Expand Up @@ -106175,6 +106191,7 @@ paths:
value:
data:
attributes:
compression_method: GZIP
destination:
container: container-name
storage_account: account-name
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17833,6 +17833,13 @@ datadog\_api\_client.v2.model.logs\_archive\_attributes module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.logs\_archive\_attributes\_compression\_method module
-----------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.logs_archive_attributes_compression_method
:members:
:show-inheritance:

datadog\_api\_client.v2.model.logs\_archive\_create\_request module
-------------------------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions examples/v2/logs-archives/CreateLogsArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archives_api import LogsArchivesApi
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request import LogsArchiveCreateRequest
from datadog_api_client.v2.model.logs_archive_create_request_attributes import LogsArchiveCreateRequestAttributes
from datadog_api_client.v2.model.logs_archive_create_request_definition import LogsArchiveCreateRequestDefinition
Expand All @@ -14,6 +17,7 @@
body = LogsArchiveCreateRequest(
data=LogsArchiveCreateRequestDefinition(
attributes=LogsArchiveCreateRequestAttributes(
compression_method=LogsArchiveAttributesCompressionMethod.GZIP,
destination=LogsArchiveDestinationAzure(
container="container-name",
integration=LogsArchiveIntegrationAzure(
Expand Down
4 changes: 4 additions & 0 deletions examples/v2/logs-archives/UpdateLogsArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archives_api import LogsArchivesApi
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request import LogsArchiveCreateRequest
from datadog_api_client.v2.model.logs_archive_create_request_attributes import LogsArchiveCreateRequestAttributes
from datadog_api_client.v2.model.logs_archive_create_request_definition import LogsArchiveCreateRequestDefinition
Expand All @@ -14,6 +17,7 @@
body = LogsArchiveCreateRequest(
data=LogsArchiveCreateRequestDefinition(
attributes=LogsArchiveCreateRequestAttributes(
compression_method=LogsArchiveAttributesCompressionMethod.GZIP,
destination=LogsArchiveDestinationAzure(
container="container-name",
integration=LogsArchiveIntegrationAzure(
Expand Down
14 changes: 14 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 @@ -15,6 +15,9 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_destination import LogsArchiveDestination
from datadog_api_client.v2.model.logs_archive_state import LogsArchiveState
from datadog_api_client.v2.model.logs_archive_destination_azure import LogsArchiveDestinationAzure
Expand All @@ -25,10 +28,14 @@
class LogsArchiveAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_destination import LogsArchiveDestination
from datadog_api_client.v2.model.logs_archive_state import LogsArchiveState

return {
"compression_method": (LogsArchiveAttributesCompressionMethod,),
"destination": (LogsArchiveDestination,),
"include_tags": (bool,),
"name": (str,),
Expand All @@ -39,6 +46,7 @@ def openapi_types(_):
}

attribute_map = {
"compression_method": "compression_method",
"destination": "destination",
"include_tags": "include_tags",
"name": "name",
Expand All @@ -58,6 +66,7 @@ def __init__(
],
name: str,
query: str,
compression_method: Union[LogsArchiveAttributesCompressionMethod, UnsetType] = unset,
include_tags: Union[bool, UnsetType] = unset,
rehydration_max_scan_size_in_gb: Union[int, none_type, UnsetType] = unset,
rehydration_tags: Union[List[str], UnsetType] = unset,
Expand All @@ -67,6 +76,9 @@ def __init__(
"""
The attributes associated with the archive.

:param compression_method: The type of compression for the archive.
:type compression_method: LogsArchiveAttributesCompressionMethod, optional

:param destination: An archive's destination.
:type destination: LogsArchiveDestination, none_type

Expand All @@ -89,6 +101,8 @@ def __init__(
:param state: The state of the archive.
:type state: LogsArchiveState, optional
"""
if compression_method is not unset:
kwargs["compression_method"] = compression_method
if include_tags is not unset:
kwargs["include_tags"] = include_tags
if rehydration_max_scan_size_in_gb is not unset:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class LogsArchiveAttributesCompressionMethod(ModelSimple):
"""
The type of compression for the archive.

:param value: If omitted defaults to "GZIP". Must be one of ["GZIP", "ZSTD"].
:type value: str
"""

allowed_values = {
"GZIP",
"ZSTD",
}
GZIP: ClassVar["LogsArchiveAttributesCompressionMethod"]
ZSTD: ClassVar["LogsArchiveAttributesCompressionMethod"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


LogsArchiveAttributesCompressionMethod.GZIP = LogsArchiveAttributesCompressionMethod("GZIP")
LogsArchiveAttributesCompressionMethod.ZSTD = LogsArchiveAttributesCompressionMethod("ZSTD")
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request_destination import LogsArchiveCreateRequestDestination
from datadog_api_client.v2.model.logs_archive_destination_azure import LogsArchiveDestinationAzure
from datadog_api_client.v2.model.logs_archive_destination_gcs import LogsArchiveDestinationGCS
Expand All @@ -24,11 +27,15 @@
class LogsArchiveCreateRequestAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request_destination import (
LogsArchiveCreateRequestDestination,
)

return {
"compression_method": (LogsArchiveAttributesCompressionMethod,),
"destination": (LogsArchiveCreateRequestDestination,),
"include_tags": (bool,),
"name": (str,),
Expand All @@ -38,6 +45,7 @@ def openapi_types(_):
}

attribute_map = {
"compression_method": "compression_method",
"destination": "destination",
"include_tags": "include_tags",
"name": "name",
Expand All @@ -56,6 +64,7 @@ def __init__(
],
name: str,
query: str,
compression_method: Union[LogsArchiveAttributesCompressionMethod, UnsetType] = unset,
include_tags: Union[bool, UnsetType] = unset,
rehydration_max_scan_size_in_gb: Union[int, none_type, UnsetType] = unset,
rehydration_tags: Union[List[str], UnsetType] = unset,
Expand All @@ -64,6 +73,9 @@ def __init__(
"""
The attributes associated with the archive.

:param compression_method: The type of compression for the archive.
:type compression_method: LogsArchiveAttributesCompressionMethod, optional

:param destination: An archive's destination.
:type destination: LogsArchiveCreateRequestDestination

Expand All @@ -83,6 +95,8 @@ def __init__(
:param rehydration_tags: An array of tags to add to rehydrated logs from an archive.
:type rehydration_tags: [str], optional
"""
if compression_method is not unset:
kwargs["compression_method"] = compression_method
if include_tags is not unset:
kwargs["include_tags"] = include_tags
if rehydration_max_scan_size_in_gb is not unset:
Expand Down
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3374,6 +3374,9 @@
from datadog_api_client.v2.model.logs_aggregation_function import LogsAggregationFunction
from datadog_api_client.v2.model.logs_archive import LogsArchive
from datadog_api_client.v2.model.logs_archive_attributes import LogsArchiveAttributes
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request import LogsArchiveCreateRequest
from datadog_api_client.v2.model.logs_archive_create_request_attributes import LogsArchiveCreateRequestAttributes
from datadog_api_client.v2.model.logs_archive_create_request_definition import LogsArchiveCreateRequestDefinition
Expand Down Expand Up @@ -10005,6 +10008,7 @@
"LogsAggregationFunction",
"LogsArchive",
"LogsArchiveAttributes",
"LogsArchiveAttributesCompressionMethod",
"LogsArchiveCreateRequest",
"LogsArchiveCreateRequestAttributes",
"LogsArchiveCreateRequestDefinition",
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": {"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, "name": "Nginx Archive", "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": {"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, "name": "Nginx Archive", "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": {"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, "name": "Nginx Archive", "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": {"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, "name": "Nginx Archive", "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": {"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, "name": "Nginx Archive", "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