Skip to content

Commit b643447

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ccc8320 of spec repo
1 parent 90a1577 commit b643447

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": "35630f3",
3-
"generated": "2025-08-01 18:17:32.476"
2+
"spec_repo_commit": "ccc8320",
3+
"generated": "2025-08-04 12:17:58.830"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36339,6 +36339,27 @@ components:
3633936339
- $ref: '#/components/schemas/SecurityMonitoringStandardRulePayload'
3634036340
- $ref: '#/components/schemas/SecurityMonitoringSignalRulePayload'
3634136341
- $ref: '#/components/schemas/CloudConfigurationRulePayload'
36342+
SecurityMonitoringSchedulingOptions:
36343+
description: Options for scheduled rules. When this field is present, the rule
36344+
runs based on the schedule. When absent, it runs real-time on ingested logs.
36345+
nullable: true
36346+
properties:
36347+
rrule:
36348+
description: Schedule for the rule queries, written in RRULE syntax. See
36349+
[RFC](https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html)
36350+
for syntax reference.
36351+
example: FREQ=HOURLY;INTERVAL=1;
36352+
type: string
36353+
start:
36354+
description: Start date for the schedule, in ISO 8601 format without timezone.
36355+
example: '2025-07-14T12:00:00'
36356+
type: string
36357+
timezone:
36358+
description: Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
36359+
format.
36360+
example: America/New_York
36361+
type: string
36362+
type: object
3634236363
SecurityMonitoringSignal:
3634336364
description: Object description of a security signal.
3634436365
properties:
@@ -37017,6 +37038,12 @@ components:
3701737038
SecurityMonitoringStandardRuleCreatePayload:
3701837039
description: Create a new rule.
3701937040
properties:
37041+
calculatedFields:
37042+
description: Calculated fields. Only allowed for scheduled rules - in other
37043+
words, when schedulingOptions is also defined.
37044+
items:
37045+
$ref: '#/components/schemas/CalculatedField'
37046+
type: array
3702037047
cases:
3702137048
description: Cases for generating signals.
3702237049
example: []
@@ -37069,6 +37096,8 @@ components:
3706937096
items:
3707037097
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3707137098
type: array
37099+
schedulingOptions:
37100+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3707237101
tags:
3707337102
description: Tags for generated signals.
3707437103
example:
@@ -37214,6 +37243,14 @@ components:
3721437243
example: false
3721537244
readOnly: true
3721637245
type: boolean
37246+
index:
37247+
description: '**This field is currently unstable and might be removed in
37248+
a minor version upgrade.**
37249+
37250+
The index to run the query on, if the `dataSource` is `logs`. Only used
37251+
for scheduled rules - in other words, when the `schedulingOptions` field
37252+
is present in the rule payload.'
37253+
type: string
3721737254
metric:
3721837255
deprecated: true
3721937256
description: '(Deprecated) The target field to aggregate over when using
@@ -37241,6 +37278,12 @@ components:
3724137278
SecurityMonitoringStandardRuleResponse:
3724237279
description: Rule.
3724337280
properties:
37281+
calculatedFields:
37282+
description: Calculated fields. Only allowed for scheduled rules - in other
37283+
words, when schedulingOptions is also defined.
37284+
items:
37285+
$ref: '#/components/schemas/CalculatedField'
37286+
type: array
3724437287
cases:
3724537288
description: Cases for generating signals.
3724637289
items:
@@ -37326,6 +37369,8 @@ components:
3732637369
items:
3732737370
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3732837371
type: array
37372+
schedulingOptions:
37373+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3732937374
tags:
3733037375
description: Tags for generated signals.
3733137376
items:

docs/datadog_api_client.v2.model.rst

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

16219+
datadog\_api\_client.v2.model.security\_monitoring\_scheduling\_options module
16220+
------------------------------------------------------------------------------
16221+
16222+
.. automodule:: datadog_api_client.v2.model.security_monitoring_scheduling_options
16223+
:members:
16224+
:show-inheritance:
16225+
1621916226
datadog\_api\_client.v2.model.security\_monitoring\_signal module
1622016227
-----------------------------------------------------------------
1622116228

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 - in other words, 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 - in other words, 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 - in other words, 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)