Skip to content

Commit bba9d77

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

18 files changed

+742
-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

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5331,6 +5331,27 @@ datadog\_api\_client.v2.model.get\_interfaces\_response module
53315331
:members:
53325332
:show-inheritance:
53335333

5334+
datadog\_api\_client.v2.model.get\_rule\_version\_history\_data module
5335+
----------------------------------------------------------------------
5336+
5337+
.. automodule:: datadog_api_client.v2.model.get_rule_version_history_data
5338+
:members:
5339+
:show-inheritance:
5340+
5341+
datadog\_api\_client.v2.model.get\_rule\_version\_history\_data\_type module
5342+
----------------------------------------------------------------------------
5343+
5344+
.. automodule:: datadog_api_client.v2.model.get_rule_version_history_data_type
5345+
:members:
5346+
:show-inheritance:
5347+
5348+
datadog\_api\_client.v2.model.get\_rule\_version\_history\_response module
5349+
--------------------------------------------------------------------------
5350+
5351+
.. automodule:: datadog_api_client.v2.model.get_rule_version_history_response
5352+
:members:
5353+
:show-inheritance:
5354+
53345355
datadog\_api\_client.v2.model.get\_sbom\_response module
53355356
--------------------------------------------------------
53365357

@@ -10140,6 +10161,34 @@ datadog\_api\_client.v2.model.rule\_user module
1014010161
:members:
1014110162
:show-inheritance:
1014210163

10164+
datadog\_api\_client.v2.model.rule\_version\_history module
10165+
-----------------------------------------------------------
10166+
10167+
.. automodule:: datadog_api_client.v2.model.rule_version_history
10168+
:members:
10169+
:show-inheritance:
10170+
10171+
datadog\_api\_client.v2.model.rule\_version\_update module
10172+
----------------------------------------------------------
10173+
10174+
.. automodule:: datadog_api_client.v2.model.rule_version_update
10175+
:members:
10176+
:show-inheritance:
10177+
10178+
datadog\_api\_client.v2.model.rule\_version\_update\_type module
10179+
----------------------------------------------------------------
10180+
10181+
.. automodule:: datadog_api_client.v2.model.rule_version_update_type
10182+
:members:
10183+
:show-inheritance:
10184+
10185+
datadog\_api\_client.v2.model.rule\_versions module
10186+
---------------------------------------------------
10187+
10188+
.. automodule:: datadog_api_client.v2.model.rule_versions
10189+
:members:
10190+
:show-inheritance:
10191+
1014310192
datadog\_api\_client.v2.model.rum\_aggregate\_bucket\_value module
1014410193
------------------------------------------------------------------
1014510194

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get a rule's version history returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_rule_version_history"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = SecurityMonitoringApi(api_client)
12+
response = api_instance.get_rule_version_history(
13+
rule_id="rule_id",
14+
)
15+
16+
print(response)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
Get rule 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 "security_rule" in the system
10+
SECURITY_RULE_ID = environ["SECURITY_RULE_ID"]
11+
12+
configuration = Configuration()
13+
configuration.unstable_operations["get_rule_version_history"] = True
14+
with ApiClient(configuration) as api_client:
15+
api_instance = SecurityMonitoringApi(api_client)
16+
response = api_instance.get_rule_version_history(
17+
rule_id=SECURITY_RULE_ID,
18+
)
19+
20+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ def __init__(
290290
"v2.delete_historical_job": False,
291291
"v2.get_finding": False,
292292
"v2.get_historical_job": False,
293+
"v2.get_rule_version_history": False,
293294
"v2.list_findings": False,
294295
"v2.list_historical_jobs": False,
295296
"v2.mute_findings": False,

src/datadog_api_client/v2/api/security_monitoring_api.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
from datadog_api_client.v2.model.security_monitoring_rule_validate_payload import SecurityMonitoringRuleValidatePayload
6767
from datadog_api_client.v2.model.cloud_configuration_rule_payload import CloudConfigurationRulePayload
6868
from datadog_api_client.v2.model.security_monitoring_rule_update_payload import SecurityMonitoringRuleUpdatePayload
69+
from datadog_api_client.v2.model.get_rule_version_history_response import GetRuleVersionHistoryResponse
6970
from datadog_api_client.v2.model.security_monitoring_signals_list_response import SecurityMonitoringSignalsListResponse
7071
from datadog_api_client.v2.model.security_monitoring_signals_sort import SecurityMonitoringSignalsSort
7172
from datadog_api_client.v2.model.security_monitoring_signal import SecurityMonitoringSignal
@@ -556,6 +557,39 @@ def __init__(self, api_client=None):
556557
api_client=api_client,
557558
)
558559

