Skip to content

Commit b8578d8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4ec899ff of spec repo
1 parent f65ee2d commit b8578d8

19 files changed

+986
-4
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-02-10 19:09:34.070491",
8-
"spec_repo_commit": "824f78a1"
7+
"regenerated": "2025-02-11 15:13:45.958243",
8+
"spec_repo_commit": "4ec899ff"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-10 19:09:34.086424",
13-
"spec_repo_commit": "824f78a1"
12+
"regenerated": "2025-02-11 15:13:45.973640",
13+
"spec_repo_commit": "4ec899ff"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12683,6 +12683,30 @@ components:
1268312683
$ref: '#/components/schemas/GetInterfacesData'
1268412684
type: array
1268512685
type: object
12686+
GetRuleVersionHistoryData:
12687+
description: Data for the rule version history.
12688+
properties:
12689+
attributes:
12690+
$ref: '#/components/schemas/RuleVersionHistory'
12691+
id:
12692+
description: ID of the rule.
12693+
type: string
12694+
type:
12695+
$ref: '#/components/schemas/GetRuleVersionHistoryDataType'
12696+
type: object
12697+
GetRuleVersionHistoryDataType:
12698+
description: Type of data.
12699+
enum:
12700+
- GetRuleVersionHistoryResponse
12701+
type: string
12702+
x-enum-varnames:
12703+
- GETRULEVERSIONHISTORYRESPONSE
12704+
GetRuleVersionHistoryResponse:
12705+
description: Response for getting the rule version history.
12706+
properties:
12707+
data:
12708+
$ref: '#/components/schemas/GetRuleVersionHistoryData'
12709+
type: object
1268612710
GetSBOMResponse:
1268712711
description: The expected response schema when getting an SBOM.
1268812712
properties:
@@ -23245,6 +23269,57 @@ components:
2324523269
example: John Doe
2324623270
type: string
2324723271
type: object
23272+
RuleVersionHistory:
23273+
description: Response object containing the version history of a rule.
23274+
properties:
23275+
count:
23276+
description: The number of rule versions.
23277+
format: int32
23278+
maximum: 2147483647
23279+
type: integer
23280+
data:
23281+
additionalProperties:
23282+
$ref: '#/components/schemas/RuleVersions'
23283+
description: A rule version with a list of updates.
23284+
description: The `RuleVersionHistory` `data`.
23285+
type: object
23286+
type: object
23287+
RuleVersionUpdate:
23288+
description: A change in a rule version.
23289+
properties:
23290+
change:
23291+
description: The new value of the field.
23292+
example: cloud_provider:aws
23293+
type: string
23294+
field:
23295+
description: The field that was changed.
23296+
example: Tags
23297+
type: string
23298+
type:
23299+
$ref: '#/components/schemas/RuleVersionUpdateType'
23300+
type: object
23301+
RuleVersionUpdateType:
23302+
description: The type of change.
23303+
enum:
23304+
- create
23305+
- update
23306+
- delete
23307+
type: string
23308+
x-enum-varnames:
23309+
- CREATE
23310+
- UPDATE
23311+
- DELETE
23312+
RuleVersions:
23313+
description: A rule version with a list of updates.
23314+
properties:
23315+
changes:
23316+
description: A list of changes.
23317+
items:
23318+
$ref: '#/components/schemas/RuleVersionUpdate'
23319+
type: array
23320+
rule:
23321+
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
23322+
type: object
2324823323
RumMetricCompute:
2324923324
description: The compute rule to compute the rum-based metric.
2325023325
properties:
@@ -45631,6 +45706,42 @@ paths:
4563145706
operator: OR
4563245707
permissions:
4563345708
- security_monitoring_rules_write
45709+
/api/v2/security_monitoring/rules/{rule_id}/version_history:
45710+
get:
45711+
description: Get a rule's version history.
45712+
operationId: GetRuleVersionHistory
45713+
parameters:
45714+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
45715+
- $ref: '#/components/parameters/PageSize'
45716+
- $ref: '#/components/parameters/PageNumber'
45717+
responses:
45718+
'200':
45719+
content:
45720+
application/json:
45721+
schema:
45722+
$ref: '#/components/schemas/GetRuleVersionHistoryResponse'
45723+
description: OK
45724+
'400':
45725+
$ref: '#/components/responses/BadRequestResponse'
45726+
'403':
45727+
$ref: '#/components/responses/NotAuthorizedResponse'
45728+
'404':
45729+
$ref: '#/components/responses/NotFoundResponse'
45730+
'429':
45731+
$ref: '#/components/responses/TooManyRequestsResponse'
45732+
security:
45733+
- apiKeyAuth: []
45734+
appKeyAuth: []
45735+
- AuthZ:
45736+
- security_monitoring_rules_read
45737+
summary: Get a rule's version history
45738+
tags:
45739+
- Security Monitoring
45740+
x-permission:
45741+
operator: OR
45742+
permissions:
45743+
- security_monitoring_rules_read
45744+
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
4563445745
/api/v2/security_monitoring/signals:
4563545746
get:
4563645747
description: 'The list endpoint returns security signals that match a search
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-02-04T22:39:17.325Z

