Skip to content

Commit f4c85d8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 15c0cf6c of spec repo
1 parent 887f45e commit f4c85d8

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-12 15:28:22.653238",
8-
"spec_repo_commit": "b56263de"
7+
"regenerated": "2025-02-12 17:30:30.354303",
8+
"spec_repo_commit": "15c0cf6c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-12 15:28:22.668686",
13-
"spec_repo_commit": "b56263de"
12+
"regenerated": "2025-02-12 17:30:30.369260",
13+
"spec_repo_commit": "15c0cf6c"
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:
@@ -23254,6 +23278,57 @@ components:
2325423278
example: John Doe
2325523279
type: string
2325623280
type: object
23281+
RuleVersionHistory:
23282+
description: Response object containing the version history of a rule.
23283+
properties:
23284+
count:
23285+
description: The number of rule versions.
23286+
format: int32
23287+
maximum: 2147483647
23288+
type: integer
23289+
data:
23290+
additionalProperties:
23291+
$ref: '#/components/schemas/RuleVersions'
23292+
description: A rule version with a list of updates.
23293+
description: The `RuleVersionHistory` `data`.
23294+
type: object
23295+
type: object
23296+
RuleVersionUpdate:
23297+
description: A change in a rule version.
23298+
properties:
23299+
change:
23300+
description: The new value of the field.
23301+
example: cloud_provider:aws
23302+
type: string
23303+
field:
23304+
description: The field that was changed.
23305+
example: Tags
23306+
type: string
23307+
type:
23308+
$ref: '#/components/schemas/RuleVersionUpdateType'
23309+
type: object
23310+
RuleVersionUpdateType:
23311+
description: The type of change.
23312+
enum:
23313+
- create
23314+
- update
23315+
- delete
23316+
type: string
23317+
x-enum-varnames:
23318+
- CREATE
23319+
- UPDATE
23320+
- DELETE
23321+
RuleVersions:
23322+
description: A rule version with a list of updates.
23323+
properties:
23324+
changes:
23325+
description: A list of changes.
23326+
items:
23327+
$ref: '#/components/schemas/RuleVersionUpdate'
23328+
type: array
23329+
rule:
23330+
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
23331+
type: object
2325723332
RumMetricCompute:
2325823333
description: The compute rule to compute the rum-based metric.
2325923334
properties:
@@ -45723,6 +45798,42 @@ paths:
4572345798
operator: OR
4572445799
permissions:
4572545800
- security_monitoring_rules_write
45801+
/api/v2/security_monitoring/rules/{rule_id}/version_history:
45802+
get:
45803+
description: Get a rule's version history.
45804+
operationId: GetRuleVersionHistory
45805+
parameters:
45806+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
45807+
- $ref: '#/components/parameters/PageSize'
45808+
- $ref: '#/components/parameters/PageNumber'
45809+
responses:
45810+
'200':
45811+
content:
45812+
application/json:
45813+
schema:
45814+
$ref: '#/components/schemas/GetRuleVersionHistoryResponse'
45815+
description: OK
45816+
'400':
45817+
$ref: '#/components/responses/BadRequestResponse'
45818+
'403':
45819+
$ref: '#/components/responses/NotAuthorizedResponse'
45820+
'404':
45821+
$ref: '#/components/responses/NotFoundResponse'
45822+
'429':
45823+
$ref: '#/components/responses/TooManyRequestsResponse'
45824+
security:
45825+
- apiKeyAuth: []
45826+
appKeyAuth: []
45827+
- AuthZ:
45828+
- security_monitoring_rules_read
45829+
summary: Get a rule's version history
45830+
tags:
45831+
- Security Monitoring
45832+
x-permission:
45833+
operator: OR
45834+
permissions:
45835+
- security_monitoring_rules_read
45836+
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
4572645837
/api/v2/security_monitoring/signals:
4572745838
get:
4572845839
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
@@ -599,6 +599,30 @@ Feature: Security Monitoring
599599
And the response "name" is equal to "{{ unique }}"
600600
And the response "id" has the same value as "security_rule.id"
601601

602+
@generated @skip @team:DataDog/k9-cloud-security-platform
603+
Scenario: Get a rule's version history returns "Bad Request" response
604+
Given operation "GetRuleVersionHistory" enabled
605+
And new "GetRuleVersionHistory" request
606+
And request contains "rule_id" parameter from "REPLACE.ME"
607+
When the request is sent
608+
Then the response status is 400 Bad Request
609+
610+
@generated @skip @team:DataDog/k9-cloud-security-platform
611+
Scenario: Get a rule's version history returns "Not Found" response
612+
Given operation "GetRuleVersionHistory" enabled
613+
And new "GetRuleVersionHistory" request
614+
And request contains "rule_id" parameter from "REPLACE.ME"
615+
When the request is sent
616+
Then the response status is 404 Not Found
617+
618+
@generated @skip @team:DataDog/k9-cloud-security-platform
619+
Scenario: Get a rule's version history returns "OK" response
620+
Given operation "GetRuleVersionHistory" enabled
621+
And new "GetRuleVersionHistory" request
622+
And request contains "rule_id" parameter from "REPLACE.ME"
623+
When the request is sent
624+
Then the response status is 200 OK
625+
602626
@generated @skip @team:DataDog/k9-cloud-security-platform
603627
Scenario: Get a security filter returns "Not Found" response
604628
Given new "GetSecurityFilter" request
@@ -708,6 +732,19 @@ Feature: Security Monitoring
708732
When the request is sent
709733
Then the response status is 200 Notification rule details.
710734

735+
@skip-go @skip-java @skip-ruby @team:DataDog/k9-cloud-security-platform
736+
Scenario: Get rule version history returns "OK" response
737+
Given operation "GetRuleVersionHistory" enabled
738+
And new "GetRuleVersionHistory" request
739+
And there is a valid "security_rule" in the system
740+
And request contains "rule_id" parameter from "security_rule.id"
741+
When the request is sent
742+
Then the response status is 200 OK
743+
And the response "data.id" has the same value as "security_rule.id"
744+
And the response "data.type" is equal to "GetRuleVersionHistoryResponse"
745+
And the response "data.attributes.count" is equal to 1
746+
And the response "data.attributes.data[1].rule.name" has the same value as "security_rule.name"
747+
711748
@team:DataDog/cloud-security-posture-management
712749
Scenario: Get the list of signal-based notification rules returns "The list of notification rules." response
713750
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)