Skip to content

Commit 76becf6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3d683e08 of spec repo
1 parent 00fbfa7 commit 76becf6

File tree

97 files changed

+1186
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1186
-101
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.6",
7-
"regenerated": "2025-01-22 15:54:07.509728",
8-
"spec_repo_commit": "7a8ea4b1"
7+
"regenerated": "2025-01-23 15:33:49.961990",
8+
"spec_repo_commit": "3d683e08"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-22 15:54:07.525047",
13-
"spec_repo_commit": "7a8ea4b1"
12+
"regenerated": "2025-01-23 15:33:49.977295",
13+
"spec_repo_commit": "3d683e08"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12666,6 +12666,20 @@ components:
1266612666
$ref: '#/components/schemas/GetInterfacesData'
1266712667
type: array
1266812668
type: object
12669+
GetRuleVersionHistoryResponse:
12670+
description: Response object containing the version history of a rule.
12671+
properties:
12672+
count:
12673+
description: The number of rule versions.
12674+
format: int32
12675+
maximum: 2147483647
12676+
type: integer
12677+
data:
12678+
description: A list of rule versions.
12679+
items:
12680+
$ref: '#/components/schemas/RuleVersionHistory'
12681+
type: array
12682+
type: object
1266912683
GetSBOMResponse:
1267012684
description: The expected response schema when getting an SBOM.
1267112685
properties:
@@ -22930,6 +22944,42 @@ components:
2293022944
type: string
2293122945
x-enum-varnames:
2293222946
- RULE
22947+
RuleVersionHistory:
22948+
description: A rule version with a list of updates.
22949+
properties:
22950+
changes:
22951+
description: A list of changes.
22952+
items:
22953+
$ref: '#/components/schemas/RuleVersionUpdate'
22954+
type: array
22955+
rule:
22956+
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
22957+
type: object
22958+
RuleVersionUpdate:
22959+
description: A change in a rule version.
22960+
properties:
22961+
change:
22962+
description: The new value of the field.
22963+
example: cloud_provider:aws
22964+
type: string
22965+
field:
22966+
description: The field that was changed.
22967+
example: Tags
22968+
type: string
22969+
type:
22970+
$ref: '#/components/schemas/RuleVersionUpdateType'
22971+
type: object
22972+
RuleVersionUpdateType:
22973+
description: The type of change.
22974+
enum:
22975+
- create
22976+
- update
22977+
- delete
22978+
type: string
22979+
x-enum-varnames:
22980+
- CREATE
22981+
- UPDATE
22982+
- DELETE
2293322983
RumMetricCompute:
2293422984
description: The compute rule to compute the rum-based metric.
2293522985
properties:
@@ -44751,6 +44801,42 @@ paths:
4475144801
operator: OR
4475244802
permissions:
4475344803
- security_monitoring_rules_write
44804+
/api/v2/security_monitoring/rules/{rule_id}/version_history:
44805+
get:
44806+
description: Get a rule's version history.
44807+
operationId: GetRuleVersionHistory
44808+
parameters:
44809+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
44810+
- $ref: '#/components/parameters/PageSize'
44811+
- $ref: '#/components/parameters/PageNumber'
44812+
responses:
44813+
'200':
44814+
content:
44815+
application/json:
44816+
schema:
44817+
$ref: '#/components/schemas/GetRuleVersionHistoryResponse'
44818+
description: OK
44819+
'400':
44820+
$ref: '#/components/responses/BadRequestResponse'
44821+
'403':
44822+
$ref: '#/components/responses/NotAuthorizedResponse'
44823+
'404':
44824+
$ref: '#/components/responses/NotFoundResponse'
44825+
'429':
44826+
$ref: '#/components/responses/TooManyRequestsResponse'
44827+
security:
44828+
- apiKeyAuth: []
44829+
appKeyAuth: []
44830+
- AuthZ:
44831+
- security_monitoring_rules_read
44832+
summary: Get a rule's version history
44833+
tags:
44834+
- Security Monitoring
44835+
x-permission:
44836+
operator: OR
44837+
permissions:
44838+
- security_monitoring_rules_read
44839+
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
4475444840
/api/v2/security_monitoring/signals:
4475544841
get:
4475644842
description: 'The list endpoint returns security signals that match a search
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get a rule's version history returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.GetRuleVersionHistoryResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getRuleVersionHistory", true);
12+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
13+
14+
try {
15+
GetRuleVersionHistoryResponse result = apiInstance.getRuleVersionHistory("rule_id");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling SecurityMonitoringApi#getRuleVersionHistory");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get rule version history returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.GetRuleVersionHistoryResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
12+
13+
// there is a valid "security_rule" in the system
14+
String SECURITY_RULE_ID = System.getenv("SECURITY_RULE_ID");
15+
16+
try {
17+
GetRuleVersionHistoryResponse result = apiInstance.getRuleVersionHistory(SECURITY_RULE_ID);
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling SecurityMonitoringApi#getRuleVersionHistory");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ public class ApiClient {
424424
put("v2.deleteHistoricalJob", false);
425425
put("v2.getFinding", false);
426426
put("v2.getHistoricalJob", false);
427+
put("v2.getRuleVersionHistory", false);
427428
put("v2.getSBOM", false);
428429
put("v2.listFindings", false);
429430
put("v2.listHistoricalJobs", false);

0 commit comments

Comments
 (0)