Skip to content

Commit 9da23c9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-specamaskara-dd
authored
Regenerate client from commit 15c0cf6c of spec repo (#2206)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: amaskara-dd <[email protected]>
1 parent 6500597 commit 9da23c9

18 files changed

+982
-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
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,

lib/datadog_api_client/inflector.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,9 @@ def overrides
16651665
"v2.get_finding_response" => "GetFindingResponse",
16661666
"v2.get_interfaces_data" => "GetInterfacesData",
16671667
"v2.get_interfaces_response" => "GetInterfacesResponse",
1668+
"v2.get_rule_version_history_data" => "GetRuleVersionHistoryData",
1669+
"v2.get_rule_version_history_data_type" => "GetRuleVersionHistoryDataType",
1670+
"v2.get_rule_version_history_response" => "GetRuleVersionHistoryResponse",
16681671
"v2.get_sbom_response" => "GetSBOMResponse",
16691672
"v2.get_team_memberships_sort" => "GetTeamMembershipsSort",
16701673
"v2.get_workflow_response" => "GetWorkflowResponse",
@@ -2344,6 +2347,10 @@ def overrides
23442347
"v2.rule_type" => "RuleType",
23452348
"v2.rule_types_items" => "RuleTypesItems",
23462349
"v2.rule_user" => "RuleUser",
2350+
"v2.rule_version_history" => "RuleVersionHistory",
2351+
"v2.rule_versions" => "RuleVersions",
2352+
"v2.rule_version_update" => "RuleVersionUpdate",
2353+
"v2.rule_version_update_type" => "RuleVersionUpdateType",
23472354
"v2.rum_aggregate_bucket_value" => "RUMAggregateBucketValue",
23482355
"v2.rum_aggregate_bucket_value_timeseries_point" => "RUMAggregateBucketValueTimeseriesPoint",
23492356
"v2.rum_aggregate_request" => "RUMAggregateRequest",

0 commit comments

Comments
 (0)