Skip to content

Commit aaa4d40

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3d683e08 of spec repo
1 parent 1e54c78 commit aaa4d40

16 files changed

+533
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-22 15:54:08.561505",
8-
"spec_repo_commit": "7a8ea4b1"
7+
"regenerated": "2025-01-23 15:33:50.263552",
8+
"spec_repo_commit": "3d683e08"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-22 15:54:08.576092",
13-
"spec_repo_commit": "7a8ea4b1"
12+
"regenerated": "2025-01-23 15:33:50.278037",
13+
"spec_repo_commit": "3d683e08"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12666,6 +12666,20 @@ components:
1266612666
$ref: '#/components/schemas/GetInterfacesData'
1266712667
type: array
1266812668
type: object
12669+
GetRuleVersionHistoryResponse:
12670+
description: Response object containing the version history of a rule.
12671+
properties:
12672+
count:
12673+
description: The number of rule versions.
12674+
format: int32
12675+
maximum: 2147483647
12676+
type: integer
12677+
data:
12678+
description: A list of rule versions.
12679+
items:
12680+
$ref: '#/components/schemas/RuleVersionHistory'
12681+
type: array
12682+
type: object
1266912683
GetSBOMResponse:
1267012684
description: The expected response schema when getting an SBOM.
1267112685
properties:
@@ -22930,6 +22944,42 @@ components:
2293022944
type: string
2293122945
x-enum-varnames:
2293222946
- RULE
22947+
RuleVersionHistory:
22948+
description: A rule version with a list of updates.
22949+
properties:
22950+
changes:
22951+
description: A list of changes.
22952+
items:
22953+
$ref: '#/components/schemas/RuleVersionUpdate'
22954+
type: array
22955+
rule:
22956+
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
22957+
type: object
22958+
RuleVersionUpdate:
22959+
description: A change in a rule version.
22960+
properties:
22961+
change:
22962+
description: The new value of the field.
22963+
example: cloud_provider:aws
22964+
type: string
22965+
field:
22966+
description: The field that was changed.
22967+
example: Tags
22968+
type: string
22969+
type:
22970+
$ref: '#/components/schemas/RuleVersionUpdateType'
22971+
type: object
22972+
RuleVersionUpdateType:
22973+
description: The type of change.
22974+
enum:
22975+
- create
22976+
- update
22977+
- delete
22978+
type: string
22979+
x-enum-varnames:
22980+
- CREATE
22981+
- UPDATE
22982+
- DELETE
2293322983
RumMetricCompute:
2293422984
description: The compute rule to compute the rum-based metric.
2293522985
properties:
@@ -44751,6 +44801,42 @@ paths:
4475144801
operator: OR
4475244802
permissions:
4475344803
- security_monitoring_rules_write
44804+
/api/v2/security_monitoring/rules/{rule_id}/version_history:
44805+
get:
44806+
description: Get a rule's version history.
44807+
operationId: GetRuleVersionHistory
44808+
parameters:
44809+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
44810+
- $ref: '#/components/parameters/PageSize'
44811+
- $ref: '#/components/parameters/PageNumber'
44812+
responses:
44813+
'200':
44814+
content:
44815+
application/json:
44816+
schema:
44817+
$ref: '#/components/schemas/GetRuleVersionHistoryResponse'
44818+
description: OK
44819+
'400':
44820+
$ref: '#/components/responses/BadRequestResponse'
44821+
'403':
44822+
$ref: '#/components/responses/NotAuthorizedResponse'
44823+
'404':
44824+
$ref: '#/components/responses/NotFoundResponse'
44825+
'429':
44826+
$ref: '#/components/responses/TooManyRequestsResponse'
44827+
security:
44828+
- apiKeyAuth: []
44829+
appKeyAuth: []
44830+
- AuthZ:
44831+
- security_monitoring_rules_read
44832+
summary: Get a rule's version history
44833+
tags:
44834+
- Security Monitoring
44835+
x-permission:
44836+
operator: OR
44837+
permissions:
44838+
- security_monitoring_rules_read
44839+
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.'
4475444840
/api/v2/security_monitoring/signals:
4475544841
get:
4475644842
description: 'The list endpoint returns security signals that match a search

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5233,6 +5233,13 @@ datadog\_api\_client.v2.model.get\_interfaces\_response module
52335233
:members:
52345234
:show-inheritance:
52355235

5236+
datadog\_api\_client.v2.model.get\_rule\_version\_history\_response module
5237+
--------------------------------------------------------------------------
5238+
5239+
.. automodule:: datadog_api_client.v2.model.get_rule_version_history_response
5240+
:members:
5241+
:show-inheritance:
5242+
52365243
datadog\_api\_client.v2.model.get\_sbom\_response module
52375244
--------------------------------------------------------
52385245

@@ -9790,6 +9797,27 @@ datadog\_api\_client.v2.model.rule\_type module
97909797
:members:
97919798
:show-inheritance:
97929799

