Skip to content

Commit e4a5f88

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6845166 of spec repo
1 parent e69ac55 commit e4a5f88

18 files changed

+704
-36
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 65 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17358,6 +17358,16 @@ components:
1735817358
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
1735917359
example: https://example.com
1736017360
type: string
17361+
sourcetype:
17362+
description: |-
17363+
The Splunk sourcetype for the events sent to this Splunk destination.
17364+
17365+
If absent, the default sourcetype `_json` is used. If set to `null`, the `sourcetype`
17366+
field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string
17367+
value is used as the sourcetype.
17368+
example: my-source
17369+
nullable: true
17370+
type: string
1736117371
type:
1736217372
$ref: "#/components/schemas/CustomDestinationForwardDestinationSplunkType"
1736317373
required:
@@ -17633,6 +17643,16 @@ components:
1763317643
Must have HTTPS scheme and forwarding back to Datadog is not allowed.
1763417644
example: https://example.com
1763517645
type: string
17646+
sourcetype:
17647+
description: |-
17648+
The Splunk sourcetype for the events sent to this Splunk destination.
17649+
17650+
If absent, the default sourcetype `_json` is used. If set to `null`, the `sourcetype`
17651+
field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string
17652+
value is used as the sourcetype.
17653+
example: my-source
17654+
nullable: true
17655+
type: string
1763617656
type:
1763717657
$ref: "#/components/schemas/CustomDestinationResponseForwardDestinationSplunkType"
1763817658
required:
@@ -57909,7 +57929,6 @@ components:
5790957929
- none
5791057930
- false_positive
5791157931
- testing_or_maintenance
57912-
- remediated
5791357932
- investigated_case_opened
5791457933
- true_positive_benign
5791557934
- true_positive_malicious
@@ -57919,7 +57938,6 @@ components:
5791957938
- NONE
5792057939
- FALSE_POSITIVE
5792157940
- TESTING_OR_MAINTENANCE
57922-
- REMEDIATED
5792357941
- INVESTIGATED_CASE_OPENED
5792457942
- TRUE_POSITIVE_BENIGN
5792557943
- TRUE_POSITIVE_MALICIOUS
@@ -102449,8 +102467,6 @@ paths:
102449102467
schema:
102450102468
$ref: "#/components/schemas/SecurityMonitoringSignalResponse"
102451102469
description: OK
102452-
"403":
102453-
$ref: "#/components/responses/NotAuthorizedResponse"
102454102470
"404":
102455102471
$ref: "#/components/responses/NotFoundResponse"
102456102472
"429":
@@ -102488,17 +102504,25 @@ paths:
102488102504
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
102489102505
description: OK
102490102506
"400":
102491-
$ref: "#/components/responses/BadRequestResponse"
102507+
content:
102508+
application/json:
102509+
schema:
102510+
$ref: "#/components/schemas/APIErrorResponse"
102511+
description: Bad Request
102492102512
"403":
102493-
$ref: "#/components/responses/NotAuthorizedResponse"
102513+
content:
102514+
application/json:
102515+
schema:
102516+
$ref: "#/components/schemas/APIErrorResponse"
102517+
description: Forbidden
102494102518
"404":
102495-
$ref: "#/components/responses/NotFoundResponse"
102519+
content:
102520+
application/json:
102521+
schema:
102522+
$ref: "#/components/schemas/APIErrorResponse"
102523+
description: Not Found
102496102524
"429":
102497102525
$ref: "#/components/responses/TooManyRequestsResponse"
102498-
security:
102499-
- apiKeyAuth: []
102500-
appKeyAuth: []
102501-
- AuthZ: []
102502102526
summary: Modify the triage assignee of a security signal
102503102527
tags: ["Security Monitoring"]
102504102528
x-codegen-request-body-name: body
@@ -102528,17 +102552,25 @@ paths:
102528102552
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
102529102553
description: OK
102530102554
"400":
102531-
$ref: "#/components/responses/BadRequestResponse"
102555+
content:
102556+
application/json:
102557+
schema:
102558+
$ref: "#/components/schemas/APIErrorResponse"
102559+
description: Bad Request
102532102560
"403":
102533-
$ref: "#/components/responses/NotAuthorizedResponse"
102561+
content:
102562+
application/json:
102563+
schema:
102564+
$ref: "#/components/schemas/APIErrorResponse"
102565+
description: Forbidden
102534102566
"404":
102535-
$ref: "#/components/responses/NotFoundResponse"
102567+
content:
102568+
application/json:
102569+
schema:
102570+
$ref: "#/components/schemas/APIErrorResponse"
102571+
description: Not Found
102536102572
"429":
102537102573
$ref: "#/components/responses/TooManyRequestsResponse"
102538-
security:
102539-
- apiKeyAuth: []
102540-
appKeyAuth: []
102541-
- AuthZ: []
102542102574
summary: Change the related incidents of a security signal
102543102575
tags: ["Security Monitoring"]
102544102576
x-codegen-request-body-name: body
@@ -102568,17 +102600,25 @@ paths:
102568102600
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
102569102601
description: OK
102570102602
"400":
102571-
$ref: "#/components/responses/BadRequestResponse"
102603+
content:
102604+
application/json:
102605+
schema:
102606+
$ref: "#/components/schemas/APIErrorResponse"
102607+
description: Bad Request
102572102608
"403":
102573-
$ref: "#/components/responses/NotAuthorizedResponse"
102609+
content:
102610+
application/json:
102611+
schema:
102612+
$ref: "#/components/schemas/APIErrorResponse"
102613+
description: Forbidden
102574102614
"404":
102575-
$ref: "#/components/responses/NotFoundResponse"
102615+
content:
102616+
application/json:
102617+
schema:
102618+
$ref: "#/components/schemas/APIErrorResponse"
102619+
description: Not Found
102576102620
"429":
102577102621
$ref: "#/components/responses/TooManyRequestsResponse"
102578-
security:
102579-
- apiKeyAuth: []
102580-
appKeyAuth: []
102581-
- AuthZ: []
102582102622
summary: Change the triage state of a security signal
102583102623
tags: ["Security Monitoring"]
102584102624
x-codegen-request-body-name: body
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)

0 commit comments

Comments
 (0)