Skip to content

Commit c39e66c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c0579e7 of spec repo
1 parent 720f5e8 commit c39e66c

17 files changed

+331
-2
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "b75095c",
3-
"generated": "2025-07-31 10:46:07.850"
2+
"spec_repo_commit": "c0579e7",
3+
"generated": "2025-07-31 14:42:44.051"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34956,6 +34956,27 @@ components:
3495634956
- $ref: '#/components/schemas/SecurityMonitoringStandardRulePayload'
3495734957
- $ref: '#/components/schemas/SecurityMonitoringSignalRulePayload'
3495834958
- $ref: '#/components/schemas/CloudConfigurationRulePayload'
34959+
SecurityMonitoringSchedulingOptions:
34960+
description: Options for scheduled rules. When this field is present, the rule
34961+
runs based on the schedule. When absent, it runs real-time on ingested logs.
34962+
nullable: true
34963+
properties:
34964+
rrule:
34965+
description: Schedule for the rule queries, written in RRULE syntax. See
34966+
[RFC](https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html)
34967+
for syntax reference.
34968+
example: FREQ=HOURLY;INTERVAL=1;
34969+
type: string
34970+
start:
34971+
description: Start date for the schedule, in ISO 8601 format without timezone.
34972+
example: '2025-07-14T12:00:00'
34973+
type: string
34974+
timezone:
34975+
description: Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
34976+
format.
34977+
example: America/New_York
34978+
type: string
34979+
type: object
3495934980
SecurityMonitoringSignal:
3496034981
description: Object description of a security signal.
3496134982
properties:
@@ -35634,6 +35655,12 @@ components:
3563435655
SecurityMonitoringStandardRuleCreatePayload:
3563535656
description: Create a new rule.
3563635657
properties:
35658+
calculatedFields:
35659+
description: Calculated fields. Only allowed for scheduled rules, i.e. when
35660+
schedulingOptions is also defined.
35661+
items:
35662+
$ref: '#/components/schemas/CalculatedField'
35663+
type: array
3563735664
cases:
3563835665
description: Cases for generating signals.
3563935666
example: []
@@ -35686,6 +35713,8 @@ components:
3568635713
items:
3568735714
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3568835715
type: array
35716+
schedulingOptions:
35717+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3568935718
tags:
3569035719
description: Tags for generated signals.
3569135720
example:
@@ -35831,6 +35860,14 @@ components:
3583135860
example: false
3583235861
readOnly: true
3583335862
type: boolean
35863+
index:
35864+
description: '**This field is currently unstable and might be removed in
35865+
a minor version upgrade.**
35866+
35867+
The index to run the query on, if the `dataSource` is `logs`. Only used
35868+
for scheduled rules, i.e. when the `schedulingOptions` field is present
35869+
in the rule payload.'
35870+
type: string
3583435871
metric:
3583535872
deprecated: true
3583635873
description: '(Deprecated) The target field to aggregate over when using
@@ -35858,6 +35895,12 @@ components:
3585835895
SecurityMonitoringStandardRuleResponse:
3585935896
description: Rule.
3586035897
properties:
35898+
calculatedFields:
35899+
description: Calculated fields. Only allowed for scheduled rules, i.e. when
35900+
schedulingOptions is also defined.
35901+
items:
35902+
$ref: '#/components/schemas/CalculatedField'
35903+
type: array
3586135904
cases:
3586235905
description: Cases for generating signals.
3586335906
items:
@@ -35943,6 +35986,8 @@ components:
3594335986
items:
3594435987
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3594535988
type: array
35989+
schedulingOptions:
35990+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3594635991
tags:
3594735992
description: Tags for generated signals.
3594835993
items:

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15229,6 +15229,13 @@ datadog\_api\_client.v2.model.security\_monitoring\_rule\_validate\_payload modu
1522915229
:members:
1523015230
:show-inheritance:
1523115231

