Skip to content

Commit 91c1828

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6845166 of spec repo
1 parent 7ff4b29 commit 91c1828

17 files changed

+595
-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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a Splunk custom destination with a sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
const params: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
enabled: false,
15+
forwardTags: false,
16+
forwarderDestination: {
17+
accessToken: "my-access-token",
18+
endpoint: "https://example.com",
19+
type: "splunk_hec",
20+
sourcetype: "my-sourcetype",
21+
},
22+
name: "Nginx logs",
23+
query: "source:nginx",
24+
},
25+
type: "custom_destination",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.createLogsCustomDestination(params)
32+
.then((data: v2.CustomDestinationResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Create a Splunk custom destination without a sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
const params: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
enabled: false,
15+
forwardTags: false,
16+
forwarderDestination: {
17+
accessToken: "my-access-token",
18+
endpoint: "https://example.com",
19+
type: "splunk_hec",
20+
},
21+
name: "Nginx logs",
22+
query: "source:nginx",
23+
},
24+
type: "custom_destination",
25+
},
26+
},
27+
};
28+
29+
apiInstance
30+
.createLogsCustomDestination(params)
31+
.then((data: v2.CustomDestinationResponse) => {
32+
console.log(
33+
"API called successfully. Returned data: " + JSON.stringify(data)
34+
);
35+
})
36+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a Splunk custom destination with a null sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
const params: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
enabled: false,
15+
forwardTags: false,
16+
forwarderDestination: {
17+
accessToken: "my-access-token",
18+
endpoint: "https://example.com",
19+
type: "splunk_hec",
20+
sourcetype: undefined,
21+
},
22+
name: "Nginx logs",
23+
query: "source:nginx",
24+
},
25+
type: "custom_destination",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.createLogsCustomDestination(params)
32+
.then((data: v2.CustomDestinationResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a Splunk custom destination with an empty string sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
const params: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
enabled: false,
15+
forwardTags: false,
16+
forwarderDestination: {
17+
accessToken: "my-access-token",
18+
endpoint: "https://example.com",
19+
type: "splunk_hec",
20+
sourcetype: "",
21+
},
22+
name: "Nginx logs",
23+
query: "source:nginx",
24+
},
25+
type: "custom_destination",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.createLogsCustomDestination(params)
32+
.then((data: v2.CustomDestinationResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Update a Splunk custom destination's destination preserves the null sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
// there is a valid "custom_destination_splunk_with_null_sourcetype" in the system
11+
const CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID = process.env
12+
.CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID as string;
13+
14+
const params: v2.LogsCustomDestinationsApiUpdateLogsCustomDestinationRequest = {
15+
body: {
16+
data: {
17+
attributes: {
18+
forwarderDestination: {
19+
type: "splunk_hec",
20+
endpoint: "https://updated-example.com",
21+
accessToken: "my-access-token",
22+
},
23+
},
24+
type: "custom_destination",
25+
id: CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID,
26+
},
27+
},
28+
customDestinationId: CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID,
29+
};
30+
31+
apiInstance
32+
.updateLogsCustomDestination(params)
33+
.then((data: v2.CustomDestinationResponse) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Update a Splunk custom destination with a sourcetype returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);
9+
10+
// there is a valid "custom_destination_splunk" in the system
11+
const CUSTOM_DESTINATION_SPLUNK_DATA_ID = process.env
12+
.CUSTOM_DESTINATION_SPLUNK_DATA_ID as string;
13+
14+
const params: v2.LogsCustomDestinationsApiUpdateLogsCustomDestinationRequest = {
15+
body: {
16+
data: {
17+
attributes: {
18+
forwarderDestination: {
19+
type: "splunk_hec",
20+
endpoint: "https://example.com",
21+
accessToken: "my-access-token",
22+
sourcetype: "new-sourcetype",
23+
},
24+
},
25+
type: "custom_destination",
26+
id: CUSTOM_DESTINATION_SPLUNK_DATA_ID,
27+
},
28+
},
29+
customDestinationId: CUSTOM_DESTINATION_SPLUNK_DATA_ID,
30+
};
31+
32+
apiInstance
33+
.updateLogsCustomDestination(params)
34+
.then((data: v2.CustomDestinationResponse) => {
35+
console.log(
36+
"API called successfully. Returned data: " + JSON.stringify(data)
37+
);
38+
})
39+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)