Skip to content

Public api support for google security operations destination #2687

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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-07-08 19:08:06.138597",
"spec_repo_commit": "7b042e12"
"regenerated": "2025-07-09 08:34:45.470841",
"spec_repo_commit": "7331abb4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-07-08 19:08:06.154349",
"spec_repo_commit": "7b042e12"
"regenerated": "2025-07-09 08:34:45.486657",
"spec_repo_commit": "7331abb4"
}
}
}
150 changes: 150 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10668,6 +10668,7 @@ components:
- $ref: '#/components/schemas/CustomDestinationForwardDestinationSplunk'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationElasticsearch'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinel'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperations'
CustomDestinationForwardDestinationElasticsearch:
description: The Elasticsearch destination.
properties:
Expand Down Expand Up @@ -10725,6 +10726,42 @@ components:
type: string
x-enum-varnames:
- ELASTICSEARCH
CustomDestinationForwardDestinationGoogleSecurityOperations:
description: The Google Security Operations destination.
properties:
auth:
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuth'
customer_id:
description: The customer ID of the Google Security Operations account.
example: 123-456-7890
type: string
namespace:
description: The namespace of the Google Security Operations account.
example: google-security-operations-namespace
type: string
regional_endpoint:
description: The `CustomDestinationForwardDestinationGoogleSecurityOperations`
`regional_endpoint`.
example: https://malachiteingestion-pa.googleapis.com
type: string
type:
$ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperationsType'
required:
- type
- customer_id
- regional_endpoint
- namespace
- auth
type: object
CustomDestinationForwardDestinationGoogleSecurityOperationsType:
default: google_security_operations
description: Type of the Google Security Operations destination.
enum:
- google_security_operations
example: google_security_operations
type: string
x-enum-varnames:
- GOOGLE_SECURITY_OPERATIONS
CustomDestinationForwardDestinationHttp:
description: The HTTP destination.
properties:
Expand Down Expand Up @@ -10826,6 +10863,55 @@ components:
type: string
x-enum-varnames:
- SPLUNK_HEC
CustomDestinationGoogleSecurityOperationsDestinationAuth:
description: Google Security Operations destination authentication.
properties:
client_email:
description: The Google Security Operations client email.
example: [email protected]
type: string
client_id:
description: The Google Security Operations client ID. This field is not
returned by the API.
example: def123456
type: string
writeOnly: true
private_key:
description: The Google Security Operations private key. This field is not
returned by the API.
example: '-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\n-----END
PRIVATE KEY-----\n'
type: string
writeOnly: true
private_key_id:
description: The Google Security Operations private key ID. This field is
not returned by the API.
example: abc12345678
type: string
writeOnly: true
project_id:
description: Google Security Operations project ID.
example: gcp-project
type: string
type:
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuthType'
required:
- type
- project_id
- private_key_id
- client_email
- client_id
- private_key
type: object
CustomDestinationGoogleSecurityOperationsDestinationAuthType:
default: gcp_private_key
description: Type of the Google Security Operations destination authentication.
enum:
- gcp_private_key
example: gcp_private_key
type: string
x-enum-varnames:
- GCP_PRIVATE_KEY
CustomDestinationHttpDestinationAuth:
description: Authentication method of the HTTP requests.
oneOf:
Expand Down Expand Up @@ -10971,6 +11057,7 @@ components:
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationSplunk'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationElasticsearch'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinel'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationGoogleSecurityOperations'
CustomDestinationResponseForwardDestinationElasticsearch:
description: The Elasticsearch destination.
properties:
Expand Down Expand Up @@ -11028,6 +11115,42 @@ components:
type: string
x-enum-varnames:
- ELASTICSEARCH
CustomDestinationResponseForwardDestinationGoogleSecurityOperations:
description: The Google Security Operations destination.
properties:
auth:
$ref: '#/components/schemas/CustomDestinationResponseGoogleSecurityOperationsDestinationAuth'
customer_id:
description: The customer ID of the Google Security Operations account.
example: 123-456-7890
type: string
namespace:
description: The namespace of the Google Security Operations account.
example: google-security-operations-namespace
type: string
regional_endpoint:
description: The `CustomDestinationResponseForwardDestinationGoogleSecurityOperations`
`regional_endpoint`.
example: https://malachiteingestion-pa.googleapis.com
type: string
type:
$ref: '#/components/schemas/CustomDestinationResponseForwardDestinationGoogleSecurityOperationsType'
required:
- type
- customer_id
- regional_endpoint
- namespace
- auth
type: object
CustomDestinationResponseForwardDestinationGoogleSecurityOperationsType:
default: google_security_operations
description: Type of the Google Security Operations destination.
enum:
- google_security_operations
example: google_security_operations
type: string
x-enum-varnames:
- GOOGLE_SECURITY_OPERATIONS
CustomDestinationResponseForwardDestinationHttp:
description: The HTTP destination.
properties:
Expand Down Expand Up @@ -11122,6 +11245,33 @@ components:
type: string
x-enum-varnames:
- SPLUNK_HEC
CustomDestinationResponseGoogleSecurityOperationsDestinationAuth:
description: Google Security Operations destination authentication.
properties:
client_email:
description: The Google Security Operations client email.
example: [email protected]
type: string
project_id:
description: Google Security Operations project ID.
example: gcp-project
type: string
type:
$ref: '#/components/schemas/CustomDestinationResponseGoogleSecurityOperationsDestinationAuthType'
required:
- type
- project_id
- client_email
type: object
CustomDestinationResponseGoogleSecurityOperationsDestinationAuthType:
default: gcp_private_key
description: Type of the Google Security Operations destination authentication.
enum:
- gcp_private_key
example: gcp_private_key
type: string
x-enum-varnames:
- GCP_PRIVATE_KEY
CustomDestinationResponseHttpDestinationAuth:
description: Authentication method of the HTTP requests.
oneOf:
Expand Down
56 changes: 56 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4211,6 +4211,20 @@ datadog\_api\_client.v2.model.custom\_destination\_forward\_destination\_elastic
:members:
:show-inheritance:

