Skip to content

Commit a795734

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

23 files changed

+442
-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": "8c7731a",
3+
"generated": "2025-08-04 14:55:31.903"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36257,6 +36257,12 @@ components:
3625736257
SecurityMonitoringRuleUpdatePayload:
3625836258
description: Update an existing rule.
3625936259
properties:
36260+
calculatedFields:
36261+
description: Calculated fields. Only allowed for scheduled rules - in other
36262+
words, when schedulingOptions is also defined.
36263+
items:
36264+
$ref: '#/components/schemas/CalculatedField'
36265+
type: array
3626036266
cases:
3626136267
description: Cases for generating signals.
3626236268
items:
@@ -36313,6 +36319,8 @@ components:
3631336319
items:
3631436320
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3631536321
type: array
36322+
schedulingOptions:
36323+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3631636324
tags:
3631736325
description: Tags for generated signals.
3631836326
items:
@@ -36339,6 +36347,27 @@ components:
3633936347
- $ref: '#/components/schemas/SecurityMonitoringStandardRulePayload'
3634036348
- $ref: '#/components/schemas/SecurityMonitoringSignalRulePayload'
3634136349
- $ref: '#/components/schemas/CloudConfigurationRulePayload'
36350+
SecurityMonitoringSchedulingOptions:
36351+
description: Options for scheduled rules. When this field is present, the rule
36352+
runs based on the schedule. When absent, it runs real-time on ingested logs.
36353+
nullable: true
36354+
properties:
36355+
rrule:
36356+
description: Schedule for the rule queries, written in RRULE syntax. See
36357+
[RFC](https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html)
36358+
for syntax reference.
36359+
example: FREQ=HOURLY;INTERVAL=1;
36360+
type: string
36361+
start:
36362+
description: Start date for the schedule, in ISO 8601 format without timezone.
36363+
example: '2025-07-14T12:00:00'
36364+
type: string
36365+
timezone:
36366+
description: Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
36367+
format.
36368+
example: America/New_York
36369+
type: string
36370+
type: object
3634236371
SecurityMonitoringSignal:
3634336372
description: Object description of a security signal.
3634436373
properties:
@@ -37017,6 +37046,12 @@ components:
3701737046
SecurityMonitoringStandardRuleCreatePayload:
3701837047
description: Create a new rule.
3701937048
properties:
37049+
calculatedFields:
37050+
description: Calculated fields. Only allowed for scheduled rules - in other
37051+
words, when schedulingOptions is also defined.
37052+
items:
37053+
$ref: '#/components/schemas/CalculatedField'
37054+
type: array
3702037055
cases:
3702137056
description: Cases for generating signals.
3702237057
example: []
@@ -37069,6 +37104,8 @@ components:
3706937104
items:
3707037105
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3707137106
type: array
37107+
schedulingOptions:
37108+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3707237109
tags:
3707337110
description: Tags for generated signals.
3707437111
example:
@@ -37098,6 +37135,12 @@ components:
3709837135
SecurityMonitoringStandardRulePayload:
3709937136
description: The payload of a rule.
3710037137
properties:
37138+
calculatedFields:
37139+
description: Calculated fields. Only allowed for scheduled rules - in other
37140+
words, when schedulingOptions is also defined.
37141+
items:
37142+
$ref: '#/components/schemas/CalculatedField'
37143+
type: array
3710137144
cases:
3710237145
description: Cases for generating signals.
3710337146
example: []
@@ -37158,6 +37201,8 @@ components:
3715837201
items:
3715937202
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3716037203
type: array
37204+
schedulingOptions:
37205+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3716137206
tags:
3716237207
description: Tags for generated signals.
3716337208
example:
@@ -37214,6 +37259,14 @@ components:
3721437259
example: false
3721537260
readOnly: true
3721637261
type: boolean
37262+
index:
37263+
description: '**This field is currently unstable and might be removed in
37264+
a minor version upgrade.**
37265+
37266+
The index to run the query on, if the `dataSource` is `logs`. Only used
37267+
for scheduled rules - in other words, when the `schedulingOptions` field
37268+
is present in the rule payload.'
37269+
type: string
3721737270
metric:
3721837271
deprecated: true
3721937272
description: '(Deprecated) The target field to aggregate over when using
@@ -37241,6 +37294,12 @@ components:
3724137294
SecurityMonitoringStandardRuleResponse:
3724237295
description: Rule.
3724337296
properties:
37297+
calculatedFields:
37298+
description: Calculated fields. Only allowed for scheduled rules - in other
37299+
words, when schedulingOptions is also defined.
37300+
items:
37301+
$ref: '#/components/schemas/CalculatedField'
37302+
type: array
3724437303
cases:
3724537304
description: Cases for generating signals.
3724637305
items:
@@ -37326,6 +37385,8 @@ components:
3732637385
items:
3732737386
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3732837387
type: array
37388+
schedulingOptions:
37389+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3732937390
tags:
3733037391
description: Tags for generated signals.
3733137392
items:
@@ -37357,6 +37418,12 @@ components:
3735737418
SecurityMonitoringStandardRuleTestPayload:
3735837419
description: The payload of a rule to test
3735937420
properties:
37421+
calculatedFields:
37422+
description: Calculated fields. Only allowed for scheduled rules - in other
37423+
words, when schedulingOptions is also defined.
37424+
items:
37425+
$ref: '#/components/schemas/CalculatedField'
37426+
type: array
3736037427
cases:
3736137428
description: Cases for generating signals.
3736237429
example: []
@@ -37409,6 +37476,8 @@ components:
3740937476
items:
3741037477
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3741137478
type: array
37479+
schedulingOptions:
37480+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3741237481
tags:
3741337482
description: Tags for generated signals.
3741437483
example:

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_convert_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
Convert a rule from JSON to Terraform.
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
@@ -51,6 +54,9 @@ def __init__(self, **kwargs):
5154
:param reference_tables: Reference tables for the rule.
5255
:type reference_tables: [SecurityMonitoringReferenceTable], optional
5356
57+
: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.
58+
:type scheduling_options: SecurityMonitoringSchedulingOptions, none_type, optional
59+
5460
:param tags: Tags for generated signals.
5561
:type tags: [str], optional
5662

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

src/datadog_api_client/v2/model/security_monitoring_rule_test_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
Test a 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

0 commit comments

Comments
 (0)