Skip to content

Commit ee1590f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2a2b481 of spec repo
1 parent 6b9db6e commit ee1590f

12 files changed

+337
-4
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": "df31e44",
3-
"generated": "2025-07-28 19:54:26.502"
2+
"spec_repo_commit": "2a2b481",
3+
"generated": "2025-07-31 08:51:15.008"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34920,6 +34920,27 @@ components:
3492034920
- $ref: '#/components/schemas/SecurityMonitoringStandardRulePayload'
3492134921
- $ref: '#/components/schemas/SecurityMonitoringSignalRulePayload'
3492234922
- $ref: '#/components/schemas/CloudConfigurationRulePayload'
34923+
SecurityMonitoringSchedulingOptions:
34924+
description: Options for scheduled rules. When this field is present, the rule
34925+
runs based on the schedule. When absent, it runs real-time on ingested logs.
34926+
nullable: true
34927+
properties:
34928+
rrule:
34929+
description: Schedule for the rule queries, written in RRULE syntax. See
34930+
[RFC](https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html)
34931+
for syntax reference.
34932+
example: FREQ=HOURLY;INTERVAL=1;
34933+
type: string
34934+
start:
34935+
description: Start date for the schedule, in ISO 8601 format without timezone.
34936+
example: '2025-07-14T12:00:00'
34937+
type: string
34938+
timezone:
34939+
description: Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
34940+
format.
34941+
example: America/New_York
34942+
type: string
34943+
type: object
3492334944
SecurityMonitoringSignal:
3492434945
description: Object description of a security signal.
3492534946
properties:
@@ -35598,6 +35619,12 @@ components:
3559835619
SecurityMonitoringStandardRuleCreatePayload:
3559935620
description: Create a new rule.
3560035621
properties:
35622+
calculatedFields:
35623+
description: Calculated fields. Only allowed for scheduled rules, i.e. when
35624+
schedulingOptions is also defined.
35625+
items:
35626+
$ref: '#/components/schemas/CalculatedField'
35627+
type: array
3560135628
cases:
3560235629
description: Cases for generating signals.
3560335630
example: []
@@ -35650,6 +35677,8 @@ components:
3565035677
items:
3565135678
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
3565235679
type: array
35680+
schedulingOptions:
35681+
$ref: '#/components/schemas/SecurityMonitoringSchedulingOptions'
3565335682
tags:
3565435683
description: Tags for generated signals.
3565535684
example:
@@ -35795,6 +35824,14 @@ components:
3579535824
example: false
3579635825
readOnly: true
3579735826
type: boolean
35827+
index:
35828+
description: '**This field is currently unstable and might be removed in
35829+
a minor version upgrade.**
35830+
35831+
The index to run the query on, if the `dataSource` is `logs`. Only used
35832+
for scheduled rules, i.e. when the `schedulingOptions` field is present
35833+
in the rule payload.'
35834+
type: string
3579835835
metric:
3579935836
deprecated: true
3580035837
description: '(Deprecated) The target field to aggregate over when using
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-07-31T07:48:27.113Z

cassettes/features/v2/security_monitoring/Create-a-scheduled-detection-rule-returns-OK-response.yml

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-07-31T07:49:14.474Z

cassettes/features/v2/security_monitoring/Create-a-scheduled-rule-without-rrule-returns-Bad-Request-response.yml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Create a scheduled detection rule returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5+
6+
body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7+
name: "Example-Security-Monitoring",
8+
queries: [
9+
DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
10+
query: "@test:true",
11+
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
12+
group_by_fields: [],
13+
distinct_fields: [],
14+
index: "main",
15+
}),
16+
],
17+
filters: [],
18+
cases: [
19+
DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
20+
name: "",
21+
status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
22+
condition: "a > 0",
23+
notifications: [],
24+
}),
25+
],
26+
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
27+
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::FIFTEEN_MINUTES,
28+
keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::ONE_HOUR,
29+
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::ONE_DAY,
30+
}),
31+
message: "Test rule",
32+
tags: [],
33+
is_enabled: true,
34+
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION,
35+
scheduling_options: DatadogAPIClient::V2::SecurityMonitoringSchedulingOptions.new({
36+
rrule: "FREQ=HOURLY;INTERVAL=2;",
37+
start: "2025-06-18T12:00:00",
38+
timezone: "Europe/Paris",
39+
}),
40+
})
41+
p api_instance.create_security_monitoring_rule(body)

features/v2/security_monitoring.feature

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,24 @@ Feature: Security Monitoring
295295
When the request is sent
296296
Then the response status is 201 Successfully created the notification rule.
297297