15232+
datadog\_api\_client.v2.model.security\_monitoring\_scheduling\_options module
15233+
------------------------------------------------------------------------------
15234+
15235+
.. automodule:: datadog_api_client.v2.model.security_monitoring_scheduling_options
15236+
:members:
15237+
:show-inheritance:
15238+
1523215239
datadog\_api\_client.v2.model.security\_monitoring\_signal module
1523315240
-----------------------------------------------------------------
1523415241

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
"""
2+
Create a scheduled detection rule 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+
from datadog_api_client.v2.model.security_monitoring_rule_case_create import SecurityMonitoringRuleCaseCreate
8+
from datadog_api_client.v2.model.security_monitoring_rule_evaluation_window import (
9+
SecurityMonitoringRuleEvaluationWindow,
10+
)
11+
from datadog_api_client.v2.model.security_monitoring_rule_keep_alive import SecurityMonitoringRuleKeepAlive
12+
from datadog_api_client.v2.model.security_monitoring_rule_max_signal_duration import (
13+
SecurityMonitoringRuleMaxSignalDuration,
14+
)
15+
from datadog_api_client.v2.model.security_monitoring_rule_options import SecurityMonitoringRuleOptions
16+
from datadog_api_client.v2.model.security_monitoring_rule_query_aggregation import (
17+
SecurityMonitoringRuleQueryAggregation,
18+
)
19+
from datadog_api_client.v2.model.security_monitoring_rule_severity import SecurityMonitoringRuleSeverity
20+
from datadog_api_client.v2.model.security_monitoring_rule_type_create import SecurityMonitoringRuleTypeCreate
21+
from datadog_api_client.v2.model.security_monitoring_scheduling_options import SecurityMonitoringSchedulingOptions
22+
from datadog_api_client.v2.model.security_monitoring_standard_rule_create_payload import (
23+
SecurityMonitoringStandardRuleCreatePayload,
24+
)
25+
from datadog_api_client.v2.model.security_monitoring_standard_rule_query import SecurityMonitoringStandardRuleQuery
26+
27+
body = SecurityMonitoringStandardRuleCreatePayload(
28+
name="Example-Security-Monitoring",
29+
queries=[
30+
SecurityMonitoringStandardRuleQuery(
31+
query="@test:true",
32+
aggregation=SecurityMonitoringRuleQueryAggregation.COUNT,
33+
group_by_fields=[],
34+
distinct_fields=[],
35+
index="main",
36+
),
37+
],
38+
filters=[],
39+
cases=[
40+
SecurityMonitoringRuleCaseCreate(
41+
name="",
42+
status=SecurityMonitoringRuleSeverity.INFO,
43+
condition="a > 0",
44+
notifications=[],
45+
),
46+
],
47+
options=SecurityMonitoringRuleOptions(
48+
evaluation_window=SecurityMonitoringRuleEvaluationWindow.FIFTEEN_MINUTES,
49+
keep_alive=SecurityMonitoringRuleKeepAlive.ONE_HOUR,
50+
max_signal_duration=SecurityMonitoringRuleMaxSignalDuration.ONE_DAY,
51+
),
52+
message="Test rule",
53+
tags=[],
54+
is_enabled=True,
55+
type=SecurityMonitoringRuleTypeCreate.LOG_DETECTION,
56+
scheduling_options=SecurityMonitoringSchedulingOptions(
57+
rrule="FREQ=HOURLY;INTERVAL=2;",
58+
start="2025-06-18T12:00:00",
59+
timezone="Europe/Paris",
60+
),
61+
)
62+
63+
configuration = Configuration()
64+
with ApiClient(configuration) as api_client:
65+
api_instance = SecurityMonitoringApi(api_client)
66+
response = api_instance.create_security_monitoring_rule(body=body)
67+
68+
print(response)

src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def __init__(self, **kwargs):
1515
"""
1616
Create a new rule.
1717
18+
:param calculated_fields: Calculated fields. Only allowed for scheduled rules, i.e. when schedulingOptions is also defined.
19+
:type calculated_fields: [CalculatedField], optional
20+
1821
:param cases: Cases for generating signals.
1922
:type cases: [SecurityMonitoringRuleCaseCreate]
2023
@@ -45,6 +48,9 @@ def __init__(self, **kwargs):
4548
:param reference_tables: Reference tables for the rule.
4649
:type reference_tables: [SecurityMonitoringReferenceTable], optional
4750
51+
:param scheduling_options: Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs.
52+
:type scheduling_options: SecurityMonitoringSchedulingOptions, none_type, optional
53+
4854
:param tags: Tags for generated signals.
4955
:type tags: [str], optional
5056