560+
self._get_rule_version_history_endpoint = _Endpoint(
561+
settings={
562+
"response_type": (GetRuleVersionHistoryResponse,),
563+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
564+
"endpoint_path": "/api/v2/security_monitoring/rules/{rule_id}/version_history",
565+
"operation_id": "get_rule_version_history",
566+
"http_method": "GET",
567+
"version": "v2",
568+
},
569+
params_map={
570+
"rule_id": {
571+
"required": True,
572+
"openapi_types": (str,),
573+
"attribute": "rule_id",
574+
"location": "path",
575+
},
576+
"page_size": {
577+
"openapi_types": (int,),
578+
"attribute": "page[size]",
579+
"location": "query",
580+
},
581+
"page_number": {
582+
"openapi_types": (int,),
583+
"attribute": "page[number]",
584+
"location": "query",
585+
},
586+
},
587+
headers_map={
588+
"accept": ["application/json"],
589+
},
590+
api_client=api_client,
591+
)
592+
559593
self._get_sbom_endpoint = _Endpoint(
560594
settings={
561595
"response_type": (GetSBOMResponse,),
@@ -1958,6 +1992,36 @@ def get_historical_job(
19581992

19591993
return self._get_historical_job_endpoint.call_with_http_info(**kwargs)
19601994

1995+
def get_rule_version_history(
1996+
self,
1997+
rule_id: str,
1998+
*,
1999+
page_size: Union[int, UnsetType] = unset,
2000+
page_number: Union[int, UnsetType] = unset,
2001+
) -> GetRuleVersionHistoryResponse:
2002+
"""Get a rule's version history.
2003+
2004+
Get a rule's version history.
2005+
2006+
:param rule_id: The ID of the rule.
2007+
:type rule_id: str
2008+
:param page_size: Size for a given page. The maximum allowed value is 100.
2009+
:type page_size: int, optional
2010+
:param page_number: Specific page number to return.
2011+
:type page_number: int, optional
2012+
:rtype: GetRuleVersionHistoryResponse
2013+
"""
2014+
kwargs: Dict[str, Any] = {}
2015+
kwargs["rule_id"] = rule_id
2016+
2017+
if page_size is not unset:
2018+
kwargs["page_size"] = page_size
2019+
2020+
if page_number is not unset:
2021+
kwargs["page_number"] = page_number
2022+
2023+
return self._get_rule_version_history_endpoint.call_with_http_info(**kwargs)
2024+
19612025
def get_sbom(
19622026
self,
19632027
asset_type: AssetType,
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.rule_version_history import RuleVersionHistory
18+
from datadog_api_client.v2.model.get_rule_version_history_data_type import GetRuleVersionHistoryDataType
19+
20+
21+
class GetRuleVersionHistoryData(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.rule_version_history import RuleVersionHistory
25+
from datadog_api_client.v2.model.get_rule_version_history_data_type import GetRuleVersionHistoryDataType
26+
27+
return {
28+
"attributes": (RuleVersionHistory,),
29+
"id": (str,),
30+
"type": (GetRuleVersionHistoryDataType,),
31+
}
32+
33+
attribute_map = {
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
37+
}
38+
39+
def __init__(
40+
self_,
41+
attributes: Union[RuleVersionHistory, UnsetType] = unset,
42+
id: Union[str, UnsetType] = unset,
43+
type: Union[GetRuleVersionHistoryDataType, UnsetType] = unset,
44+
**kwargs,
45+
):
46+
"""
47+
Data for the rule version history.
48+
49+
:param attributes: Response object containing the version history of a rule.
50+
:type attributes: RuleVersionHistory, optional
51+
52+
:param id: ID of the rule.
53+
:type id: str, optional
54+
55+
:param type: Type of data.
56+
:type type: GetRuleVersionHistoryDataType, optional
57+
"""
58+
if attributes is not unset:
59+
kwargs["attributes"] = attributes
60+
if id is not unset:
61+
kwargs["id"] = id
62+
if type is not unset:
63+
kwargs["type"] = type
64+
super().__init__(kwargs)

0 commit comments

Comments
 (0)