Skip to content

Commit 7546224

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 17c1a58 of spec repo
1 parent 2ce1b56 commit 7546224

20 files changed

Lines changed: 629 additions & 62 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 106 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24799,6 +24799,30 @@ components:
2479924799
required:
2480024800
- data
2480124801
type: object
24802+
GetSuppressionVersionHistoryData:
24803+
description: Data for the suppression version history.
24804+
properties:
24805+
attributes:
24806+
$ref: '#/components/schemas/SuppressionVersionHistory'
24807+
id:
24808+
description: ID of the suppression.
24809+
type: string
24810+
type:
24811+
$ref: '#/components/schemas/GetSuppressionVersionHistoryDataType'
24812+
type: object
24813+
GetSuppressionVersionHistoryDataType:
24814+
description: Type of data.
24815+
enum:
24816+
- suppression_version_history
24817+
type: string
24818+
x-enum-varnames:
24819+
- SUPPRESSIONVERSIONHISTORY
24820+
GetSuppressionVersionHistoryResponse:
24821+
description: Response for getting the suppression version history.
24822+
properties:
24823+
data:
24824+
$ref: '#/components/schemas/GetSuppressionVersionHistoryData'
24825+
type: object
2480224826
GetTeamMembershipsSort:
2480324827
description: Specifies the order of returned team memberships
2480424828
enum:
@@ -44255,38 +44279,13 @@ components:
4425544279
description: The `RuleVersionHistory` `data`.
4425644280
type: object
4425744281
type: object
44258-
RuleVersionUpdate:
44259-
description: A change in a rule version.
44260-
properties:
44261-
change:
44262-
description: The new value of the field.
44263-
example: cloud_provider:aws
44264-
type: string
44265-
field:
44266-
description: The field that was changed.
44267-
example: Tags
44268-
type: string
44269-
type:
44270-
$ref: '#/components/schemas/RuleVersionUpdateType'
44271-
type: object
44272-
RuleVersionUpdateType:
44273-
description: The type of change.
44274-
enum:
44275-
- create
44276-
- update
44277-
- delete
44278-
type: string
44279-
x-enum-varnames:
44280-
- CREATE
44281-
- UPDATE
44282-
- DELETE
4428344282
RuleVersions:
4428444283
description: A rule version with a list of updates.
4428544284
properties:
4428644285
changes:
4428744286
description: A list of changes.
4428844287
items:
44289-
$ref: '#/components/schemas/RuleVersionUpdate'
44288+
$ref: '#/components/schemas/VersionHistoryUpdate'
4429044289
type: array
4429144290
rule:
4429244291
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
@@ -52846,6 +52845,32 @@ components:
5284652845
format: double
5284752846
type: number
5284852847
type: object
52848+
SuppressionVersionHistory:
52849+
description: Response object containing the version history of a suppression.
52850+
properties:
52851+
count:
52852+
description: The number of suppression versions.
52853+
format: int32
52854+
maximum: 2147483647
52855+
type: integer
52856+
data:
52857+
additionalProperties:
52858+
$ref: '#/components/schemas/SuppressionVersions'
52859+
description: A suppression version with a list of updates.
52860+
description: The version history of a suppression.
52861+
type: object
52862+
type: object
52863+
SuppressionVersions:
52864+
description: A suppression version with a list of updates.
52865+
properties:
52866+
changes:
52867+
description: A list of changes.
52868+
items:
52869+
$ref: '#/components/schemas/VersionHistoryUpdate'
52870+
type: array
52871+
suppression:
52872+
$ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes'
52873+
type: object
5284952874
TableResultV2:
5285052875
description: A reference table resource containing its full configuration and
5285152876
state.
@@ -57176,6 +57201,31 @@ components:
5717657201
example: 1
5717757202
format: int64
5717857203
type: integer
57204+
VersionHistoryUpdate:
57205+
description: A change in a rule version.
57206+
properties:
57207+
change:
57208+
description: The new value of the field.
57209+
example: cloud_provider:aws
57210+
type: string
57211+
field:
57212+
description: The field that was changed.
57213+
example: Tags
57214+
type: string
57215+
type:
57216+
$ref: '#/components/schemas/VersionHistoryUpdateType'
57217+
type: object
57218+
VersionHistoryUpdateType:
57219+
description: The type of change.
57220+
enum:
57221+
- create
57222+
- update
57223+
- delete
57224+
type: string
57225+
x-enum-varnames:
57226+
- CREATE
57227+
- UPDATE
57228+
- DELETE
5717957229
VirusTotalAPIKey:
5718057230
description: The definition of the `VirusTotalAPIKey` object.
5718157231
properties:
@@ -67961,6 +68011,7 @@ paths:
6796168011
- us3.datadoghq.com
6796268012
- us5.datadoghq.com
6796368013
- ap1.datadoghq.com
68014+
- ap2.datadoghq.com
6796468015
- datadoghq.eu
6796568016
- ddog-gov.com
6796668017
subdomain:
@@ -82003,6 +82054,35 @@ paths:
8200382054
summary: Update a suppression rule
8200482055
tags:
8200582056
- Security Monitoring
82057+
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history:
82058+
get:
82059+
description: Get a suppression's version history.
82060+
operationId: GetSuppressionVersionHistory
82061+
parameters:
82062+
- $ref: '#/components/parameters/SecurityMonitoringSuppressionID'
82063+
- $ref: '#/components/parameters/PageSize'
82064+
- $ref: '#/components/parameters/PageNumber'
82065+
responses:
82066+
'200':
82067+
content:
82068+
application/json:
82069+
schema:
82070+
$ref: '#/components/schemas/GetSuppressionVersionHistoryResponse'
82071+
description: OK
82072+
'403':
82073+
$ref: '#/components/responses/NotAuthorizedResponse'
82074+
'404':
82075+
$ref: '#/components/responses/NotFoundResponse'
82076+
'429':
82077+
$ref: '#/components/responses/TooManyRequestsResponse'
82078+
security:
82079+
- apiKeyAuth: []
82080+
appKeyAuth: []
82081+
- AuthZ:
82082+
- security_monitoring_suppressions_read
82083+
summary: Get a suppression's version history
82084+
tags:
82085+
- Security Monitoring
8200682086
/api/v2/security_monitoring/rules:
8200782087
get:
8200882088
description: List rules.