src/datadog_api_client/v2/model/security_monitoring_rule_query.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def __init__(self, **kwargs):
3333
:param has_optional_group_by_fields: When false, events without a group-by value are ignored by the rule. When true, events with missing group-by fields are processed with `N/A`, replacing the missing values.
3434
:type has_optional_group_by_fields: bool, optional
3535
36+
:param index: **This field is currently unstable and might be removed in a minor version upgrade.**
37+
The index to run the query on, if the `dataSource` is `logs`. Only used for scheduled rules, i.e. when the `schedulingOptions` field is present in the rule payload.
38+
:type index: str, optional
39+
3640
:param metric: (Deprecated) The target field to aggregate over when using the sum or max
3741
aggregations. `metrics` field should be used instead.
3842
:type metric: str, optional

src/datadog_api_client/v2/model/security_monitoring_rule_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def __init__(self, **kwargs):
1515
"""
1616
Create a new rule.
1717
18+
:param calculated_fields: Calculated fields. Only allowed for scheduled rules, i.e. when schedulingOptions is also defined.
19+
:type calculated_fields: [CalculatedField], optional
20+
1821
:param cases: Cases for generating signals.
1922
:type cases: [SecurityMonitoringRuleCase], optional
2023
@@ -75,6 +78,9 @@ def __init__(self, **kwargs):
7578
:param reference_tables: Reference tables for the rule.
7679
:type reference_tables: [SecurityMonitoringReferenceTable], optional
7780
81+
:param scheduling_options: Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs.
82+
:type scheduling_options: SecurityMonitoringSchedulingOptions, none_type, optional
83+
7884
:param tags: Tags for generated signals.
7985
:type tags: [str], optional
8086
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
class SecurityMonitoringSchedulingOptions(ModelNormal):
17+
_nullable = True
18+
19+
@cached_property
20+
def openapi_types(_):
21+
return {
22+
"rrule": (str,),
23+
"start": (str,),
24+
"timezone": (str,),
25+
}
26+
27+
attribute_map = {
28+
"rrule": "rrule",
29+
"start": "start",
30+
"timezone": "timezone",
31+
}
32+
33+
def __init__(
34+
self_,
35+
rrule: Union[str, UnsetType] = unset,
36+
start: Union[str, UnsetType] = unset,
37+
timezone: Union[str, UnsetType] = unset,
38+
**kwargs,
39+
):
40+
"""
41+
Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs.
42+
43+
:param rrule: Schedule for the rule queries, written in RRULE syntax. See `RFC <https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html>`_ for syntax reference.
44+
:type rrule: str, optional
45+
46+
:param start: Start date for the schedule, in ISO 8601 format without timezone.
47+
:type start: str, optional
48+
49+
:param timezone: Time zone of the start date, in the `tz database <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_ format.
50+
:type timezone: str, optional
51+
"""
52+
if rrule is not unset:
53+
kwargs["rrule"] = rrule
54+
if start is not unset:
55+
kwargs["start"] = start
56+
if timezone is not unset:
57+
kwargs["timezone"] = timezone
58+
super().__init__(kwargs)

0 commit comments

Comments
 (0)