9800+
datadog\_api\_client.v2.model.rule\_version\_history module
9801+
-----------------------------------------------------------
9802+
9803+
.. automodule:: datadog_api_client.v2.model.rule_version_history
9804+
:members:
9805+
:show-inheritance:
9806+
9807+
datadog\_api\_client.v2.model.rule\_version\_update module
9808+
----------------------------------------------------------
9809+
9810+
.. automodule:: datadog_api_client.v2.model.rule_version_update
9811+
:members:
9812+
:show-inheritance:
9813+
9814+
datadog\_api\_client.v2.model.rule\_version\_update\_type module
9815+
----------------------------------------------------------------
9816+
9817+
.. automodule:: datadog_api_client.v2.model.rule_version_update_type
9818+
:members:
9819+
:show-inheritance:
9820+
97939821
datadog\_api\_client.v2.model.rum\_aggregate\_bucket\_value module
97949822
------------------------------------------------------------------
97959823

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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
with ApiClient(configuration) as api_client:
14+
api_instance = SecurityMonitoringApi(api_client)
15+
response = api_instance.get_rule_version_history(
16+
rule_id=SECURITY_RULE_ID,
17+
)
18+
19+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ def __init__(
293293
"v2.delete_historical_job": False,
294294
"v2.get_finding": False,
295295
"v2.get_historical_job": False,
296+
"v2.get_rule_version_history": False,
296297
"v2.get_sbom": False,
297298
"v2.list_findings": False,
298299
"v2.list_historical_jobs": 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
@@ -63,6 +63,7 @@
6363
from datadog_api_client.v2.model.security_monitoring_rule_validate_payload import SecurityMonitoringRuleValidatePayload
6464
from datadog_api_client.v2.model.cloud_configuration_rule_payload import CloudConfigurationRulePayload
6565
from datadog_api_client.v2.model.security_monitoring_rule_update_payload import SecurityMonitoringRuleUpdatePayload
66+
from datadog_api_client.v2.model.get_rule_version_history_response import GetRuleVersionHistoryResponse
6667
from datadog_api_client.v2.model.security_monitoring_signals_list_response import SecurityMonitoringSignalsListResponse
6768
from datadog_api_client.v2.model.security_monitoring_signals_sort import SecurityMonitoringSignalsSort
6869
from datadog_api_client.v2.model.security_monitoring_signal import SecurityMonitoringSignal
@@ -467,6 +468,39 @@ def __init__(self, api_client=None):
467468
api_client=api_client,
468469
)
469470

471+
self._get_rule_version_history_endpoint = _Endpoint(
472+
settings={
473+
"response_type": (GetRuleVersionHistoryResponse,),
474+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
475+
"endpoint_path": "/api/v2/security_monitoring/rules/{rule_id}/version_history",
476+
"operation_id": "get_rule_version_history",
477+
"http_method": "GET",
478+
"version": "v2",
479+
},
480+
params_map={
481+
"rule_id": {
482+
"required": True,
483+
"openapi_types": (str,),
484+
"attribute": "rule_id",
485+
"location": "path",
486+
},
487+
"page_size": {
488+
"openapi_types": (int,),
489+
"attribute": "page[size]",
490+
"location": "query",
491+
},
492+
"page_number": {
493+
"openapi_types": (int,),
494+
"attribute": "page[number]",
495+
"location": "query",
496+
},
497+
},
498+
headers_map={
499+
"accept": ["application/json"],
500+
},
501+
api_client=api_client,
502+
)
503+
470504
self._get_sbom_endpoint = _Endpoint(
471505
settings={
472506
"response_type": (GetSBOMResponse,),
@@ -1669,6 +1703,36 @@ def get_historical_job(
16691703

16701704
return self._get_historical_job_endpoint.call_with_http_info(**kwargs)
16711705

1706+
def get_rule_version_history(
1707+
self,
1708+
rule_id: str,
1709+
*,
1710+
page_size: Union[int, UnsetType] = unset,
1711+
page_number: Union[int, UnsetType] = unset,
1712+
) -> GetRuleVersionHistoryResponse:
1713+
"""Get a rule's version history.
1714+
1715+
Get a rule's version history.
1716+
1717+
:param rule_id: The ID of the rule.
1718+
:type rule_id: str
1719+
:param page_size: Size for a given page. The maximum allowed value is 100.
1720+
:type page_size: int, optional
1721+
:param page_number: Specific page number to return.
1722+
:type page_number: int, optional
1723+
:rtype: GetRuleVersionHistoryResponse
1724+
"""
1725+
kwargs: Dict[str, Any] = {}
1726+
kwargs["rule_id"] = rule_id
1727+
1728+
if page_size is not unset:
1729+
kwargs["page_size"] = page_size
1730+
1731+
if page_number is not unset:
1732+
kwargs["page_number"] = page_number
1733+
1734+
return self._get_rule_version_history_endpoint.call_with_http_info(**kwargs)
1735+
16721736
def get_sbom(
16731737
self,
16741738
asset_type: AssetType,
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 List, 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+
19+
20+
class GetRuleVersionHistoryResponse(ModelNormal):
21+
validations = {
22+
"count": {
23+
"inclusive_maximum": 2147483647,
24+
},
25+
}
26+
27+
@cached_property
28+
def openapi_types(_):
29+
from datadog_api_client.v2.model.rule_version_history import RuleVersionHistory
30+
31+
return {
32+
"count": (int,),
33+
"data": ([RuleVersionHistory],),
34+
}
35+
36+
attribute_map = {
37+
"count": "count",
38+
"data": "data",
39+
}
40+
41+
def __init__(
42+
self_, count: Union[int, UnsetType] = unset, data: Union[List[RuleVersionHistory], UnsetType] = unset, **kwargs
43+
):
44+
"""
45+
Response object containing the version history of a rule.
46+
47+
:param count: The number of rule versions.
48+
:type count: int, optional
49+
50+
:param data: A list of rule versions.
51+
:type data: [RuleVersionHistory], optional
52+
"""
53+
if count is not unset:
54+
kwargs["count"] = count
55+
if data is not unset:
56+
kwargs["data"] = data
57+
super().__init__(kwargs)

0 commit comments

Comments
 (0)