datadog\_api\_client.v2.model.custom\_destination\_forward\_destination\_google\_security\_operations module
------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_forward\_destination\_google\_security\_operations\_type module
------------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_forward\_destination\_http module
------------------------------------------------------------------------------------

Expand Down Expand Up @@ -4253,6 +4267,20 @@ datadog\_api\_client.v2.model.custom\_destination\_forward\_destination\_splunk\
:members:
:show-inheritance:

datadog\_api\_client.v2.model.custom\_destination\_google\_security\_operations\_destination\_auth module
---------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_google\_security\_operations\_destination\_auth\_type module
---------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_http\_destination\_auth module
---------------------------------------------------------------------------------

Expand Down Expand Up @@ -4337,6 +4365,20 @@ datadog\_api\_client.v2.model.custom\_destination\_response\_forward\_destinatio
:members:
:show-inheritance:

datadog\_api\_client.v2.model.custom\_destination\_response\_forward\_destination\_google\_security\_operations module
----------------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_response\_forward\_destination\_google\_security\_operations\_type module
----------------------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_response\_forward\_destination\_http module
----------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -4379,6 +4421,20 @@ datadog\_api\_client.v2.model.custom\_destination\_response\_forward\_destinatio
:members:
:show-inheritance:

datadog\_api\_client.v2.model.custom\_destination\_response\_google\_security\_operations\_destination\_auth module
-------------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_response\_google\_security\_operations\_destination\_auth\_type module
-------------------------------------------------------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.custom\_destination\_response\_http\_destination\_auth module
-------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""
Create a Google Security Operations custom destination returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
from datadog_api_client.v2.model.custom_destination_attribute_tags_restriction_list_type import (
CustomDestinationAttributeTagsRestrictionListType,
)
from datadog_api_client.v2.model.custom_destination_create_request import CustomDestinationCreateRequest
from datadog_api_client.v2.model.custom_destination_create_request_attributes import (
CustomDestinationCreateRequestAttributes,
)
from datadog_api_client.v2.model.custom_destination_create_request_definition import (
CustomDestinationCreateRequestDefinition,
)
from datadog_api_client.v2.model.custom_destination_forward_destination_google_security_operations import (
CustomDestinationForwardDestinationGoogleSecurityOperations,
)
from datadog_api_client.v2.model.custom_destination_forward_destination_google_security_operations_type import (
CustomDestinationForwardDestinationGoogleSecurityOperationsType,
)
from datadog_api_client.v2.model.custom_destination_google_security_operations_destination_auth import (
CustomDestinationGoogleSecurityOperationsDestinationAuth,
)
from datadog_api_client.v2.model.custom_destination_google_security_operations_destination_auth_type import (
CustomDestinationGoogleSecurityOperationsDestinationAuthType,
)
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType

body = CustomDestinationCreateRequest(
data=CustomDestinationCreateRequestDefinition(
attributes=CustomDestinationCreateRequestAttributes(
enabled=False,
forward_tags=False,
forward_tags_restriction_list=[
"datacenter",
"host",
],
forward_tags_restriction_list_type=CustomDestinationAttributeTagsRestrictionListType.ALLOW_LIST,
forwarder_destination=CustomDestinationForwardDestinationGoogleSecurityOperations(
type=CustomDestinationForwardDestinationGoogleSecurityOperationsType.GOOGLE_SECURITY_OPERATIONS,
customer_id="123-456-7890",
regional_endpoint="https://malachiteingestion-pa.googleapis.com",
namespace="google-security-operations-namespace",
auth=CustomDestinationGoogleSecurityOperationsDestinationAuth(
type=CustomDestinationGoogleSecurityOperationsDestinationAuthType.GCP_PRIVATE_KEY,
project_id="gcp-project",
private_key_id="abc12345678",
client_email="[email protected]",
client_id="def123456",
private_key="-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\n-----END PRIVATE KEY-----\n",
),
),
name="Nginx logs",
query="source:nginx",
),
type=CustomDestinationType.CUSTOM_DESTINATION,
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = LogsCustomDestinationsApi(api_client)
response = api_instance.create_logs_custom_destination(body=body)

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
from datadog_api_client.v2.model.custom_destination_forward_destination_microsoft_sentinel import (
CustomDestinationForwardDestinationMicrosoftSentinel,
)
from datadog_api_client.v2.model.custom_destination_forward_destination_google_security_operations import (
CustomDestinationForwardDestinationGoogleSecurityOperations,
)


class CustomDestinationCreateRequestAttributes(ModelNormal):
Expand Down Expand Up @@ -77,6 +80,7 @@ def __init__(
CustomDestinationForwardDestinationSplunk,
CustomDestinationForwardDestinationElasticsearch,
CustomDestinationForwardDestinationMicrosoftSentinel,
CustomDestinationForwardDestinationGoogleSecurityOperations,
],
name: str,
enabled: Union[bool, UnsetType] = unset,
Expand Down
Loading