cassettes/features/v2/security_monitoring/Get-rule-version-history-returns-OK-response.yml

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get a rule's version history returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
p api_instance.get_rule_version_history("rule_id")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Get rule version history returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
9+
# there is a valid "security_rule" in the system
10+
SECURITY_RULE_ID = ENV["SECURITY_RULE_ID"]
11+
p api_instance.get_rule_version_history(SECURITY_RULE_ID)

features/scenarios_model_mapping.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,11 @@
19781978
"rule_id" => "String",
19791979
"body" => "SecurityMonitoringRuleTestRequest",
19801980
},
1981+
"v2.GetRuleVersionHistory" => {
1982+
"rule_id" => "String",
1983+
"page_size" => "Integer",
1984+
"page_number" => "Integer",
1985+
},
19811986
"v2.ListSecurityMonitoringSignals" => {
19821987
"filter_query" => "String",
19831988
"filter_from" => "Time",

features/v2/security_monitoring.feature

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,30 @@ Feature: Security Monitoring
589589
And the response "name" is equal to "{{ unique }}"
590590
And the response "id" has the same value as "security_rule.id"
591591

592+
@generated @skip @team:DataDog/k9-cloud-security-platform
593+
Scenario: Get a rule's version history returns "Bad Request" response
594+
Given operation "GetRuleVersionHistory" enabled
595+
And new "GetRuleVersionHistory" request
596+
And request contains "rule_id" parameter from "REPLACE.ME"
597+
When the request is sent
598+
Then the response status is 400 Bad Request
599+
600+
@generated @skip @team:DataDog/k9-cloud-security-platform
601+
Scenario: Get a rule's version history returns "Not Found" response
602+
Given operation "GetRuleVersionHistory" enabled
603+
And new "GetRuleVersionHistory" request
604+
And request contains "rule_id" parameter from "REPLACE.ME"
605+
When the request is sent
606+
Then the response status is 404 Not Found
607+
608+
@generated @skip @team:DataDog/k9-cloud-security-platform
609+
Scenario: Get a rule's version history returns "OK" response
610+
Given operation "GetRuleVersionHistory" enabled
611+
And new "GetRuleVersionHistory" request
612+
And request contains "rule_id" parameter from "REPLACE.ME"
613+
When the request is sent
614+
Then the response status is 200 OK
615+
592616
@generated @skip @team:DataDog/k9-cloud-security-platform
593617
Scenario: Get a security filter returns "Not Found" response
594618
Given new "GetSecurityFilter" request
@@ -698,6 +722,19 @@ Feature: Security Monitoring
698722
When the request is sent
699723
Then the response status is 200 Notification rule details.
700724

725+
@skip-go @skip-java @skip-ruby @team:DataDog/k9-cloud-security-platform
726+
Scenario: Get rule version history returns "OK" response
727+
Given operation "GetRuleVersionHistory" enabled
728+
And new "GetRuleVersionHistory" request
729+
And there is a valid "security_rule" in the system
730+
And request contains "rule_id" parameter from "security_rule.id"
731+
When the request is sent
732+
Then the response status is 200 OK
733+
And the response "data.id" has the same value as "security_rule.id"
734+
And the response "data.type" is equal to "GetRuleVersionHistoryResponse"
735+
And the response "data.attributes.count" is equal to 1
736+
And the response "data.attributes.data[1].rule.name" has the same value as "security_rule.name"
737+
701738
@team:DataDog/cloud-security-posture-management
702739
Scenario: Get the list of signal-based notification rules returns "The list of notification rules." response
703740
Given there is a valid "valid_signal_notification_rule" in the system

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,12 @@
23622362
"type": "idempotent"
23632363
}
23642364
},
2365+
"GetRuleVersionHistory": {
2366+
"tag": "Security Monitoring",
2367+
"undo": {
2368+
"type": "safe"
2369+
}
2370+
},
23652371
"ListSecurityMonitoringSignals": {
23662372
"tag": "Security Monitoring",
23672373
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def initialize
243243
"v2.delete_historical_job": false,
244244
"v2.get_finding": false,
245245
"v2.get_historical_job": false,
246+
"v2.get_rule_version_history": false,
246247
"v2.list_findings": false,
247248
"v2.list_historical_jobs": false,
248249
"v2.mute_findings": false,

0 commit comments

Comments
 (0)