diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d854a39bb60d..be7bf771e30e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4527,6 +4527,10 @@ components: - ip_match - "!ip_match" - capture_data + - exists + - "!exists" + - equals + - "!equals" example: "match_regex" type: string x-enum-varnames: @@ -4541,6 +4545,10 @@ components: - IP_MATCH - NOT_IP_MATCH - CAPTURE_DATA + - EXISTS + - NOT_EXISTS + - EQUALS + - NOT_EQUALS ApplicationSecurityWafCustomRuleConditionOptions: description: Options for the operator of this condition. properties: @@ -4581,6 +4589,8 @@ components: description: "Regex to use with the condition. Only used with match_regex and !match_regex operator." example: "path.*" type: string + type: + $ref: "#/components/schemas/ApplicationSecurityWafCustomRuleConditionParametersType" value: description: |- Store the captured value in the specified tag name. Only used with the capture_data operator. @@ -4589,6 +4599,22 @@ components: required: - inputs type: object + ApplicationSecurityWafCustomRuleConditionParametersType: + description: The type of the value to compare against. Only used with the equals and !equals operator. + enum: + - boolean + - signed + - unsigned + - float + - string + example: "string" + type: string + x-enum-varnames: + - BOOLEAN + - SIGNED + - UNSIGNED + - FLOAT + - STRING ApplicationSecurityWafCustomRuleCreateAttributes: description: "Create a new WAF custom rule." properties: @@ -18216,6 +18242,16 @@ components: Must have HTTPS scheme and forwarding back to Datadog is not allowed. example: https://example.com type: string + sourcetype: + description: |- + The Splunk sourcetype for the events sent to this Splunk destination. + + If absent, the default sourcetype `_json` is used. If set to null, the `sourcetype` + field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string + value is used as the sourcetype. + example: my-source + nullable: true + type: string type: $ref: "#/components/schemas/CustomDestinationForwardDestinationSplunkType" required: @@ -18491,6 +18527,16 @@ components: Must have HTTPS scheme and forwarding back to Datadog is not allowed. example: https://example.com type: string + sourcetype: + description: |- + The Splunk sourcetype for the events sent to this Splunk destination. + + If absent, the default sourcetype `_json` is used. If set to null, the `sourcetype` + field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string + value is used as the sourcetype. + example: my-source + nullable: true + type: string type: $ref: "#/components/schemas/CustomDestinationResponseForwardDestinationSplunkType" required: diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..47253f50af87 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:47.455Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..919ef621b442 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":null,"type":"splunk_hec"},"name":"Nginx + logs","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d328c779-9b3b-41c7-a952-20a7446eb7d1","attributes":{"name":"Nginx + logs","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":null},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/d328c779-9b3b-41c7-a952-20a7446eb7d1 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..a1c69fc5518f --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:49.008Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..b883cff2b3ad --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":"my-sourcetype","type":"splunk_hec"},"name":"Nginx + logs","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"429e154f-5cf5-41ce-ae15-4bc41563f46f","attributes":{"name":"Nginx + logs","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":"my-sourcetype"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/429e154f-5cf5-41ce-ae15-4bc41563f46f + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..da14a342ca60 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:50.210Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..2fe3a77f7fc7 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-empty-string-sourcetype-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:50 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":"","type":"splunk_hec"},"name":"Nginx + logs","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"cb6c24f4-f420-42dd-bc86-ce51e03f7968","attributes":{"name":"Nginx + logs","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":""},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:50 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/cb6c24f4-f420-42dd-bc86-ce51e03f7968 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..fd52717727a4 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:51.766Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..7ce4d9103ff8 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-with-an-invalid-sourcetype-returns-Bad-Request-response.yml @@ -0,0 +1,28 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":123,"type":"splunk_hec"},"name":"Nginx + logs","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"errors":["Invalid custom destination configuration","Sourcetype must + be a string or null"]} + + ' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..d66033d53046 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:52.120Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..d84fd24ebc75 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Create-a-Splunk-custom-destination-without-a-sourcetype-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:52 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","type":"splunk_hec"},"name":"Nginx + logs","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c475e180-758a-4503-a2ab-3ff1779c738a","attributes":{"name":"Nginx + logs","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:52 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/c475e180-758a-4503-a2ab-3ff1779c738a + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..81e7c7387581 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:55.981Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..7531265cbd7b --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-attributes-preserves-the-absent-sourcetype-returns-OK-response.yml @@ -0,0 +1,69 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:55 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","type":"splunk_hec"},"name":"Test-Update_a_Splunk_custom_destination_s_attributes_preserves_the_absent_sourcetype_returns_OK_response-1774455835","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9ac57fd5-857f-4082-badc-463ecd1e990d","attributes":{"name":"Test-Update_a_Splunk_custom_destination_s_attributes_preserves_the_absent_sourcetype_returns_OK_response-1774455835","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:55 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Nginx logs (Updated)"},"id":"9ac57fd5-857f-4082-badc-463ecd1e990d","type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/9ac57fd5-857f-4082-badc-463ecd1e990d + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9ac57fd5-857f-4082-badc-463ecd1e990d","attributes":{"name":"Nginx + logs (Updated)","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:55 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/9ac57fd5-857f-4082-badc-463ecd1e990d + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..1bb65534b86a --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:59.087Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..b718350dfa55 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-null-sourcetype-returns-OK-response.yml @@ -0,0 +1,68 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":null,"type":"splunk_hec"},"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_null_sourcetype_returns_OK_response-1774455839","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1cf9102b-169d-4a5c-a82b-aa5b3a12d6c5","attributes":{"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_null_sourcetype_returns_OK_response-1774455839","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":null},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://updated-example.com","type":"splunk_hec"}},"id":"1cf9102b-169d-4a5c-a82b-aa5b3a12d6c5","type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/1cf9102b-169d-4a5c-a82b-aa5b3a12d6c5 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1cf9102b-169d-4a5c-a82b-aa5b3a12d6c5","attributes":{"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_null_sourcetype_returns_OK_response-1774455839","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://updated-example.com","type":"splunk_hec","sourcetype":null},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:59 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/1cf9102b-169d-4a5c-a82b-aa5b3a12d6c5 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..788849b08477 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:24:00.500Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..f2fe06b48018 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-s-destination-preserves-the-sourcetype-returns-OK-response.yml @@ -0,0 +1,68 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:24:00 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":"my-sourcetype","type":"splunk_hec"},"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_sourcetype_returns_OK_response-1774455840","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fa416048-c8e1-4b5a-a3e1-b6c2538d5903","attributes":{"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_sourcetype_returns_OK_response-1774455840","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":"my-sourcetype"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:24:00 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://updated-example.com","type":"splunk_hec"}},"id":"fa416048-c8e1-4b5a-a3e1-b6c2538d5903","type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/fa416048-c8e1-4b5a-a3e1-b6c2538d5903 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fa416048-c8e1-4b5a-a3e1-b6c2538d5903","attributes":{"name":"Test-Update_a_Splunk_custom_destination_s_destination_preserves_the_sourcetype_returns_OK_response-1774455840","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://updated-example.com","type":"splunk_hec","sourcetype":"my-sourcetype"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:24:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/fa416048-c8e1-4b5a-a3e1-b6c2538d5903 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..43ba7b8a91f3 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:53.183Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..86b38d59206e --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-null-sourcetype-returns-OK-response.yml @@ -0,0 +1,68 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":"my-sourcetype","type":"splunk_hec"},"name":"Test-Update_a_Splunk_custom_destination_with_a_null_sourcetype_returns_OK_response-1774455833","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f718e9ba-6676-46f9-ae62-1e63b0348dbc","attributes":{"name":"Test-Update_a_Splunk_custom_destination_with_a_null_sourcetype_returns_OK_response-1774455833","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":"my-sourcetype"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":null,"type":"splunk_hec"}},"id":"f718e9ba-6676-46f9-ae62-1e63b0348dbc","type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/f718e9ba-6676-46f9-ae62-1e63b0348dbc + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f718e9ba-6676-46f9-ae62-1e63b0348dbc","attributes":{"name":"Test-Update_a_Splunk_custom_destination_with_a_null_sourcetype_returns_OK_response-1774455833","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":null},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:53 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/f718e9ba-6676-46f9-ae62-1e63b0348dbc + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen new file mode 100644 index 000000000000..a2f5a72828ed --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-25T16:23:54.709Z \ No newline at end of file diff --git a/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml new file mode 100644 index 000000000000..ffe9d4cc5e53 --- /dev/null +++ b/cassettes/features/v2/logs_custom_destinations/Update-a-Splunk-custom-destination-with-a-sourcetype-returns-OK-response.yml @@ -0,0 +1,68 @@ +http_interactions: +- recorded_at: Wed, 25 Mar 2026 16:23:54 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","type":"splunk_hec"},"name":"Test-Update_a_Splunk_custom_destination_with_a_sourcetype_returns_OK_response-1774455834","query":"source:nginx"},"type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"12f30686-f946-4eb1-8988-643d55ad0cb9","attributes":{"name":"Test-Update_a_Splunk_custom_destination_with_a_sourcetype_returns_OK_response-1774455834","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:54 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"forwarder_destination":{"access_token":"my-access-token","endpoint":"https://example.com","sourcetype":"new-sourcetype","type":"splunk_hec"}},"id":"12f30686-f946-4eb1-8988-643d55ad0cb9","type":"custom_destination"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/12f30686-f946-4eb1-8988-643d55ad0cb9 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"12f30686-f946-4eb1-8988-643d55ad0cb9","attributes":{"name":"Test-Update_a_Splunk_custom_destination_with_a_sourcetype_returns_OK_response-1774455834","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","type":"splunk_hec","sourcetype":"new-sourcetype"},"forward_tags_restriction_list_type":"ALLOW_LIST","forward_tags_restriction_list":[],"forward_tags":false},"type":"custom_destination"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 25 Mar 2026 16:23:54 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/12f30686-f946-4eb1-8988-643d55ad0cb9 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/application-security/CreateApplicationSecurityWafCustomRule.rb b/examples/v2/application-security/CreateApplicationSecurityWafCustomRule.rb index bc100948139a..45f02c1cf443 100644 --- a/examples/v2/application-security/CreateApplicationSecurityWafCustomRule.rb +++ b/examples/v2/application-security/CreateApplicationSecurityWafCustomRule.rb @@ -31,6 +31,7 @@ min_length: 0, }), regex: "path.*", + type: DatadogAPIClient::V2::ApplicationSecurityWafCustomRuleConditionParametersType::STRING, value: "custom_tag", }), }), diff --git a/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_140188544.rb b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_140188544.rb new file mode 100644 index 000000000000..e99b7fa20244 --- /dev/null +++ b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_140188544.rb @@ -0,0 +1,23 @@ +# Create a Splunk custom destination with a sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({ + enabled: false, + forward_tags: false, + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + access_token: "my-access-token", + endpoint: "https://example.com", + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + sourcetype: "my-sourcetype", + }), + name: "Nginx logs", + query: "source:nginx", + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + }), +}) +p api_instance.create_logs_custom_destination(body) diff --git a/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1718754520.rb b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1718754520.rb new file mode 100644 index 000000000000..5d82302ab6c5 --- /dev/null +++ b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1718754520.rb @@ -0,0 +1,22 @@ +# Create a Splunk custom destination without a sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({ + enabled: false, + forward_tags: false, + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + access_token: "my-access-token", + endpoint: "https://example.com", + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + }), + name: "Nginx logs", + query: "source:nginx", + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + }), +}) +p api_instance.create_logs_custom_destination(body) diff --git a/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_2534546779.rb b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_2534546779.rb new file mode 100644 index 000000000000..7cc9e2b3873b --- /dev/null +++ b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_2534546779.rb @@ -0,0 +1,23 @@ +# Create a Splunk custom destination with a null sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({ + enabled: false, + forward_tags: false, + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + access_token: "my-access-token", + endpoint: "https://example.com", + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + sourcetype: nil, + }), + name: "Nginx logs", + query: "source:nginx", + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + }), +}) +p api_instance.create_logs_custom_destination(body) diff --git a/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_3120242932.rb b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_3120242932.rb new file mode 100644 index 000000000000..19ea5d2d19c2 --- /dev/null +++ b/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_3120242932.rb @@ -0,0 +1,23 @@ +# Create a Splunk custom destination with an empty string sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({ + enabled: false, + forward_tags: false, + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + access_token: "my-access-token", + endpoint: "https://example.com", + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + sourcetype: "", + }), + name: "Nginx logs", + query: "source:nginx", + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + }), +}) +p api_instance.create_logs_custom_destination(body) diff --git a/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2034509257.rb b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2034509257.rb new file mode 100644 index 000000000000..c67a5652895c --- /dev/null +++ b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2034509257.rb @@ -0,0 +1,22 @@ +# Update a Splunk custom destination's destination preserves the null sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +# there is a valid "custom_destination_splunk_with_null_sourcetype" in the system +CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID = ENV["CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID"] + +body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({ + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + endpoint: "https://updated-example.com", + access_token: "my-access-token", + }), + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + id: CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID, + }), +}) +p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_SPLUNK_WITH_NULL_SOURCETYPE_DATA_ID, body) diff --git a/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_213195663.rb b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_213195663.rb new file mode 100644 index 000000000000..f3083f8d39d9 --- /dev/null +++ b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_213195663.rb @@ -0,0 +1,23 @@ +# Update a Splunk custom destination with a sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +# there is a valid "custom_destination_splunk" in the system +CUSTOM_DESTINATION_SPLUNK_DATA_ID = ENV["CUSTOM_DESTINATION_SPLUNK_DATA_ID"] + +body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({ + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + endpoint: "https://example.com", + access_token: "my-access-token", + sourcetype: "new-sourcetype", + }), + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + id: CUSTOM_DESTINATION_SPLUNK_DATA_ID, + }), +}) +p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_SPLUNK_DATA_ID, body) diff --git a/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2612469098.rb b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2612469098.rb new file mode 100644 index 000000000000..ab7ec0c1f543 --- /dev/null +++ b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2612469098.rb @@ -0,0 +1,23 @@ +# Update a Splunk custom destination with a null sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +# there is a valid "custom_destination_splunk_with_sourcetype" in the system +CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID = ENV["CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID"] + +body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({ + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + endpoint: "https://example.com", + access_token: "my-access-token", + sourcetype: nil, + }), + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + id: CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID, + }), +}) +p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID, body) diff --git a/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2701272624.rb b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2701272624.rb new file mode 100644 index 000000000000..fce9aea81f4b --- /dev/null +++ b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_2701272624.rb @@ -0,0 +1,18 @@ +# Update a Splunk custom destination's attributes preserves the absent sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +# there is a valid "custom_destination_splunk" in the system +CUSTOM_DESTINATION_SPLUNK_DATA_ID = ENV["CUSTOM_DESTINATION_SPLUNK_DATA_ID"] + +body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({ + name: "Nginx logs (Updated)", + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + id: CUSTOM_DESTINATION_SPLUNK_DATA_ID, + }), +}) +p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_SPLUNK_DATA_ID, body) diff --git a/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_3227001838.rb b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_3227001838.rb new file mode 100644 index 000000000000..e55e1ebbe207 --- /dev/null +++ b/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination_3227001838.rb @@ -0,0 +1,22 @@ +# Update a Splunk custom destination's destination preserves the sourcetype returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new + +# there is a valid "custom_destination_splunk_with_sourcetype" in the system +CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID = ENV["CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID"] + +body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({ + data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({ + attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({ + forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({ + type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC, + endpoint: "https://updated-example.com", + access_token: "my-access-token", + }), + }), + type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION, + id: CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID, + }), +}) +p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_SPLUNK_WITH_SOURCETYPE_DATA_ID, body) diff --git a/features/v2/application_security.feature b/features/v2/application_security.feature index f10a470ff2e0..aad0642b718a 100644 --- a/features/v2/application_security.feature +++ b/features/v2/application_security.feature @@ -16,21 +16,21 @@ Feature: Application Security @generated @skip @team:DataDog/asm-backend Scenario: Create a WAF custom rule returns "Bad Request" response Given new "CreateApplicationSecurityWafCustomRule" request - And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} + And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/asm-backend Scenario: Create a WAF custom rule returns "Concurrent Modification" response Given new "CreateApplicationSecurityWafCustomRule" request - And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} + And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} When the request is sent Then the response status is 409 Concurrent Modification @generated @skip @team:DataDog/asm-backend Scenario: Create a WAF custom rule returns "Created" response Given new "CreateApplicationSecurityWafCustomRule" request - And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} + And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from a bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} When the request is sent Then the response status is 201 Created @@ -153,7 +153,7 @@ Feature: Application Security Scenario: Update a WAF Custom Rule returns "Concurrent Modification" response Given new "UpdateApplicationSecurityWafCustomRule" request And request contains "custom_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} + And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} When the request is sent Then the response status is 409 Concurrent Modification @@ -161,7 +161,7 @@ Feature: Application Security Scenario: Update a WAF Custom Rule returns "Not Found" response Given new "UpdateApplicationSecurityWafCustomRule" request And request contains "custom_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} + And body with value {"data": {"attributes": {"action": {"action": "block_request", "parameters": {"location": "/blocking", "status_code": 403}}, "blocking": false, "conditions": [{"operator": "match_regex", "parameters": {"data": "blocked_users", "inputs": [{"address": "server.db.statement", "key_path": []}], "list": [], "options": {"case_sensitive": false, "min_length": 0}, "regex": "path.*", "type": "string", "value": "custom_tag"}}], "enabled": false, "name": "Block request from bad useragent", "path_glob": "/api/search/*", "scope": [{"env": "prod", "service": "billing-service"}], "tags": {"category": "business_logic", "type": "users.login.success"}}, "type": "custom_rule"}} When the request is sent Then the response status is 404 Not Found diff --git a/features/v2/given.json b/features/v2/given.json index e4a5d8817164..7782d060c2ef 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -758,6 +758,42 @@ "tag": "Logs Custom Destinations", "operationId": "CreateLogsCustomDestination" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"query\": \"source:nginx\",\n \"enabled\": false,\n \"forwarder_destination\": {\n \"type\": \"splunk_hec\",\n \"endpoint\": \"https://example.com\",\n \"access_token\": \"my-access-token\"\n },\n \"forward_tags\": false\n },\n \"type\": \"custom_destination\"\n }\n}" + } + ], + "step": "there is a valid \"custom_destination_splunk\" in the system", + "key": "custom_destination_splunk", + "tag": "Logs Custom Destinations", + "operationId": "CreateLogsCustomDestination" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"query\": \"source:nginx\",\n \"enabled\": false,\n \"forwarder_destination\": {\n \"type\": \"splunk_hec\",\n \"endpoint\": \"https://example.com\",\n \"access_token\": \"my-access-token\",\n \"sourcetype\": null\n },\n \"forward_tags\": false\n },\n \"type\": \"custom_destination\"\n }\n}" + } + ], + "step": "there is a valid \"custom_destination_splunk_with_null_sourcetype\" in the system", + "key": "custom_destination_splunk_with_null_sourcetype", + "tag": "Logs Custom Destinations", + "operationId": "CreateLogsCustomDestination" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"query\": \"source:nginx\",\n \"enabled\": false,\n \"forwarder_destination\": {\n \"type\": \"splunk_hec\",\n \"endpoint\": \"https://example.com\",\n \"access_token\": \"my-access-token\",\n \"sourcetype\": \"my-sourcetype\"\n },\n \"forward_tags\": false\n },\n \"type\": \"custom_destination\"\n }\n}" + } + ], + "step": "there is a valid \"custom_destination_splunk_with_sourcetype\" in the system", + "key": "custom_destination_splunk_with_sourcetype", + "tag": "Logs Custom Destinations", + "operationId": "CreateLogsCustomDestination" + }, { "parameters": [ { diff --git a/features/v2/logs_custom_destinations.feature b/features/v2/logs_custom_destinations.feature index 44b85404852f..e9aa22909977 100644 --- a/features/v2/logs_custom_destinations.feature +++ b/features/v2/logs_custom_destinations.feature @@ -93,6 +93,7 @@ Feature: Logs Custom Destinations And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination" does not have field "sourcetype" And the response "data.attributes.enabled" is false And the response "data.attributes.forward_tags" is false And the response "data.attributes.forward_tags_restriction_list" has length 2 @@ -100,6 +101,58 @@ Feature: Logs Custom Destinations And the response "data.attributes.forward_tags_restriction_list" array contains value "host" And the response "data.attributes.forward_tags_restriction_list_type" is equal to "ALLOW_LIST" + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Create a Splunk custom destination with a null sourcetype returns "OK" response + Given new "CreateLogsCustomDestination" request + And body with value {"data": {"attributes": {"enabled": false, "forward_tags": false, "forwarder_destination": {"access_token": "my-access-token", "endpoint": "https://example.com", "type": "splunk_hec", "sourcetype": null}, "name": "Nginx logs", "query": "source:nginx"}, "type": "custom_destination"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data" has field "id" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to null + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Create a Splunk custom destination with a sourcetype returns "OK" response + Given new "CreateLogsCustomDestination" request + And body with value {"data": {"attributes": {"enabled": false, "forward_tags": false, "forwarder_destination": {"access_token": "my-access-token", "endpoint": "https://example.com", "type": "splunk_hec", "sourcetype": "my-sourcetype"}, "name": "Nginx logs", "query": "source:nginx"}, "type": "custom_destination"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data" has field "id" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to "my-sourcetype" + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Create a Splunk custom destination with an empty string sourcetype returns "OK" response + Given new "CreateLogsCustomDestination" request + And body with value {"data": {"attributes": {"enabled": false, "forward_tags": false, "forwarder_destination": {"access_token": "my-access-token", "endpoint": "https://example.com", "type": "splunk_hec", "sourcetype": ""}, "name": "Nginx logs", "query": "source:nginx"}, "type": "custom_destination"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data" has field "id" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to "" + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Create a Splunk custom destination without a sourcetype returns "OK" response + Given new "CreateLogsCustomDestination" request + And body with value {"data": {"attributes": {"enabled": false, "forward_tags": false, "forwarder_destination": {"access_token": "my-access-token", "endpoint": "https://example.com", "type": "splunk_hec"}, "name": "Nginx logs", "query": "source:nginx"}, "type": "custom_destination"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data" has field "id" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination" does not have field "sourcetype" + @skip-java @skip-python @skip-rust @skip-typescript @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create a custom destination returns "Bad Request" response Given new "CreateLogsCustomDestination" request @@ -219,6 +272,80 @@ Feature: Logs Custom Destinations And the response "data" has item with field "attributes.forward_tags" with value false And the response "data" has item with field "attributes.forward_tags_restriction_list_type" with value "{{ custom_destination.data.attributes.forward_tags_restriction_list_type }}" + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Update a Splunk custom destination with a null sourcetype returns "OK" response + Given new "UpdateLogsCustomDestination" request + And there is a valid "custom_destination_splunk_with_sourcetype" in the system + And request contains "custom_destination_id" parameter from "custom_destination_splunk_with_sourcetype.data.id" + And body with value {"data": {"attributes": {"forwarder_destination": {"type": "splunk_hec", "endpoint": "https://example.com", "access_token": "my-access-token", "sourcetype": null}}, "type": "custom_destination", "id": "{{ custom_destination_splunk_with_sourcetype.data.id }}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data.id" is equal to "{{ custom_destination_splunk_with_sourcetype.data.id }}" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to null + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Update a Splunk custom destination with a sourcetype returns "OK" response + Given new "UpdateLogsCustomDestination" request + And there is a valid "custom_destination_splunk" in the system + And request contains "custom_destination_id" parameter from "custom_destination_splunk.data.id" + And body with value {"data": {"attributes": {"forwarder_destination": {"type": "splunk_hec", "endpoint": "https://example.com", "access_token": "my-access-token", "sourcetype": "new-sourcetype"}}, "type": "custom_destination", "id": "{{ custom_destination_splunk.data.id }}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data.id" is equal to "{{ custom_destination_splunk.data.id }}" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to "new-sourcetype" + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Update a Splunk custom destination's attributes preserves the absent sourcetype returns "OK" response + Given new "UpdateLogsCustomDestination" request + And there is a valid "custom_destination_splunk" in the system + And request contains "custom_destination_id" parameter from "custom_destination_splunk.data.id" + And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)"}, "type": "custom_destination", "id": "{{ custom_destination_splunk.data.id }}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data.id" is equal to "{{ custom_destination_splunk.data.id }}" + And the response "data.attributes.name" is equal to "Nginx logs (Updated)" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination" does not have field "sourcetype" + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Update a Splunk custom destination's destination preserves the null sourcetype returns "OK" response + Given new "UpdateLogsCustomDestination" request + And there is a valid "custom_destination_splunk_with_null_sourcetype" in the system + And request contains "custom_destination_id" parameter from "custom_destination_splunk_with_null_sourcetype.data.id" + And body with value {"data": {"attributes": {"forwarder_destination": {"type": "splunk_hec", "endpoint": "https://updated-example.com", "access_token": "my-access-token"}}, "type": "custom_destination", "id": "{{ custom_destination_splunk_with_null_sourcetype.data.id }}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data.id" is equal to "{{ custom_destination_splunk_with_null_sourcetype.data.id }}" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://updated-example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to null + + @team:DataDog/logs-backend @team:DataDog/logs-forwarding + Scenario: Update a Splunk custom destination's destination preserves the sourcetype returns "OK" response + Given new "UpdateLogsCustomDestination" request + And there is a valid "custom_destination_splunk_with_sourcetype" in the system + And request contains "custom_destination_id" parameter from "custom_destination_splunk_with_sourcetype.data.id" + And body with value {"data": {"attributes": {"forwarder_destination": {"type": "splunk_hec", "endpoint": "https://updated-example.com", "access_token": "my-access-token"}}, "type": "custom_destination", "id": "{{ custom_destination_splunk_with_sourcetype.data.id }}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "custom_destination" + And the response "data.id" is equal to "{{ custom_destination_splunk_with_sourcetype.data.id }}" + And the response "data.attributes.forwarder_destination.type" is equal to "splunk_hec" + And the response "data.attributes.forwarder_destination.endpoint" is equal to "https://updated-example.com" + And the response "data.attributes.forwarder_destination" does not have field "access_token" + And the response "data.attributes.forwarder_destination.sourcetype" is equal to "my-sourcetype" + @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Update a custom destination returns "Bad Request" response Given new "UpdateLogsCustomDestination" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index f3f09955cdab..6afe03aa604a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1149,6 +1149,7 @@ def overrides "v2.application_security_waf_custom_rule_condition_operator" => "ApplicationSecurityWafCustomRuleConditionOperator", "v2.application_security_waf_custom_rule_condition_options" => "ApplicationSecurityWafCustomRuleConditionOptions", "v2.application_security_waf_custom_rule_condition_parameters" => "ApplicationSecurityWafCustomRuleConditionParameters", + "v2.application_security_waf_custom_rule_condition_parameters_type" => "ApplicationSecurityWafCustomRuleConditionParametersType", "v2.application_security_waf_custom_rule_create_attributes" => "ApplicationSecurityWafCustomRuleCreateAttributes", "v2.application_security_waf_custom_rule_create_data" => "ApplicationSecurityWafCustomRuleCreateData", "v2.application_security_waf_custom_rule_create_request" => "ApplicationSecurityWafCustomRuleCreateRequest", diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_operator.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_operator.rb index 61f5f52ddaf5..7823cadf7726 100644 --- a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_operator.rb +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_operator.rb @@ -32,5 +32,9 @@ class ApplicationSecurityWafCustomRuleConditionOperator IP_MATCH = "ip_match".freeze NOT_IP_MATCH = "!ip_match".freeze CAPTURE_DATA = "capture_data".freeze + EXISTS = "exists".freeze + NOT_EXISTS = "!exists".freeze + EQUALS = "equals".freeze + NOT_EQUALS = "!equals".freeze end end diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters.rb index d5d05071ec1c..3bf2fba72673 100644 --- a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters.rb +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters.rb @@ -37,6 +37,9 @@ class ApplicationSecurityWafCustomRuleConditionParameters # Regex to use with the condition. Only used with match_regex and !match_regex operator. attr_accessor :regex + # The type of the value to compare against. Only used with the equals and !equals operator. + attr_accessor :type + # Store the captured value in the specified tag name. Only used with the capture_data operator. attr_accessor :value @@ -51,6 +54,7 @@ def self.attribute_map :'list' => :'list', :'options' => :'options', :'regex' => :'regex', + :'type' => :'type', :'value' => :'value' } end @@ -64,6 +68,7 @@ def self.openapi_types :'list' => :'Array', :'options' => :'ApplicationSecurityWafCustomRuleConditionOptions', :'regex' => :'String', + :'type' => :'ApplicationSecurityWafCustomRuleConditionParametersType', :'value' => :'String' } end @@ -110,6 +115,10 @@ def initialize(attributes = {}) self.regex = attributes[:'regex'] end + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + if attributes.key?(:'value') self.value = attributes[:'value'] end @@ -164,6 +173,7 @@ def ==(o) list == o.list && options == o.options && regex == o.regex && + type == o.type && value == o.value && additional_properties == o.additional_properties end @@ -172,7 +182,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, inputs, list, options, regex, value, additional_properties].hash + [data, inputs, list, options, regex, type, value, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters_type.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters_type.rb new file mode 100644 index 000000000000..761f3e2eec33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_condition_parameters_type.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the value to compare against. Only used with the equals and !equals operator. + class ApplicationSecurityWafCustomRuleConditionParametersType + include BaseEnumModel + + BOOLEAN = "boolean".freeze + SIGNED = "signed".freeze + UNSIGNED = "unsigned".freeze + FLOAT = "float".freeze + STRING = "string".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk.rb b/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk.rb index 2ded03f8ed16..3b62893c3623 100644 --- a/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk.rb +++ b/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk.rb @@ -28,6 +28,13 @@ class CustomDestinationForwardDestinationSplunk # Must have HTTPS scheme and forwarding back to Datadog is not allowed. attr_reader :endpoint + # The Splunk sourcetype for the events sent to this Splunk destination. + # + # If absent, the default sourcetype `_json` is used. If set to null, the `sourcetype` + # field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string + # value is used as the sourcetype. + attr_accessor :sourcetype + # Type of the Splunk HTTP Event Collector (HEC) destination. attr_reader :type @@ -39,6 +46,7 @@ def self.attribute_map { :'access_token' => :'access_token', :'endpoint' => :'endpoint', + :'sourcetype' => :'sourcetype', :'type' => :'type' } end @@ -49,10 +57,19 @@ def self.openapi_types { :'access_token' => :'String', :'endpoint' => :'String', + :'sourcetype' => :'String', :'type' => :'CustomDestinationForwardDestinationSplunkType' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'sourcetype', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -79,6 +96,10 @@ def initialize(attributes = {}) self.endpoint = attributes[:'endpoint'] end + if attributes.key?(:'sourcetype') + self.sourcetype = attributes[:'sourcetype'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -152,6 +173,7 @@ def ==(o) self.class == o.class && access_token == o.access_token && endpoint == o.endpoint && + sourcetype == o.sourcetype && type == o.type && additional_properties == o.additional_properties end @@ -160,7 +182,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [access_token, endpoint, type, additional_properties].hash + [access_token, endpoint, sourcetype, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk.rb b/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk.rb index 47c7c6e553da..2aabaa0478c7 100644 --- a/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk.rb +++ b/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk.rb @@ -25,6 +25,13 @@ class CustomDestinationResponseForwardDestinationSplunk # Must have HTTPS scheme and forwarding back to Datadog is not allowed. attr_reader :endpoint + # The Splunk sourcetype for the events sent to this Splunk destination. + # + # If absent, the default sourcetype `_json` is used. If set to null, the `sourcetype` + # field is omitted from the Splunk HEC payload entirely. Otherwise, the provided string + # value is used as the sourcetype. + attr_accessor :sourcetype + # Type of the Splunk HTTP Event Collector (HEC) destination. attr_reader :type @@ -35,6 +42,7 @@ class CustomDestinationResponseForwardDestinationSplunk def self.attribute_map { :'endpoint' => :'endpoint', + :'sourcetype' => :'sourcetype', :'type' => :'type' } end @@ -44,10 +52,19 @@ def self.attribute_map def self.openapi_types { :'endpoint' => :'String', + :'sourcetype' => :'String', :'type' => :'CustomDestinationResponseForwardDestinationSplunkType' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'sourcetype', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -70,6 +87,10 @@ def initialize(attributes = {}) self.endpoint = attributes[:'endpoint'] end + if attributes.key?(:'sourcetype') + self.sourcetype = attributes[:'sourcetype'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -131,6 +152,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && endpoint == o.endpoint && + sourcetype == o.sourcetype && type == o.type && additional_properties == o.additional_properties end @@ -139,7 +161,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [endpoint, type, additional_properties].hash + [endpoint, sourcetype, type, additional_properties].hash end end end