Skip to content

Commit 3f5322b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 89aa4b5 of spec repo
1 parent 8c994f5 commit 3f5322b

File tree

36 files changed

+1140
-4
lines changed

36 files changed

+1140
-4
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17412,6 +17412,16 @@ components:
1741217412
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
1741317413
example: https://example.com
1741417414
type: string
17415+
sourcetype:
17416+
description: |-
17417+
The Splunk sourcetype for the events sent to this Splunk destination.
17418+
17419+
If absent, the default sourcetype `_json` is used. If set to `null`, the `sourcetype`
17420+
field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string
17421+
value is used as the sourcetype.
17422+
example: my-source
17423+
nullable: true
17424+
type: string
1741517425
type:
1741617426
$ref: "#/components/schemas/CustomDestinationForwardDestinationSplunkType"
1741717427
required:
@@ -17687,6 +17697,16 @@ components:
1768717697
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
1768817698
example: https://example.com
1768917699
type: string
17700+
sourcetype:
17701+
description: |-
17702+
The Splunk sourcetype for the events sent to this Splunk destination.
17703+
17704+
If absent, the default sourcetype `_json` is used. If set to `null`, the `sourcetype`
17705+
field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string
17706+
value is used as the sourcetype.
17707+
example: my-source
17708+
nullable: true
17709+
type: string
1769017710
type:
1769117711
$ref: "#/components/schemas/CustomDestinationResponseForwardDestinationSplunkType"
1769217712
required:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
Create a Splunk custom destination with a sourcetype returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
7+
from datadog_api_client.v2.model.custom_destination_create_request import CustomDestinationCreateRequest
8+
from datadog_api_client.v2.model.custom_destination_create_request_attributes import (
9+
CustomDestinationCreateRequestAttributes,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_create_request_definition import (
12+
CustomDestinationCreateRequestDefinition,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
15+
CustomDestinationForwardDestinationSplunk,
16+
)
17+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
18+
CustomDestinationForwardDestinationSplunkType,
19+
)
20+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
21+
22+
body = CustomDestinationCreateRequest(
23+
data=CustomDestinationCreateRequestDefinition(
24+
attributes=CustomDestinationCreateRequestAttributes(
25+
enabled=False,
26+
forward_tags=False,
27+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
28+
access_token="my-access-token",
29+
endpoint="https://example.com",
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
sourcetype="my-sourcetype",
32+
),
33+
name="Nginx logs",
34+
query="source:nginx",
35+
),
36+
type=CustomDestinationType.CUSTOM_DESTINATION,
37+
),
38+
)
39+
40+
configuration = Configuration()
41+
with ApiClient(configuration) as api_client:
42+
api_instance = LogsCustomDestinationsApi(api_client)
43+
response = api_instance.create_logs_custom_destination(body=body)
44+
45+
print(response)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
Create a Splunk custom destination without a sourcetype returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
7+
from datadog_api_client.v2.model.custom_destination_create_request import CustomDestinationCreateRequest
8+
from datadog_api_client.v2.model.custom_destination_create_request_attributes import (
9+
CustomDestinationCreateRequestAttributes,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_create_request_definition import (
12+
CustomDestinationCreateRequestDefinition,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
15+
CustomDestinationForwardDestinationSplunk,
16+
)
17+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
18+
CustomDestinationForwardDestinationSplunkType,
19+
)
20+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
21+
22+
body = CustomDestinationCreateRequest(
23+
data=CustomDestinationCreateRequestDefinition(
24+
attributes=CustomDestinationCreateRequestAttributes(
25+
enabled=False,
26+
forward_tags=False,
27+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
28+
access_token="my-access-token",
29+
endpoint="https://example.com",
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
),
32+
name="Nginx logs",
33+
query="source:nginx",
34+
),
35+
type=CustomDestinationType.CUSTOM_DESTINATION,
36+
),
37+
)
38+
39+
configuration = Configuration()
40+
with ApiClient(configuration) as api_client:
41+
api_instance = LogsCustomDestinationsApi(api_client)
42+
response = api_instance.create_logs_custom_destination(body=body)
43+
44+
print(response)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
Create a Splunk custom destination with a null sourcetype returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
7+
from datadog_api_client.v2.model.custom_destination_create_request import CustomDestinationCreateRequest
8+
from datadog_api_client.v2.model.custom_destination_create_request_attributes import (
9+
CustomDestinationCreateRequestAttributes,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_create_request_definition import (
12+
CustomDestinationCreateRequestDefinition,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
15+
CustomDestinationForwardDestinationSplunk,
16+
)
17+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
18+
CustomDestinationForwardDestinationSplunkType,
19+
)
20+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
21+
22+
body = CustomDestinationCreateRequest(
23+
data=CustomDestinationCreateRequestDefinition(
24+
attributes=CustomDestinationCreateRequestAttributes(
25+
enabled=False,
26+
forward_tags=False,
27+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
28+
access_token="my-access-token",
29+
endpoint="https://example.com",
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
sourcetype=None,
32+
),
33+
name="Nginx logs",
34+
query="source:nginx",
35+
),
36+
type=CustomDestinationType.CUSTOM_DESTINATION,
37+
),
38+
)
39+
40+
configuration = Configuration()
41+
with ApiClient(configuration) as api_client:
42+
api_instance = LogsCustomDestinationsApi(api_client)
43+
response = api_instance.create_logs_custom_destination(body=body)
44+
45+
print(response)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
Create a Splunk custom destination with an empty string sourcetype returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
7+
from datadog_api_client.v2.model.custom_destination_create_request import CustomDestinationCreateRequest
8+
from datadog_api_client.v2.model.custom_destination_create_request_attributes import (
9+
CustomDestinationCreateRequestAttributes,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_create_request_definition import (
12+
CustomDestinationCreateRequestDefinition,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
15+
CustomDestinationForwardDestinationSplunk,
16+
)
17+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
18+
CustomDestinationForwardDestinationSplunkType,
19+
)
20+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
21+
22+
body = CustomDestinationCreateRequest(
23+
data=CustomDestinationCreateRequestDefinition(
24+
attributes=CustomDestinationCreateRequestAttributes(
25+
enabled=False,
26+
forward_tags=False,
27+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
28+
access_token="my-access-token",
29+
endpoint="https://example.com",
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
sourcetype="",
32+
),
33+
name="Nginx logs",
34+
query="source:nginx",
35+
),
36+
type=CustomDestinationType.CUSTOM_DESTINATION,
37+
),
38+
)
39+
40+
configuration = Configuration()
41+
with ApiClient(configuration) as api_client:
42+
api_instance = LogsCustomDestinationsApi(api_client)
43+
response = api_instance.create_logs_custom_destination(body=body)
44+
45+
print(response)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""
2+
Update a Splunk custom destination's destination preserves the null sourcetype returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
8+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
9+
CustomDestinationForwardDestinationSplunk,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
12+
CustomDestinationForwardDestinationSplunkType,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
15+
from datadog_api_client.v2.model.custom_destination_update_request import CustomDestinationUpdateRequest
16+
from datadog_api_client.v2.model.custom_destination_update_request_attributes import (
17+
CustomDestinationUpdateRequestAttributes,
18+
)
19+
from datadog_api_client.v2.model.custom_destination_update_request_definition import (
20+
CustomDestinationUpdateRequestDefinition,
21+
)
22+
23+
# there is a valid "custom_destination_splunk_with_null_sourcetype" in the system
24+
CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID = environ[
25+
"CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID"
26+
]
27+
28+
body = CustomDestinationUpdateRequest(
29+
data=CustomDestinationUpdateRequestDefinition(
30+
attributes=CustomDestinationUpdateRequestAttributes(
31+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
32+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
33+
endpoint="https://updated-example.com",
34+
access_token="my-access-token",
35+
),
36+
),
37+
type=CustomDestinationType.CUSTOM_DESTINATION,
38+
id=CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID,
39+
),
40+
)
41+
42+
configuration = Configuration()
43+
with ApiClient(configuration) as api_client:
44+
api_instance = LogsCustomDestinationsApi(api_client)
45+
response = api_instance.update_logs_custom_destination(
46+
custom_destination_id=CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID, body=body
47+
)
48+
49+
print(response)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""
2+
Update a Splunk custom destination with a sourcetype returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
8+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
9+
CustomDestinationForwardDestinationSplunk,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
12+
CustomDestinationForwardDestinationSplunkType,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
15+
from datadog_api_client.v2.model.custom_destination_update_request import CustomDestinationUpdateRequest
16+
from datadog_api_client.v2.model.custom_destination_update_request_attributes import (
17+
CustomDestinationUpdateRequestAttributes,
18+
)
19+
from datadog_api_client.v2.model.custom_destination_update_request_definition import (
20+
CustomDestinationUpdateRequestDefinition,
21+
)
22+
23+
# there is a valid "custom_destination_splunk" in the system
24+
CUSTOM_DESTINATION_SPLUNK_DATA_ID = environ["CUSTOM_DESTINATION_SPLUNK_DATA_ID"]
25+
26+
body = CustomDestinationUpdateRequest(
27+
data=CustomDestinationUpdateRequestDefinition(
28+
attributes=CustomDestinationUpdateRequestAttributes(
29+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
endpoint="https://example.com",
32+
access_token="my-access-token",
33+
sourcetype="new-sourcetype",
34+
),
35+
),
36+
type=CustomDestinationType.CUSTOM_DESTINATION,
37+
id=CUSTOM_DESTINATION_SPLUNK_DATA_ID,
38+
),
39+
)
40+
41+
configuration = Configuration()
42+
with ApiClient(configuration) as api_client:
43+
api_instance = LogsCustomDestinationsApi(api_client)
44+
response = api_instance.update_logs_custom_destination(
45+
custom_destination_id=CUSTOM_DESTINATION_SPLUNK_DATA_ID, body=body
46+
)
47+
48+
print(response)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""
2+
Update a Splunk custom destination with a null sourcetype returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
8+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk import (
9+
CustomDestinationForwardDestinationSplunk,
10+
)
11+
from datadog_api_client.v2.model.custom_destination_forward_destination_splunk_type import (
12+
CustomDestinationForwardDestinationSplunkType,
13+
)
14+
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
15+
from datadog_api_client.v2.model.custom_destination_update_request import CustomDestinationUpdateRequest
16+
from datadog_api_client.v2.model.custom_destination_update_request_attributes import (
17+
CustomDestinationUpdateRequestAttributes,
18+
)
19+
from datadog_api_client.v2.model.custom_destination_update_request_definition import (
20+
CustomDestinationUpdateRequestDefinition,
21+
)
22+
23+
# there is a valid "custom_destination_splunk_with_sourcetype" in the system
24+
CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID = environ["CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID"]
25+
26+
body = CustomDestinationUpdateRequest(
27+
data=CustomDestinationUpdateRequestDefinition(
28+
attributes=CustomDestinationUpdateRequestAttributes(
29+
forwarder_destination=CustomDestinationForwardDestinationSplunk(
30+
type=CustomDestinationForwardDestinationSplunkType.SPLUNK_HEC,
31+
endpoint="https://example.com",
32+
access_token="my-access-token",
33+
sourcetype=None,
34+
),
35+
),
36+
type=CustomDestinationType.CUSTOM_DESTINATION,
37+
id=CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID,
38+
),
39+
)
40+
41+
configuration = Configuration()
42+
with ApiClient(configuration) as api_client:
43+
api_instance = LogsCustomDestinationsApi(api_client)
44+
response = api_instance.update_logs_custom_destination(
45+
custom_destination_id=CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID, body=body
46+
)
47+
48+
print(response)

0 commit comments

Comments
 (0)