Skip to content

Commit 7ed176c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
add suppression version history (#2801)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 9cd4e25 commit 7ed176c

22 files changed

+840
-35
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 114 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24779,6 +24779,30 @@ components:
2477924779
required:
2478024780
- data
2478124781
type: object
24782+
GetSuppressionVersionHistoryData:
24783+
description: Data for the suppression version history.
24784+
properties:
24785+
attributes:
24786+
$ref: '#/components/schemas/SuppressionVersionHistory'
24787+
id:
24788+
description: ID of the suppression.
24789+
type: string
24790+
type:
24791+
$ref: '#/components/schemas/GetSuppressionVersionHistoryDataType'
24792+
type: object
24793+
GetSuppressionVersionHistoryDataType:
24794+
description: Type of data.
24795+
enum:
24796+
- suppression_version_history
24797+
type: string
24798+
x-enum-varnames:
24799+
- SUPPRESSIONVERSIONHISTORY
24800+
GetSuppressionVersionHistoryResponse:
24801+
description: Response for getting the suppression version history.
24802+
properties:
24803+
data:
24804+
$ref: '#/components/schemas/GetSuppressionVersionHistoryData'
24805+
type: object
2478224806
GetTeamMembershipsSort:
2478324807
description: Specifies the order of returned team memberships
2478424808
enum:
@@ -44242,38 +44266,13 @@ components:
4424244266
description: The `RuleVersionHistory` `data`.
4424344267
type: object
4424444268
type: object
44245-
RuleVersionUpdate:
44246-
description: A change in a rule version.
44247-
properties:
44248-
change:
44249-
description: The new value of the field.
44250-
example: cloud_provider:aws
44251-
type: string
44252-
field:
44253-
description: The field that was changed.
44254-
example: Tags
44255-
type: string
44256-
type:
44257-
$ref: '#/components/schemas/RuleVersionUpdateType'
44258-
type: object
44259-
RuleVersionUpdateType:
44260-
description: The type of change.
44261-
enum:
44262-
- create
44263-
- update
44264-
- delete
44265-
type: string
44266-
x-enum-varnames:
44267-
- CREATE
44268-
- UPDATE
44269-
- DELETE
4427044269
RuleVersions:
4427144270
description: A rule version with a list of updates.
4427244271
properties:
4427344272
changes:
4427444273
description: A list of changes.
4427544274
items:
44276-
$ref: '#/components/schemas/RuleVersionUpdate'
44275+
$ref: '#/components/schemas/VersionHistoryUpdate'
4427744276
type: array
4427844277
rule:
4427944278
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
@@ -52833,6 +52832,32 @@ components:
5283352832
format: double
5283452833
type: number
5283552834
type: object
52835+
SuppressionVersionHistory:
52836+
description: Response object containing the version history of a suppression.
52837+
properties:
52838+
count:
52839+
description: The number of suppression versions.
52840+
format: int32
52841+
maximum: 2147483647
52842+
type: integer
52843+
data:
52844+
additionalProperties:
52845+
$ref: '#/components/schemas/SuppressionVersions'
52846+
description: A suppression version with a list of updates.
52847+
description: The version history of a suppression.
52848+
type: object
52849+
type: object
52850+
SuppressionVersions:
52851+
description: A suppression version with a list of updates.
52852+
properties:
52853+
changes:
52854+
description: A list of changes.
52855+
items:
52856+
$ref: '#/components/schemas/VersionHistoryUpdate'
52857+
type: array
52858+
suppression:
52859+
$ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes'
52860+
type: object
5283652861
TableResultV2:
5283752862
description: A reference table resource containing its full configuration and
5283852863
state.
@@ -57163,6 +57188,31 @@ components:
5716357188
example: 1
5716457189
format: int64
5716557190
type: integer
57191+
VersionHistoryUpdate:
57192+
description: A change in a rule version.
57193+
properties:
57194+
change:
57195+
description: The new value of the field.
57196+
example: cloud_provider:aws
57197+
type: string
57198+
field:
57199+
description: The field that was changed.
57200+
example: Tags
57201+
type: string
57202+
type:
57203+
$ref: '#/components/schemas/VersionHistoryUpdateType'
57204+
type: object
57205+
VersionHistoryUpdateType:
57206+
description: The type of change.
57207+
enum:
57208+
- create
57209+
- update
57210+
- delete
57211+
type: string
57212+
x-enum-varnames:
57213+
- CREATE
57214+
- UPDATE
57215+
- DELETE
5716657216
VirusTotalAPIKey:
5716757217
description: The definition of the `VirusTotalAPIKey` object.
5716857218
properties:
@@ -69034,6 +69084,9 @@ paths:
6903469084
operator: OR
6903569085
permissions:
6903669086
- incident_read
69087+
x-unstable: '**Note**: This endpoint is in Preview.
69088+
69089+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6903769090
post:
6903869091
description: Create an impact for an incident.
6903969092
operationId: CreateIncidentImpact
@@ -69077,6 +69130,9 @@ paths:
6907769130
operator: OR
6907869131
permissions:
6907969132
- incident_write
69133+
x-unstable: '**Note**: This endpoint is in Preview.
69134+
69135+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6908069136
/api/v2/incidents/{incident_id}/impacts/{impact_id}:
6908169137
delete:
6908269138
description: Delete an incident impact.
@@ -69107,6 +69163,9 @@ paths:
6910769163
operator: OR
6910869164
permissions:
6910969165
- incident_write
69166+
x-unstable: '**Note**: This endpoint is in Preview.
69167+
69168+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6911069169
/api/v2/incidents/{incident_id}/relationships/integrations:
6911169170
get:
6911269171
description: Get all integration metadata for an incident.
@@ -82039,6 +82098,35 @@ paths:
8203982098
summary: Update a suppression rule
8204082099
tags:
8204182100
- Security Monitoring
82101+
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history:
82102+
get:
82103+
description: Get a suppression's version history.
82104+
operationId: GetSuppressionVersionHistory
82105+
parameters:
82106+
- $ref: '#/components/parameters/SecurityMonitoringSuppressionID'
82107+
- $ref: '#/components/parameters/PageSize'
82108+
- $ref: '#/components/parameters/PageNumber'
82109+
responses:
82110+
'200':
82111+
content:
82112+
application/json:
82113+
schema:
82114+
$ref: '#/components/schemas/GetSuppressionVersionHistoryResponse'
82115+
description: OK
82116+
'403':
82117+
$ref: '#/components/responses/NotAuthorizedResponse'
82118+
'404':
82119+
$ref: '#/components/responses/NotFoundResponse'
82120+
'429':
82121+
$ref: '#/components/responses/TooManyRequestsResponse'
82122+
security:
82123+
- apiKeyAuth: []
82124+
appKeyAuth: []
82125+
- AuthZ:
82126+
- security_monitoring_suppressions_read
82127+
summary: Get a suppression's version history
82128+
tags:
82129+
- Security Monitoring
8204282130
/api/v2/security_monitoring/rules:
8204382131
get:
8204482132
description: List rules.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-11-26T13:33:06.081Z

cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-Not-Found-response.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-11-26T13:33:06.482Z

cassettes/features/v2/security_monitoring/Get-a-suppression-s-version-history-returns-OK-response.yml

Lines changed: 58 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 suppression's version history returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5+
6+
# there is a valid "suppression" in the system
7+
SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"]
8+
p api_instance.get_suppression_version_history(SUPPRESSION_DATA_ID)

features/scenarios_model_mapping.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,11 @@
15521552
"suppression_id" => "String",
15531553
"body" => "SecurityMonitoringSuppressionUpdateRequest",
15541554
},
1555+
"v2.GetSuppressionVersionHistory" => {
1556+
"suppression_id" => "String",
1557+
"page_size" => "Integer",
1558+
"page_number" => "Integer",
1559+
},
15551560
"v2.ListSecurityMonitoringRules" => {
15561561
"page_size" => "Integer",
15571562
"page_number" => "Integer",

features/v2/incidents.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,14 +806,16 @@ Feature: Incidents
806806

807807
@generated @skip @team:DataDog/incident-app
808808
Scenario: List an incident's impacts returns "Bad Request" response
809-
Given new "ListIncidentImpacts" request
809+
Given operation "ListIncidentImpacts" enabled
810+
And new "ListIncidentImpacts" request
810811
And request contains "incident_id" parameter from "REPLACE.ME"
811812
When the request is sent
812813
Then the response status is 400 Bad Request
813814

814815
@generated @skip @team:DataDog/incident-app
815816
Scenario: List an incident's impacts returns "Not Found" response
816-
Given new "ListIncidentImpacts" request
817+
Given operation "ListIncidentImpacts" enabled
818+
And new "ListIncidentImpacts" request
817819
And request contains "incident_id" parameter from "REPLACE.ME"
818820
When the request is sent
819821
Then the response status is 404 Not Found

features/v2/security_monitoring.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,21 @@ Feature: Security Monitoring
10201020
And the response "data.attributes.rule_query" has the same value as "suppression.data.attributes.rule_query"
10211021
And the response "data.attributes.suppression_query" is equal to "env:test"
10221022

1023+
@team:DataDog/k9-cloud-security-platform
1024+
Scenario: Get a suppression's version history returns "Not Found" response
1025+
Given new "GetSuppressionVersionHistory" request
1026+
And request contains "suppression_id" parameter with value "this-does-not-exist"
1027+
When the request is sent
1028+
Then the response status is 404 Not Found
1029+
1030+
@team:DataDog/k9-cloud-security-platform
1031+
Scenario: Get a suppression's version history returns "OK" response
1032+
Given new "GetSuppressionVersionHistory" request
1033+
And there is a valid "suppression" in the system
1034+
And request contains "suppression_id" parameter from "suppression.data.id"
1035+
When the request is sent
1036+
Then the response status is 200 OK
1037+
10231038
@team:DataDog/k9-cloud-security-platform
10241039
Scenario: Get all security filters returns "OK" response
10251040
Given new "ListSecurityFilters" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3979,6 +3979,12 @@
39793979
"type": "idempotent"
39803980
}
39813981
},
3982+
"GetSuppressionVersionHistory": {
3983+
"tag": "Security Monitoring",
3984+
"undo": {
3985+
"type": "safe"
3986+
}
3987+
},
39823988
"ListSecurityMonitoringRules": {
39833989
"tag": "Security Monitoring",
39843990
"undo": {

0 commit comments

Comments
 (0)