Skip to content

Commit 60d71e0

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c0579e7 of spec repo
1 parent 2fcd67a commit 60d71e0

13 files changed

+376
-5
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:45:49.687"
2+
"spec_repo_commit": "c0579e7",
3+
"generated": "2025-07-31 14:42:27.375"
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:
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
@@ -3099,6 +3099,7 @@ def overrides
30993099
"v2.security_monitoring_rule_type_test" => "SecurityMonitoringRuleTypeTest",
31003100
"v2.security_monitoring_rule_update_payload" => "SecurityMonitoringRuleUpdatePayload",
31013101
"v2.security_monitoring_rule_validate_payload" => "SecurityMonitoringRuleValidatePayload",
3102+
"v2.security_monitoring_scheduling_options" => "SecurityMonitoringSchedulingOptions",
31023103
"v2.security_monitoring_signal" => "SecurityMonitoringSignal",
31033104
"v2.security_monitoring_signal_archive_reason" => "SecurityMonitoringSignalArchiveReason",
31043105
"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)