298+
@team:DataDog/k9-cloud-security-platform
299+
Scenario: Create a scheduled detection rule returns "OK" response
300+
Given new "CreateSecurityMonitoringRule" request
301+
And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"index":"main"}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "schedulingOptions": {"rrule": "FREQ=HOURLY;INTERVAL=2;", "start": "2025-06-18T12:00:00", "timezone": "Europe/Paris"}}
302+
When the request is sent
303+
Then the response status is 200 OK
304+
And the response "name" is equal to "{{ unique }}"
305+
And the response "type" is equal to "log_detection"
306+
And the response "message" is equal to "Test rule"
307+
And the response "schedulingOptions" is equal to {"rrule": "FREQ=HOURLY;INTERVAL=2;", "start": "2025-06-18T12:00:00", "timezone": "Europe/Paris"}
308+
309+
@team:DataDog/k9-cloud-security-platform
310+
Scenario: Create a scheduled rule without rrule returns "Bad Request" response
311+
Given new "CreateSecurityMonitoringRule" request
312+
And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"index":"main"}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "schedulingOptions": {"start": "2025-06-18T12:00:00", "timezone": "Europe/Paris"}}
313+
When the request is sent
314+
Then the response status is 400 Bad Request
315+
298316
@generated @skip @team:DataDog/k9-cloud-security-platform
299317
Scenario: Create a security filter returns "Bad Request" response
300318
Given new "CreateSecurityFilter" request

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,7 @@ def overrides
30963096
"v2.security_monitoring_rule_type_test" => "SecurityMonitoringRuleTypeTest",
30973097
"v2.security_monitoring_rule_update_payload" => "SecurityMonitoringRuleUpdatePayload",
30983098
"v2.security_monitoring_rule_validate_payload" => "SecurityMonitoringRuleValidatePayload",
3099+
"v2.security_monitoring_scheduling_options" => "SecurityMonitoringSchedulingOptions",
30993100
"v2.security_monitoring_signal" => "SecurityMonitoringSignal",
31003101
"v2.security_monitoring_signal_archive_reason" => "SecurityMonitoringSignalArchiveReason",
31013102
"v2.security_monitoring_signal_assignee_update_attributes" => "SecurityMonitoringSignalAssigneeUpdateAttributes",
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# 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.
21+
class SecurityMonitoringSchedulingOptions
22+
include BaseGenericModel
23+
24+
# 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.
25+
attr_accessor :rrule
26+
27+
# Start date for the schedule, in ISO 8601 format without timezone.
28+
attr_accessor :start
29+
30+
# Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format.
31+
attr_accessor :timezone
32+
33+
attr_accessor :additional_properties
34+
35+
# Attribute mapping from ruby-style variable name to JSON key.
36+
# @!visibility private
37+
def self.attribute_map
38+
{
39+
:'rrule' => :'rrule',
40+
:'start' => :'start',
41+
:'timezone' => :'timezone'
42+
}
43+
end
44+
45+
# Attribute type mapping.
46+
# @!visibility private
47+
def self.openapi_types
48+
{
49+
:'rrule' => :'String',
50+
:'start' => :'String',
51+
:'timezone' => :'String'
52+
}
53+
end
54+
55+
# Initializes the object
56+
# @param attributes [Hash] Model attributes in the form of hash
57+
# @!visibility private
58+
def initialize(attributes = {})
59+
if (!attributes.is_a?(Hash))
60+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringSchedulingOptions` initialize method"
61+
end
62+
63+
self.additional_properties = {}
64+
# check to see if the attribute exists and convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}) { |(k, v), h|
66+
if (!self.class.attribute_map.key?(k.to_sym))
67+
self.additional_properties[k.to_sym] = v
68+
else
69+
h[k.to_sym] = v
70+
end
71+
}
72+
73+
if attributes.key?(:'rrule')
74+
self.rrule = attributes[:'rrule']
75+
end
76+
77+
if attributes.key?(:'start')
78+
self.start = attributes[:'start']
79+
end
80+
81+
if attributes.key?(:'timezone')
82+
self.timezone = attributes[:'timezone']
83+
end
84+
end
85+
86+
# Returns the object in the form of hash, with additionalProperties support.
87+
# @return [Hash] Returns the object in the form of hash
88+
# @!visibility private
89+
def to_hash
90+
hash = {}
91+
self.class.attribute_map.each_pair do |attr, param|
92+
value = self.send(attr)
93+
if value.nil?
94+
is_nullable = self.class.openapi_nullable.include?(attr)
95+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96+
end
97+
98+
hash[param] = _to_hash(value)
99+
end
100+
self.additional_properties.each_pair do |attr, value|
101+
hash[attr] = value
102+
end
103+
hash
104+
end
105+
106+
# Checks equality by comparing each attribute.
107+
# @param o [Object] Object to be compared
108+
# @!visibility private
109+
def ==(o)
110+
return true if self.equal?(o)
111+
self.class == o.class &&
112+
rrule == o.rrule &&
113+
start == o.start &&
114+
timezone == o.timezone &&
115+
additional_properties == o.additional_properties
116+
end
117+
118+
# Calculates hash code according to all attributes.
119+
# @return [Integer] Hash code
120+
# @!visibility private
121+
def hash
122+
[rrule, start, timezone, additional_properties].hash
123+
end
124+
end
125+
end

0 commit comments

Comments
 (0)