Skip to content

Commit 2563cba

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
add suppression version history (#2975)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent bf432a0 commit 2563cba

21 files changed

Lines changed: 643 additions & 64 deletions

.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.

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10385,6 +10385,27 @@ datadog\_api\_client.v2.model.get\_sbom\_response module
1038510385
:members:
1038610386
:show-inheritance:
1038710387

10388+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data module
10389+
-----------------------------------------------------------------------------
10390+
10391+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data
10392+
:members:
10393+
:show-inheritance:
10394+
10395+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data\_type module
10396+
-----------------------------------------------------------------------------------
10397+
10398+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data_type
10399+
:members:
10400+
:show-inheritance:
10401+
10402+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_response module
10403+
---------------------------------------------------------------------------------
10404+
10405+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_response
10406+
:members:
10407+
:show-inheritance:
10408+
1038810409
datadog\_api\_client.v2.model.get\_team\_memberships\_sort module
1038910410
-----------------------------------------------------------------
1039010411

@@ -19233,20 +19254,6 @@ datadog\_api\_client.v2.model.rule\_version\_history module
1923319254
:members:
1923419255
:show-inheritance:
1923519256

19236-
datadog\_api\_client.v2.model.rule\_version\_update module
19237-
----------------------------------------------------------
19238-
19239-
.. automodule:: datadog_api_client.v2.model.rule_version_update
19240-
:members:
19241-
:show-inheritance:
19242-
19243-
datadog\_api\_client.v2.model.rule\_version\_update\_type module
19244-
----------------------------------------------------------------
19245-
19246-
.. automodule:: datadog_api_client.v2.model.rule_version_update_type
19247-
:members:
19248-
:show-inheritance:
19249-
1925019257
datadog\_api\_client.v2.model.rule\_versions module
1925119258
---------------------------------------------------
1925219259

@@ -23307,6 +23314,20 @@ datadog\_api\_client.v2.model.step\_display\_bounds module
2330723314
:members:
2330823315
:show-inheritance:
2330923316

23317+
datadog\_api\_client.v2.model.suppression\_version\_history module
23318+
------------------------------------------------------------------
23319+
23320+
.. automodule:: datadog_api_client.v2.model.suppression_version_history
23321+
:members:
23322+
:show-inheritance:
23323+
23324+
datadog\_api\_client.v2.model.suppression\_versions module
23325+
----------------------------------------------------------
23326+
23327+
.. automodule:: datadog_api_client.v2.model.suppression_versions
23328+
:members:
23329+
:show-inheritance:
23330+
2331023331
datadog\_api\_client.v2.model.table\_result\_v2 module
2331123332
------------------------------------------------------
2331223333

@@ -25358,6 +25379,20 @@ datadog\_api\_client.v2.model.validation\_response module
2535825379
:members:
2535925380
:show-inheritance:
2536025381

25382+
datadog\_api\_client.v2.model.version\_history\_update module
25383+
-------------------------------------------------------------
25384+
25385+
.. automodule:: datadog_api_client.v2.model.version_history_update
25386+
:members:
25387+
:show-inheritance:
25388+
25389+
datadog\_api\_client.v2.model.version\_history\_update\_type module
25390+
-------------------------------------------------------------------
25391+
25392+
.. automodule:: datadog_api_client.v2.model.version_history_update_type
25393+
:members:
25394+
:show-inheritance:
25395+
2536125396
datadog\_api\_client.v2.model.virus\_total\_api\_key module
2536225397
-----------------------------------------------------------
2536325398

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Get a suppression's version history returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
8+
9+
# there is a valid "suppression" in the system
10+
SUPPRESSION_DATA_ID = environ["SUPPRESSION_DATA_ID"]
11+
12+
configuration = Configuration()
13+
with ApiClient(configuration) as api_client:
14+
api_instance = SecurityMonitoringApi(api_client)
15+
response = api_instance.get_suppression_version_history(
16+
suppression_id=SUPPRESSION_DATA_ID,
17+
)
18+
19+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,14 @@ def __init__(
307307
"v2.update_deployment_gate": False,
308308
"v2.update_deployment_rule": False,
309309
"v2.create_incident": False,
310+
"v2.create_incident_impact": False,
310311
"v2.create_incident_integration": False,
311312
"v2.create_incident_notification_rule": False,
312313
"v2.create_incident_notification_template": False,
313314
"v2.create_incident_todo": False,
314315
"v2.create_incident_type": False,
315316
"v2.delete_incident": False,
317+
"v2.delete_incident_impact": False,
316318
"v2.delete_incident_integration": False,
317319
"v2.delete_incident_notification_rule": False,
318320
"v2.delete_incident_notification_template": False,
@@ -325,6 +327,7 @@ def __init__(
325327
"v2.get_incident_todo": False,
326328
"v2.get_incident_type": False,
327329
"v2.list_incident_attachments": False,
330+
"v2.list_incident_impacts": False,
328331
"v2.list_incident_integrations": False,
329332
"v2.list_incident_notification_rules": False,
330333
"v2.list_incident_notification_templates": False,

0 commit comments

Comments
 (0)