docs/datadog_api_client.v2.model.rst

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

10416+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data module
10417+
-----------------------------------------------------------------------------
10418+
10419+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data
10420+
:members:
10421+
:show-inheritance:
10422+
10423+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_data\_type module
10424+
-----------------------------------------------------------------------------------
10425+
10426+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_data_type
10427+
:members:
10428+
:show-inheritance:
10429+
10430+
datadog\_api\_client.v2.model.get\_suppression\_version\_history\_response module
10431+
---------------------------------------------------------------------------------
10432+
10433+
.. automodule:: datadog_api_client.v2.model.get_suppression_version_history_response
10434+
:members:
10435+
:show-inheritance:
10436+
1041610437
datadog\_api\_client.v2.model.get\_team\_memberships\_sort module
1041710438
-----------------------------------------------------------------
1041810439

@@ -19261,20 +19282,6 @@ datadog\_api\_client.v2.model.rule\_version\_history module
1926119282
:members:
1926219283
:show-inheritance:
1926319284

19264-
datadog\_api\_client.v2.model.rule\_version\_update module
19265-
----------------------------------------------------------
19266-
19267-
.. automodule:: datadog_api_client.v2.model.rule_version_update
19268-
:members:
19269-
:show-inheritance:
19270-
19271-
datadog\_api\_client.v2.model.rule\_version\_update\_type module
19272-
----------------------------------------------------------------
19273-
19274-
.. automodule:: datadog_api_client.v2.model.rule_version_update_type
19275-
:members:
19276-
:show-inheritance:
19277-
1927819285
datadog\_api\_client.v2.model.rule\_versions module
1927919286
---------------------------------------------------
1928019287

@@ -23335,6 +23342,20 @@ datadog\_api\_client.v2.model.step\_display\_bounds module
2333523342
:members:
2333623343
:show-inheritance:
2333723344

23345+
datadog\_api\_client.v2.model.suppression\_version\_history module
23346+
------------------------------------------------------------------
23347+
23348+
.. automodule:: datadog_api_client.v2.model.suppression_version_history
23349+
:members:
23350+
:show-inheritance:
23351+
23352+
datadog\_api\_client.v2.model.suppression\_versions module
23353+
----------------------------------------------------------
23354+
23355+
.. automodule:: datadog_api_client.v2.model.suppression_versions
23356+
:members:
23357+
:show-inheritance:
23358+
2333823359
datadog\_api\_client.v2.model.table\_result\_v2 module
2333923360
------------------------------------------------------
2334023361

@@ -25386,6 +25407,20 @@ datadog\_api\_client.v2.model.validation\_response module
2538625407
:members:
2538725408
:show-inheritance:
2538825409

