Skip to content

Commit b890226

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6845166 of spec repo
1 parent 8bd2dcb commit b890226

15 files changed

+673
-28
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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Create a Splunk custom destination with a sourcetype returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
4+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest;
5+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes;
6+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestDefinition;
7+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
8+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunk;
9+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunkType;
10+
use datadog_api_client::datadogV2::model::CustomDestinationType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body =
15+
CustomDestinationCreateRequest::new().data(CustomDestinationCreateRequestDefinition::new(
16+
CustomDestinationCreateRequestAttributes::new(
17+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationSplunk(
18+
Box::new(
19+
CustomDestinationForwardDestinationSplunk::new(
20+
"my-access-token".to_string(),
21+
"https://example.com".to_string(),
22+
CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
23+
)
24+
.sourcetype(Some("my-sourcetype".to_string())),
25+
),
26+
),
27+
"Nginx logs".to_string(),
28+
)
29+
.enabled(false)
30+
.forward_tags(false)
31+
.query("source:nginx".to_string()),
32+
CustomDestinationType::CUSTOM_DESTINATION,
33+
));
34+
let configuration = datadog::Configuration::new();
35+
let api = LogsCustomDestinationsAPI::with_config(configuration);
36+
let resp = api.create_logs_custom_destination(body).await;
37+
if let Ok(value) = resp {
38+
println!("{:#?}", value);
39+
} else {
40+
println!("{:#?}", resp.unwrap_err());
41+
}
42+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Create a Splunk custom destination without a sourcetype returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
4+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest;
5+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes;
6+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestDefinition;
7+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
8+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunk;
9+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunkType;
10+
use datadog_api_client::datadogV2::model::CustomDestinationType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body =
15+
CustomDestinationCreateRequest::new().data(CustomDestinationCreateRequestDefinition::new(
16+
CustomDestinationCreateRequestAttributes::new(
17+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationSplunk(
18+
Box::new(CustomDestinationForwardDestinationSplunk::new(
19+
"my-access-token".to_string(),
20+
"https://example.com".to_string(),
21+
CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
22+
)),
23+
),
24+
"Nginx logs".to_string(),
25+
)
26+
.enabled(false)
27+
.forward_tags(false)
28+
.query("source:nginx".to_string()),
29+
CustomDestinationType::CUSTOM_DESTINATION,
30+
));
31+
let configuration = datadog::Configuration::new();
32+
let api = LogsCustomDestinationsAPI::with_config(configuration);
33+
let resp = api.create_logs_custom_destination(body).await;
34+
if let Ok(value) = resp {
35+
println!("{:#?}", value);
36+
} else {
37+
println!("{:#?}", resp.unwrap_err());
38+
}
39+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Create a Splunk custom destination with a null sourcetype returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
4+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest;
5+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes;
6+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestDefinition;
7+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
8+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunk;
9+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunkType;
10+
use datadog_api_client::datadogV2::model::CustomDestinationType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body =
15+
CustomDestinationCreateRequest::new().data(CustomDestinationCreateRequestDefinition::new(
16+
CustomDestinationCreateRequestAttributes::new(
17+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationSplunk(
18+
Box::new(
19+
CustomDestinationForwardDestinationSplunk::new(
20+
"my-access-token".to_string(),
21+
"https://example.com".to_string(),
22+
CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
23+
)
24+
.sourcetype(None),
25+
),
26+
),
27+
"Nginx logs".to_string(),
28+
)
29+
.enabled(false)
30+
.forward_tags(false)
31+
.query("source:nginx".to_string()),
32+
CustomDestinationType::CUSTOM_DESTINATION,
33+
));
34+
let configuration = datadog::Configuration::new();
35+
let api = LogsCustomDestinationsAPI::with_config(configuration);
36+
let resp = api.create_logs_custom_destination(body).await;
37+
if let Ok(value) = resp {
38+
println!("{:#?}", value);
39+
} else {
40+
println!("{:#?}", resp.unwrap_err());
41+
}
42+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Create a Splunk custom destination with an empty string sourcetype returns "OK"
2+
// response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
5+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest;
6+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes;
7+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestDefinition;
8+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
9+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunk;
10+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunkType;
11+
use datadog_api_client::datadogV2::model::CustomDestinationType;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body =
16+
CustomDestinationCreateRequest::new().data(CustomDestinationCreateRequestDefinition::new(
17+
CustomDestinationCreateRequestAttributes::new(
18+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationSplunk(
19+
Box::new(
20+
CustomDestinationForwardDestinationSplunk::new(
21+
"my-access-token".to_string(),
22+
"https://example.com".to_string(),
23+
CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
24+
)
25+
.sourcetype(Some("".to_string())),
26+
),
27+
),
28+
"Nginx logs".to_string(),
29+
)
30+
.enabled(false)
31+
.forward_tags(false)
32+
.query("source:nginx".to_string()),
33+
CustomDestinationType::CUSTOM_DESTINATION,
34+
));
35+
let configuration = datadog::Configuration::new();
36+
let api = LogsCustomDestinationsAPI::with_config(configuration);
37+
let resp = api.create_logs_custom_destination(body).await;
38+
if let Ok(value) = resp {
39+
println!("{:#?}", value);
40+
} else {
41+
println!("{:#?}", resp.unwrap_err());
42+
}
43+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Update a Splunk custom destination's destination preserves the null sourcetype
2+
// returns "OK" response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
5+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
6+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunk;
7+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationSplunkType;
8+
use datadog_api_client::datadogV2::model::CustomDestinationType;
9+
use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequest;
10+
use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequestAttributes;
11+
use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequestDefinition;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
// there is a valid "custom_destination_splunk_with_null_sourcetype" in the system
16+
let custom_destination_splunk_with_null_sourcetype_data_id =
17+
std::env::var("CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID").unwrap();
18+
let body = CustomDestinationUpdateRequest::new().data(
19+
CustomDestinationUpdateRequestDefinition::new(
20+
custom_destination_splunk_with_null_sourcetype_data_id.clone(),
21+
CustomDestinationType::CUSTOM_DESTINATION,
22+
)
23+
.attributes(
24+
CustomDestinationUpdateRequestAttributes::new().forwarder_destination(
25+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationSplunk(
26+
Box::new(CustomDestinationForwardDestinationSplunk::new(
27+
"my-access-token".to_string(),
28+
"https://updated-example.com".to_string(),
29+
CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
30+
)),
31+
),
32+
),
33+
),
34+
);
35+
let configuration = datadog::Configuration::new();
36+
let api = LogsCustomDestinationsAPI::with_config(configuration);
37+
let resp = api
38+
.update_logs_custom_destination(
39+
custom_destination_splunk_with_null_sourcetype_data_id.clone(),
40+
body,
41+
)
42+
.await;
43+
if let Ok(value) = resp {
44+
println!("{:#?}", value);
45+
} else {
46+
println!("{:#?}", resp.unwrap_err());
47+
}
48+
}

0 commit comments

Comments
 (0)