Skip to content

Commit a0338cc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
add tests for SecurityMonitoringRule endpoints (#882)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 5849b79 commit a0338cc

File tree

16 files changed

+699
-51
lines changed

16 files changed

+699
-51
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-10-25 17:03:49.624394",
8-
"spec_repo_commit": "9673a7f6"
7+
"regenerated": "2022-10-25 19:31:31.314441",
8+
"spec_repo_commit": "904df7aa"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-10-25 17:03:49.640407",
13-
"spec_repo_commit": "9673a7f6"
12+
"regenerated": "2022-10-25 19:31:31.327009",
13+
"spec_repo_commit": "904df7aa"
1414
}
1515
}
1616
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-10-24T20:38:11.940Z"

cassettes/v2/Security-Monitoring_1187227211/Get-a-rule-s-details-returns-Not-Found-response_1595889709/recording.har

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-10-24T20:38:20.357Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/Get a rule's details returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "c4e2fb19a2cdbfe6e24f80a750c999eb",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 416,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 588,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Get_a_rule_s_details_returns_OK_response-1666643900\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules"
39+
},
40+
"response": {
41+
"bodySize": 589,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 589,
45+
"text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1666643900572,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"crk-wil-reo\",\"isDefault\":false,\"name\":\"Test-Get_a_rule_s_details_returns_OK_response-1666643900\"}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 628,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-10-24T20:38:20.365Z",
61+
"time": 166
62+
},
63+
{
64+
"_id": "b781f16b6f10fec4ba181914647eff82",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 543,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "GET",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/crk-wil-reo"
82+
},
83+
"response": {
84+
"bodySize": 589,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 589,
88+
"text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1666643900572,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"crk-wil-reo\",\"isDefault\":false,\"name\":\"Test-Get_a_rule_s_details_returns_OK_response-1666643900\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 628,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-10-24T20:38:20.541Z",
104+
"time": 137
105+
},
106+
{
107+
"_id": "f771091e826023c2fca0fc4fd10660b2",
108+
"_order": 0,
109+
"cache": {},
110+
"request": {
111+
"bodySize": 0,
112+
"cookies": [],
113+
"headers": [
114+
{
115+
"_fromType": "array",
116+
"name": "accept",
117+
"value": "*/*"
118+
}
119+
],
120+
"headersSize": 536,
121+
"httpVersion": "HTTP/1.1",
122+
"method": "DELETE",
123+
"queryString": [],
124+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/crk-wil-reo"
125+
},
126+
"response": {
127+
"bodySize": 0,
128+
"content": {
129+
"mimeType": "text/plain",
130+
"size": 0
131+
},
132+
"cookies": [],
133+
"headers": [],
134+
"headersSize": 575,
135+
"httpVersion": "HTTP/1.1",
136+
"redirectURL": "",
137+
"status": 204,
138+
"statusText": "No Content"
139+
},
140+
"startedDateTime": "2022-10-24T20:38:20.701Z",
141+
"time": 161
142+
}
143+
],
144+
"pages": [],
145+
"version": "1.2"
146+
}
147+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-10-24T20:38:42.445Z"

cassettes/v2/Security-Monitoring_1187227211/List-rules-returns-OK-response_668139396/recording.har

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-10-24T21:40:05.344Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/Update an existing rule returns \"Bad Request\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "2a91e4a2b391bbe9a0ae624c79adc380",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 428,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 588,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Update_an_existing_rule_returns_Bad_Request_response-1666647605\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules"
39+
},
40+
"response": {
41+
"bodySize": 601,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 601,
45+
"text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1666647605501,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"3bq-nad-szq\",\"isDefault\":false,\"name\":\"Test-Update_an_existing_rule_returns_Bad_Request_response-1666647605\"}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 627,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-10-24T21:40:05.361Z",
61+
"time": 213
62+
},
63+
{
64+
"_id": "41d34eb6b6167fa7ddfb2742cd227a7f",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 198,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 599,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "PUT",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"cases\":[{\"status\":\"info\"}],\"isEnabled\":true,\"message\":\"Test rule Bad\",\"name\":\"Test-Update_an_existing_rule_returns_Bad_Request_response-1666647605\",\"options\":{},\"queries\":[{\"query\":\"\"}],\"tags\":[]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/3bq-nad-szq"
92+
},
93+
"response": {
94+
"bodySize": 73,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 73,
98+
"text": "{\"errors\":[\"Invalid rule configuration\",\"Query filter cannot be empty\"]}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 669,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 400,
111+
"statusText": "Bad Request"
112+
},
113+
"startedDateTime": "2022-10-24T21:40:05.974Z",
114+
"time": 127
115+
},
116+
{
117+
"_id": "a5052a7728cc005e112f780b173ca48c",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 0,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "*/*"
128+
}
129+
],
130+
"headersSize": 536,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/3bq-nad-szq"
135+
},
136+
"response": {
137+
"bodySize": 0,
138+
"content": {
139+
"mimeType": "text/plain",
140+
"size": 0
141+
},
142+
"cookies": [],
143+
"headers": [],
144+
"headersSize": 574,
145+
"httpVersion": "HTTP/1.1",
146+
"redirectURL": "",
147+
"status": 204,
148+
"statusText": "No Content"
149+
},
150+
"startedDateTime": "2022-10-24T21:40:06.108Z",
151+
"time": 116
152+
}
153+
],
154+
"pages": [],
155+
"version": "1.2"
156+
}
157+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-10-24T21:07:24.645Z"

0 commit comments

Comments
 (0)