25410+
datadog\_api\_client.v2.model.version\_history\_update module
25411+
-------------------------------------------------------------
25412+
25413+
.. automodule:: datadog_api_client.v2.model.version_history_update
25414+
:members:
25415+
:show-inheritance:
25416+
25417+
datadog\_api\_client.v2.model.version\_history\_update\_type module
25418+
-------------------------------------------------------------------
25419+
25420+
.. automodule:: datadog_api_client.v2.model.version_history_update_type
25421+
:members:
25422+
:show-inheritance:
25423+
2538925424
datadog\_api\_client.v2.model.virus\_total\_api\_key module
2539025425
-----------------------------------------------------------
2539125426

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/v2/api/events_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def __init__(self, api_client=None):
5555
"us3.datadoghq.com",
5656
"us5.datadoghq.com",
5757
"ap1.datadoghq.com",
58+
"ap2.datadoghq.com",
5859
"datadoghq.eu",
5960
"ddog-gov.com",
6061
],

src/datadog_api_client/v2/api/security_monitoring_api.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
from datadog_api_client.v2.model.security_monitoring_suppression_update_request import (
8181
SecurityMonitoringSuppressionUpdateRequest,
8282
)
83+
from datadog_api_client.v2.model.get_suppression_version_history_response import GetSuppressionVersionHistoryResponse
8384
from datadog_api_client.v2.model.security_monitoring_list_rules_response import SecurityMonitoringListRulesResponse
8485
from datadog_api_client.v2.model.security_monitoring_rule_response import SecurityMonitoringRuleResponse
8586
from datadog_api_client.v2.model.security_monitoring_rule_convert_response import SecurityMonitoringRuleConvertResponse
@@ -1119,6 +1120,39 @@ def __init__(self, api_client=None):
11191120
api_client=api_client,
11201121
)
11211122

1123+
self._get_suppression_version_history_endpoint = _Endpoint(
1124+
settings={
1125+
"response_type": (GetSuppressionVersionHistoryResponse,),
1126+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
1127+
"endpoint_path": "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history",
1128+
"operation_id": "get_suppression_version_history",
1129+
"http_method": "GET",
1130+
"version": "v2",
1131+
},
1132+
params_map={
1133+
"suppression_id": {
1134+
"required": True,
1135+
"openapi_types": (str,),
1136+
"attribute": "suppression_id",
1137+
"location": "path",
1138+
},
1139+
"page_size": {
1140+
"openapi_types": (int,),
1141+
"attribute": "page[size]",
1142+
"location": "query",
1143+
},
1144+
"page_number": {
1145+
"openapi_types": (int,),
1146+
"attribute": "page[number]",
1147+
"location": "query",
1148+
},
1149+
},
1150+
headers_map={
1151+
"accept": ["application/json"],
1152+
},
1153+
api_client=api_client,
1154+
)
1155+
11221156
self._get_threat_hunting_job_endpoint = _Endpoint(
11231157
settings={
11241158
"response_type": (ThreatHuntingJobResponse,),
@@ -3138,6 +3172,36 @@ def get_suppressions_affecting_rule(
31383172

31393173
return self._get_suppressions_affecting_rule_endpoint.call_with_http_info(**kwargs)
31403174

3175+
def get_suppression_version_history(
3176+
self,
3177+
suppression_id: str,
3178+
*,
3179+
page_size: Union[int, UnsetType] = unset,
3180+
page_number: Union[int, UnsetType] = unset,
3181+
) -> GetSuppressionVersionHistoryResponse:
3182+
"""Get a suppression's version history.
3183+
3184+
Get a suppression's version history.
3185+
3186+
:param suppression_id: The ID of the suppression rule
3187+
:type suppression_id: str
3188+
:param page_size: Size for a given page. The maximum allowed value is 100.
3189+
:type page_size: int, optional
3190+
:param page_number: Specific page number to return.
3191+
:type page_number: int, optional
3192+
:rtype: GetSuppressionVersionHistoryResponse
3193+
"""
3194+
kwargs: Dict[str, Any] = {}
3195+
kwargs["suppression_id"] = suppression_id
3196+
3197+
if page_size is not unset:
3198+
kwargs["page_size"] = page_size
3199+
3200+
if page_number is not unset:
3201+
kwargs["page_number"] = page_number
3202+
3203+
return self._get_suppression_version_history_endpoint.call_with_http_info(**kwargs)
3204+
31413205
def get_threat_hunting_job(
31423206
self,
31433207
job_id: str,

0 commit comments

Comments
 (0)