Skip to content

Add encryption field to logs archive destination #2369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-23 20:01:37.241080",
"spec_repo_commit": "f985f8bc"
"regenerated": "2025-01-23 20:46:00.158208",
"spec_repo_commit": "2350cf2b"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-23 20:01:37.256108",
"spec_repo_commit": "f985f8bc"
"regenerated": "2025-01-23 20:46:00.172961",
"spec_repo_commit": "2350cf2b"
}
}
}
26 changes: 26 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16762,6 +16762,8 @@ components:
description: The bucket where the archive will be stored.
example: bucket-name
type: string
encryption:
$ref: '#/components/schemas/LogsArchiveEncryptionS3'
integration:
$ref: '#/components/schemas/LogsArchiveIntegrationS3'
path:
Expand All @@ -16783,6 +16785,30 @@ components:
type: string
x-enum-varnames:
- S3
LogsArchiveEncryptionS3:
description: The S3 encryption settings.
properties:
key:
description: An Amazon Resource Name (ARN) used to identify an AWS KMS key.
example: arn:aws:kms:us-east-1:012345678901:key/DatadogIntegrationRoleKms
type: string
type:
$ref: '#/components/schemas/LogsArchiveEncryptionS3Type'
required:
- type
type: object
LogsArchiveEncryptionS3Type:
description: Type of S3 encryption for a destination.
enum:
- NO_OVERRIDE
- SSE_S3
- SSE_KMS
example: SSE_S3
type: string
x-enum-varnames:
- NO_OVERRIDE
- SSE_S3
- SSE_KMS
LogsArchiveIntegrationAzure:
description: The Azure archive's integration destination.
properties:
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7109,6 +7109,20 @@ datadog\_api\_client.v2.model.logs\_archive\_destination\_s3\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.logs\_archive\_encryption\_s3 module
------------------------------------------------------------------

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

datadog\_api\_client.v2.model.logs\_archive\_encryption\_s3\_type module
------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.logs\_archive\_integration\_azure module
----------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def __init__(self, **kwargs):

:param bucket: The bucket where the archive will be stored.
:type bucket: str

:param encryption: The S3 encryption settings.
:type encryption: LogsArchiveEncryptionS3, optional
"""
super().__init__(kwargs)

Expand Down
3 changes: 3 additions & 0 deletions src/datadog_api_client/v2/model/logs_archive_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def __init__(self, **kwargs):

:param bucket: The bucket where the archive will be stored.
:type bucket: str

:param encryption: The S3 encryption settings.
:type encryption: LogsArchiveEncryptionS3, optional
"""
super().__init__(kwargs)

Expand Down
10 changes: 10 additions & 0 deletions src/datadog_api_client/v2/model/logs_archive_destination_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,29 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.logs_archive_encryption_s3 import LogsArchiveEncryptionS3
from datadog_api_client.v2.model.logs_archive_integration_s3 import LogsArchiveIntegrationS3
from datadog_api_client.v2.model.logs_archive_destination_s3_type import LogsArchiveDestinationS3Type


