Skip to content

Commit ad4c6de

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Fix Datadog-API-Spec due to newly exported attribute data_source (#2529)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d1fc365 commit ad4c6de

6 files changed

+28
-34
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-24 13:38:36.353901",
8-
"spec_repo_commit": "4295fd1a"
7+
"regenerated": "2025-04-24 15:56:56.654944",
8+
"spec_repo_commit": "d2685952"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-24 13:38:36.368994",
13-
"spec_repo_commit": "4295fd1a"
12+
"regenerated": "2025-04-24 15:56:56.669858",
13+
"spec_repo_commit": "d2685952"
1414
}
1515
}
1616
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-06-24T19:47:12.909Z
1+
2025-04-24T11:34:50.866Z

tests/v2/cassettes/test_scenarios/test_convert_a_rule_from_json_to_terraform_returns_ok_response.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test
4-
rule","name":"Test-Convert_a_rule_from_JSON_to_Terraform_returns_OK_response-1719258432","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}'
4+
rule","name":"Test-Convert_a_rule_from_JSON_to_Terraform_returns_OK_response-1745494490","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}'
55
headers:
66
accept:
77
- application/json
@@ -12,16 +12,14 @@ interactions:
1212
response:
1313
body:
1414
string: '{"terraformContent":"resource \"datadog_security_monitoring_rule\"
15-
\"test-convert_a_rule_from_json_to_terraform_returns_ok_response-1719258432\"
16-
{\n\tname = \"Test-Convert_a_rule_from_JSON_to_Terraform_returns_OK_response-1719258432\"\n\tenabled
15+
\"test-convert_a_rule_from_json_to_terraform_returns_ok_response-1745494490\"
16+
{\n\tname = \"Test-Convert_a_rule_from_JSON_to_Terraform_returns_OK_response-1745494490\"\n\tenabled
1717
= true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields
18-
= []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t}\n\toptions {\n\t\tkeep_alive
19-
= 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window
20-
= 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications
21-
= []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags =
22-
[]\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"}
23-
24-
'
18+
= []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions
19+
{\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method
20+
= \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus
21+
= \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a \u003e 0\"\n\t}\n\tmessage
22+
= \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"}'
2523
headers:
2624
content-type:
2725
- application/json
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-06-24T19:55:06.421Z
1+
2025-04-24T11:34:51.208Z

tests/v2/cassettes/test_scenarios/test_convert_an_existing_rule_from_json_to_terraform_returns_ok_response.yaml

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test
4-
rule","name":"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1719258906","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[],"type":"log_detection"}'
4+
rule","name":"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1745494491","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[],"type":"log_detection"}'
55
headers:
66
accept:
77
- application/json
@@ -11,10 +11,8 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules
1212
response:
1313
body:
14-
string: '{"id":"eu8-b0k-wzc","version":1,"name":"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1719258906","createdAt":1719258906588,"creationAuthorId":1445416,"isDefault":false,"isPartner":false,"isEnabled":true,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":""}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"detectionMethod":"threshold","evaluationWindow":900},"cases":[{"name":"","status":"info","notifications":[],"condition":"a
15-
> 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[]}
16-
17-
'
14+
string: '{"name":"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1745494491","createdAt":1745494491502,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a
15+
\u003e 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"version":1,"id":"e60-iv6-d7e","blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":1445416,"creator":{"handle":"[email protected]","name":"frog"},"updater":{"handle":"","name":""}}'
1816
headers:
1917
content-type:
2018
- application/json
@@ -27,20 +25,18 @@ interactions:
2725
accept:
2826
- application/json
2927
method: GET
30-
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/eu8-b0k-wzc/convert
28+
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/e60-iv6-d7e/convert
3129
response:
3230
body:
3331
string: '{"terraformContent":"resource \"datadog_security_monitoring_rule\"
34-
\"test-convert_an_existing_rule_from_json_to_terraform_returns_ok_response-1719258906\"
35-
{\n\tname = \"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1719258906\"\n\tenabled
32+
\"test-convert_an_existing_rule_from_json_to_terraform_returns_ok_response-1745494491\"
33+
{\n\tname = \"Test-Convert_an_existing_rule_from_JSON_to_Terraform_returns_OK_response-1745494491\"\n\tenabled
3634
= true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields
37-
= []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t}\n\toptions {\n\t\tkeep_alive
38-
= 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window
39-
= 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications
40-
= []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags =
41-
[]\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"}
42-
43-
'
35+
= []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions
36+
{\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method
37+
= \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus
38+
= \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a \u003e 0\"\n\t}\n\tmessage
39+
= \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"}'
4440
headers:
4541
content-type:
4642
- application/json
@@ -53,7 +49,7 @@ interactions:
5349
accept:
5450
- '*/*'
5551
method: DELETE
56-
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/eu8-b0k-wzc
52+
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/e60-iv6-d7e
5753
response:
5854
body:
5955
string: ''

tests/v2/features/security_monitoring.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Feature: Security Monitoring
135135
And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"}
136136
When the request is sent
137137
Then the response status is 200 OK
138-
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"{{ unique_lower }}\" {\n\tname = \"{{ unique }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
138+
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"{{ unique_lower }}\" {\n\tname = \"{{ unique }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
139139

140140
@skip @team:DataDog/k9-cloud-security-platform
141141
Scenario: Convert an existing rule from JSON to Terraform returns "Bad Request" response
@@ -158,7 +158,7 @@ Feature: Security Monitoring
158158
And request contains "rule_id" parameter from "security_rule.id"
159159
When the request is sent
160160
Then the response status is 200 OK
161-
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"{{ unique_lower }}\" {\n\tname = \"{{ unique }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
161+
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"{{ unique_lower }}\" {\n\tname = \"{{ unique }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
162162

163163
@skip-validation @team:DataDog/k9-cloud-security-platform
164164
Scenario: Create a cloud_configuration rule returns "OK" response

0 commit comments

Comments
 (0)