Skip to content

Commit da852ef

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 71a3f57 of spec repo (#4458)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c175838 commit da852ef

15 files changed

Lines changed: 867 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,15 @@ components:
16851685
required: true
16861686
schema:
16871687
type: string
1688+
SecurityMonitoringRuleVersion:
1689+
description: The historical version number of the rule.
1690+
in: path
1691+
name: version
1692+
required: true
1693+
schema:
1694+
example: 1
1695+
format: int64
1696+
type: integer
16881697
SecurityMonitoringSuppressionID:
16891698
description: The ID of the suppression rule
16901699
in: path
@@ -169520,6 +169529,60 @@ paths:
169520169529
operator: OR
169521169530
permissions:
169522169531
- security_monitoring_rules_read
169532+
/api/v2/security_monitoring/rules/{rule_id}/restore/{version}:
169533+
post:
169534+
description: |-
169535+
Restores a custom detection rule to a previously saved historical version.
169536+
Only custom rules can be restored. Default and partner rules return 400.
169537+
The restore creates a new version entry; it does not overwrite history.
169538+
operationId: RestoreSecurityMonitoringRule
169539+
parameters:
169540+
- $ref: "#/components/parameters/SecurityMonitoringRuleID"
169541+
- $ref: "#/components/parameters/SecurityMonitoringRuleVersion"
169542+
responses:
169543+
"200":
169544+
content:
169545+
"application/json":
169546+
examples:
169547+
default:
169548+
value:
169549+
cases:
169550+
- condition: "a > 0"
169551+
name: ""
169552+
notifications: []
169553+
status: info
169554+
id: abc-123
169555+
isEnabled: true
169556+
message: Test rule
169557+
name: My security monitoring rule.
169558+
tags: []
169559+
type: log_detection
169560+
schema:
169561+
$ref: "#/components/schemas/SecurityMonitoringRuleResponse"
169562+
description: OK
169563+
"400":
169564+
$ref: "#/components/responses/BadRequestResponse"
169565+
"403":
169566+
$ref: "#/components/responses/NotAuthorizedResponse"
169567+
"404":
169568+
$ref: "#/components/responses/NotFoundResponse"
169569+
"409":
169570+
$ref: "#/components/responses/ConflictResponse"
169571+
"429":
169572+
$ref: "#/components/responses/TooManyRequestsResponse"
169573+
security:
169574+
- apiKeyAuth: []
169575+
appKeyAuth: []
169576+
- AuthZ:
169577+
- security_monitoring_rules_write
169578+
summary: Restore a rule to a historical version
169579+
tags: ["Security Monitoring"]
169580+
"x-permission":
169581+
operator: OR
169582+
permissions:
169583+
- security_monitoring_rules_write
169584+
x-unstable: |-
169585+
**Note**: This endpoint is in beta and may be subject to changes.
169523169586
/api/v2/security_monitoring/rules/{rule_id}/test:
169524169587
post:
169525169588
description: |-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-06-12T09:57:22.725Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/Restore a rule to a historical version returns \"Conflict\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "5e1f64f9b881fb1fb36ea7d8c6ff5226",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 440,
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-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242\",\"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": 899,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 899,
45+
"text": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242\",\"createdAt\":1781258244898,\"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 \\u003e 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"version\":1,\"id\":\"xrz-jfq-dfm\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creationAuthorId\":2320499,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"updater\":{\"handle\":\"\",\"name\":\"\"}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 654,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2026-06-12T09:57:24.764Z",
61+
"time": 173
62+
},
63+
{
64+
"_id": "7b42d2ba49ea50475aa06c271910abc2",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 433,
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\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule updated\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm"
92+
},
93+
"response": {
94+
"bodySize": 834,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 834,
98+
"text": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated\",\"isEnabled\":true,\"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 \\u003e 0\"}],\"message\":\"Test rule updated\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"id\":\"xrz-jfq-dfm\",\"version\":2,\"createdAt\":1781258244898,\"creationAuthorId\":2320499,\"updateAuthorId\":2320499,\"updatedAt\":1781258245104,\"isDefault\":false,\"blocking\":false,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"metadata\":{\"entities\":null,\"sources\":null}}"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 654,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2026-06-12T09:57:24.945Z",
114+
"time": 212
115+
},
116+
{
117+
"_id": "010626c24640fafabce49cfb8f1d1fc2",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 0,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
}
129+
],
130+
"headersSize": 577,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "POST",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm/restore/2"
135+
},
136+
"response": {
137+
"bodySize": 101,
138+
"content": {
139+
"mimeType": "application/json",
140+
"size": 101,
141+
"text": "{\"error\":{\"code\":\"AlreadyExists\",\"message\":\"Cannot restore: target version is the current version.\"}}"
142+
},
143+
"cookies": [],
144+
"headers": [
145+
{
146+
"name": "content-type",
147+
"value": "application/json"
148+
}
149+
],
150+
"headersSize": 654,
151+
"httpVersion": "HTTP/1.1",
152+
"redirectURL": "",
153+
"status": 409,
154+
"statusText": "Conflict"
155+
},
156+
"startedDateTime": "2026-06-12T09:57:25.163Z",
157+
"time": 165
158+
},
159+
{
160+
"_id": "045e3f4e79d5a0ea5d704cbde1ec573a",
161+
"_order": 0,
162+
"cache": {},
163+
"request": {
164+
"bodySize": 0,
165+
"cookies": [],
166+
"headers": [
167+
{
168+
"_fromType": "array",
169+
"name": "accept",
170+
"value": "*/*"
171+
}
172+
],
173+
"headersSize": 536,
174+
"httpVersion": "HTTP/1.1",
175+
"method": "DELETE",
176+
"queryString": [],
177+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm"
178+
},
179+
"response": {
180+
"bodySize": 0,
181+
"content": {
182+
"mimeType": "text/plain",
183+
"size": 0
184+
},
185+
"cookies": [],
186+
"headers": [],
187+
"headersSize": 601,
188+
"httpVersion": "HTTP/1.1",
189+
"redirectURL": "",
190+
"status": 204,
191+
"statusText": "No Content"
192+
},
193+
"startedDateTime": "2026-06-12T09:57:25.335Z",
194+
"time": 208
195+
}
196+
],
197+
"pages": [],
198+
"version": "1.2"
199+
}
200+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-06-12T08:39:41.348Z"

0 commit comments

Comments
 (0)