class LogsArchiveDestinationS3(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.logs_archive_encryption_s3 import LogsArchiveEncryptionS3
from datadog_api_client.v2.model.logs_archive_integration_s3 import LogsArchiveIntegrationS3
from datadog_api_client.v2.model.logs_archive_destination_s3_type import LogsArchiveDestinationS3Type

return {
"bucket": (str,),
"encryption": (LogsArchiveEncryptionS3,),
"integration": (LogsArchiveIntegrationS3,),
"path": (str,),
"type": (LogsArchiveDestinationS3Type,),
}

attribute_map = {
"bucket": "bucket",
"encryption": "encryption",
"integration": "integration",
"path": "path",
"type": "type",
Expand All @@ -43,6 +47,7 @@ def __init__(
bucket: str,
integration: LogsArchiveIntegrationS3,
type: LogsArchiveDestinationS3Type,
encryption: Union[LogsArchiveEncryptionS3, UnsetType] = unset,
path: Union[str, UnsetType] = unset,
**kwargs,
):
Expand All @@ -52,6 +57,9 @@ def __init__(
:param bucket: The bucket where the archive will be stored.
:type bucket: str

:param encryption: The S3 encryption settings.
:type encryption: LogsArchiveEncryptionS3, optional

:param integration: The S3 Archive's integration destination.
:type integration: LogsArchiveIntegrationS3

Expand All @@ -61,6 +69,8 @@ def __init__(
:param type: Type of the S3 archive destination.
:type type: LogsArchiveDestinationS3Type
"""
if encryption is not unset:
kwargs["encryption"] = encryption
if path is not unset:
kwargs["path"] = path
super().__init__(kwargs)
Expand Down
49 changes: 49 additions & 0 deletions src/datadog_api_client/v2/model/logs_archive_encryption_s3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.logs_archive_encryption_s3_type import LogsArchiveEncryptionS3Type


class LogsArchiveEncryptionS3(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.logs_archive_encryption_s3_type import LogsArchiveEncryptionS3Type

return {
"key": (str,),
"type": (LogsArchiveEncryptionS3Type,),
}

attribute_map = {
"key": "key",
"type": "type",
}

def __init__(self_, type: LogsArchiveEncryptionS3Type, key: Union[str, UnsetType] = unset, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
def __init__(self_, type: LogsArchiveEncryptionS3Type, key: Union[str, UnsetType] = unset, **kwargs):
def __init__(self, type: LogsArchiveEncryptionS3Type, key: Union[str, UnsetType] = unset, **kwargs):
first parameter of a class function should be self (...read more)

In a class method (that is not a class method nor a static method), the first argument must be self by convention.

Learn More

View in Datadog  Leave us feedback  Documentation

"""
The S3 encryption settings.

:param key: An Amazon Resource Name (ARN) used to identify an AWS KMS key.
:type key: str, optional

:param type: Type of S3 encryption for a destination.
:type type: LogsArchiveEncryptionS3Type
"""
if key is not unset:
kwargs["key"] = key
super().__init__(kwargs)

self_.type = type
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 LogsArchiveEncryptionS3Type(ModelSimple):
"""
Type of S3 encryption for a destination.

:param value: Must be one of ["NO_OVERRIDE", "SSE_S3", "SSE_KMS"].
:type value: str
"""

allowed_values = {
"NO_OVERRIDE",
"SSE_S3",
"SSE_KMS",
}
NO_OVERRIDE: ClassVar["LogsArchiveEncryptionS3Type"]
SSE_S3: ClassVar["LogsArchiveEncryptionS3Type"]
SSE_KMS: ClassVar["LogsArchiveEncryptionS3Type"]

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


LogsArchiveEncryptionS3Type.NO_OVERRIDE = LogsArchiveEncryptionS3Type("NO_OVERRIDE")
LogsArchiveEncryptionS3Type.SSE_S3 = LogsArchiveEncryptionS3Type("SSE_S3")
LogsArchiveEncryptionS3Type.SSE_KMS = LogsArchiveEncryptionS3Type("SSE_KMS")
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 @@ -1227,6 +1227,8 @@
from datadog_api_client.v2.model.logs_archive_destination_gcs_type import LogsArchiveDestinationGCSType
from datadog_api_client.v2.model.logs_archive_destination_s3 import LogsArchiveDestinationS3
from datadog_api_client.v2.model.logs_archive_destination_s3_type import LogsArchiveDestinationS3Type
from datadog_api_client.v2.model.logs_archive_encryption_s3 import LogsArchiveEncryptionS3
from datadog_api_client.v2.model.logs_archive_encryption_s3_type import LogsArchiveEncryptionS3Type
from datadog_api_client.v2.model.logs_archive_integration_azure import LogsArchiveIntegrationAzure
from datadog_api_client.v2.model.logs_archive_integration_gcs import LogsArchiveIntegrationGCS
from datadog_api_client.v2.model.logs_archive_integration_s3 import LogsArchiveIntegrationS3
Expand Down Expand Up @@ -3391,6 +3393,8 @@
"LogsArchiveDestinationGCSType",
"LogsArchiveDestinationS3",
"LogsArchiveDestinationS3Type",
"LogsArchiveEncryptionS3",
"LogsArchiveEncryptionS3Type",
"LogsArchiveIntegrationAzure",
"LogsArchiveIntegrationGCS",
"LogsArchiveIntegrationS3",
Expand Down
Loading