Skip to content

Commit f3172fe

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-specamaskara-dd
authored
Regenerate client from commit 15c0cf6c of spec repo (#2015)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: amaskara-dd <175134603+amaskara-dd@users.noreply.github.com>
1 parent 0542cac commit f3172fe

File tree

19 files changed

+900
-0
lines changed

19 files changed

+900
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13006,6 +13006,30 @@ components:
1300613006
$ref: '#/components/schemas/GetInterfacesData'
1300713007
type: array
1300813008
type: object
13009+
GetRuleVersionHistoryData:
13010+
description: Data for the rule version history.
13011+
properties:
13012+
attributes:
13013+
$ref: '#/components/schemas/RuleVersionHistory'
13014+
id:
13015+
description: ID of the rule.
13016+
type: string
13017+
type:
13018+
$ref: '#/components/schemas/GetRuleVersionHistoryDataType'
13019+
type: object
13020+
GetRuleVersionHistoryDataType:
13021+
description: Type of data.
13022+
enum:
13023+
- GetRuleVersionHistoryResponse
13024+
type: string
13025+
x-enum-varnames:
13026+
- GETRULEVERSIONHISTORYRESPONSE
13027+
GetRuleVersionHistoryResponse:
13028+
description: Response for getting the rule version history.
13029+
properties:
13030+
data:
13031+
$ref: '#/components/schemas/GetRuleVersionHistoryData'
13032+
type: object
1300913033
GetSBOMResponse:
1301013034
description: The expected response schema when getting an SBOM.
1301113035
properties:
@@ -23825,6 +23849,57 @@ components:
2382523849
example: John Doe
2382623850
type: string
2382723851
type: object
23852+
RuleVersionHistory:
23853+
description: Response object containing the version history of a rule.
23854+
properties:
23855+
count:
23856+
description: The number of rule versions.
23857+
format: int32
23858+
maximum: 2147483647
23859+
type: integer
23860+
data:
23861+
additionalProperties:
23862+
$ref: '#/components/schemas/RuleVersions'
23863+
description: A rule version with a list of updates.
23864+
description: The `RuleVersionHistory` `data`.
23865+
type: object
23866+
type: object
23867+
RuleVersionUpdate:
23868+
description: A change in a rule version.
23869+
properties:
23870+
change:
23871+
description: The new value of the field.
23872+
example: cloud_provider:aws
23873+
type: string
23874+
field:
23875+
description: The field that was changed.
23876+
example: Tags
23877+
type: string
23878+
type:
23879+
$ref: '#/components/schemas/RuleVersionUpdateType'
23880+
type: object
23881+
RuleVersionUpdateType:
23882+
description: The type of change.
23883+
enum:
23884+
- create
23885+
- update
23886+
- delete
23887+
type: string
23888+
x-enum-varnames:
23889+
- CREATE
23890+
- UPDATE
23891+
- DELETE
23892+
RuleVersions:
23893+
description: A rule version with a list of updates.
23894+
properties:
23895+
changes:
23896+
description: A list of changes.
23897+
items:
23898+
$ref: '#/components/schemas/RuleVersionUpdate'
23899+
type: array
23900+
rule:
23901+
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
23902+
type: object
2382823903
RumMetricCompute:
2382923904
description: The compute rule to compute the rum-based metric.
2383023905
properties:
@@ -46712,6 +46787,42 @@ paths:
4671246787
operator: OR
4671346788
permissions:
4671446789
- security_monitoring_rules_write
46790+
/api/v2/security_monitoring/rules/{rule_id}/version_history:
46791+
get:
46792+
description: Get a rule's version history.
46793+
operationId: GetRuleVersionHistory
46794+
parameters:
46795+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
46796+
- $ref: '#/components/parameters/PageSize'
46797+
- $ref: '#/components/parameters/PageNumber'
46798+
responses:
46799+
'200':
46800+
content:
46801+
application/json:
46802+
schema:
46803+
$ref: '#/components/schemas/GetRuleVersionHistoryResponse'
46804+
description: OK
46805+
'400':
46806+
$ref: '#/components/responses/BadRequestResponse'
46807+
'403':
46808+
$ref: '#/components/responses/NotAuthorizedResponse'
46809+
'404':
46810+
$ref: '#/components/responses/NotFoundResponse'
46811+
'429':
46812+
$ref: '#/components/responses/TooManyRequestsResponse'
46813+
security:
46814+
- apiKeyAuth: []
46815+
appKeyAuth: []
46816+
- AuthZ:
46817+
- security_monitoring_rules_read
46818+
summary: Get a rule's version history
46819+
tags:
46820+
- Security Monitoring
46821+
x-permission:
46822+
operator: OR
46823+
permissions:
46824+
- security_monitoring_rules_read
46825+
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
4671546826
/api/v2/security_monitoring/signals:
4671646827
get:
4671746828
description: 'The list endpoint returns security signals that match a search
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-02-04T22:39:17.325Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{
2+
"log": {
3+
"_recordingName": "Security Monitoring/Get rule version history returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "828d57e657b4424fe84a86d7f1db705f",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 420,
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_rule_version_history_returns_OK_response-1738708757\",\"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": 786,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 786,
45+
"text": "{\"name\":\"Test-Get_rule_version_history_returns_OK_response-1738708757\",\"createdAt\":1738708757817,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\"}],\"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\":\"gvq-qqd-jc7\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creator\":{\"handle\":\"\",\"name\":\"\"},\"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": "2025-02-04T22:39:17.727Z",
61+
"time": 132
62+
},
63+
{
64+
"_id": "09be8bb592c912411f3b4e3a4e3fb2d2",
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": 555,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "GET",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/gvq-qqd-jc7/version_history"
82+
},
83+
"response": {
84+
"bodySize": 915,
85+
"content": {
86+
"mimeType": "application/vnd.api+json",
87+
"size": 915,
88+
"text": "{\"data\":{\"id\":\"gvq-qqd-jc7\",\"type\":\"GetRuleVersionHistoryResponse\",\"attributes\":{\"count\":1,\"data\":{\"1\":{\"rule\":{\"name\":\"Test-Get_rule_version_history_returns_OK_response-1738708757\",\"createdAt\":1738708757817,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\"}],\"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\":\"gvq-qqd-jc7\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creator\":{\"handle\":\"\",\"name\":\"\"},\"updater\":{\"handle\":\"\",\"name\":\"\"}},\"changes\":[]}}}}}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/vnd.api+json"
95+
}
96+
],
97+
"headersSize": 662,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-02-04T22:39:17.865Z",
104+
"time": 152
105+
},
106+
{
107+
"_id": "cd1c79428cc1a501d7a7dd3c38ee275f",
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/gvq-qqd-jc7"
125+
},
126+
"response": {
127+
"bodySize": 0,
128+
"content": {
129+
"mimeType": "text/plain",
130+
"size": 0
131+
},
132+
"cookies": [],
133+
"headers": [],
134+
"headersSize": 601,
135+
"httpVersion": "HTTP/1.1",
136+
"redirectURL": "",
137+
"status": 204,
138+
"statusText": "No Content"
139+
},
140+
"startedDateTime": "2025-02-04T22:39:18.026Z",
141+
"time": 116
142+
}
143+
],
144+
"pages": [],
145+
"version": "1.2"
146+
}
147+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get a rule's version history returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getRuleVersionHistory"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
const params: v2.SecurityMonitoringApiGetRuleVersionHistoryRequest = {
12+
ruleId: "rule_id",
13+
};
14+
15+
apiInstance
16+
.getRuleVersionHistory(params)
17+
.then((data: v2.GetRuleVersionHistoryResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Get rule version history returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getRuleVersionHistory"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
// there is a valid "security_rule" in the system
12+
const SECURITY_RULE_ID = process.env.SECURITY_RULE_ID as string;
13+
14+
const params: v2.SecurityMonitoringApiGetRuleVersionHistoryRequest = {
15+
ruleId: SECURITY_RULE_ID,
16+
};
17+
18+
apiInstance
19+
.getRuleVersionHistory(params)
20+
.then((data: v2.GetRuleVersionHistoryResponse) => {
21+
console.log(
22+
"API called successfully. Returned data: " + JSON.stringify(data)
23+
);
24+
})
25+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5632,6 +5632,21 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
56325632
},
56335633
"operationResponseType": "SecurityMonitoringRuleTestResponse",
56345634
},
5635+
"v2.GetRuleVersionHistory": {
5636+
"ruleId": {
5637+
"type": "string",
5638+
"format": "",
5639+
},
5640+
"pageSize": {
5641+
"type": "number",
5642+
"format": "int64",
5643+
},
5644+
"pageNumber": {
5645+
"type": "number",
5646+
"format": "int64",
5647+
},
5648+
"operationResponseType": "GetRuleVersionHistoryResponse",
5649+
},
56355650
"v2.ListSecurityMonitoringSignals": {
56365651
"filterQuery": {
56375652
"type": "string",

0 commit comments

Comments
 (0)