Skip to content

Commit c129895

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 578e092 of spec repo
1 parent 2348f30 commit c129895

6 files changed

+105
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47358,6 +47358,8 @@ components:
4735847358
properties:
4735947359
forgetAfter:
4736047360
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter'
47361+
instantaneousBaseline:
47362+
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline'
4736147363
learningDuration:
4736247364
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration'
4736347365
learningMethod:
@@ -47383,6 +47385,13 @@ components:
4738347385
- TWO_WEEKS
4738447386
- THREE_WEEKS
4738547387
- FOUR_WEEKS
47388+
SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline:
47389+
description: When set to true, Datadog uses previous values that fall within
47390+
the defined learning window to construct the baseline, enabling the system
47391+
to establish an accurate baseline more rapidly rather than relying solely
47392+
on gradual learning over time.
47393+
example: false
47394+
type: boolean
4738647395
SecurityMonitoringRuleNewValueOptionsLearningDuration:
4738747396
default: 0
4738847397
description: 'The duration in days during which values are learned, and after
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-12-10T08:37:17.537Z

cassettes/features/v2/security_monitoring/Validate-a-detection-rule-with-detection-method-new-value-with-enabled-feature-instantaneousBaseline-returns-OK-response.yml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Validate a detection rule with detection method 'new_value' with enabled feature 'instantaneousBaseline' returns "OK"
2+
response
3+
4+
require "datadog_api_client"
5+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
6+
7+
body = DatadogAPIClient::V2::SecurityMonitoringStandardRulePayload.new({
8+
cases: [
9+
DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
10+
name: "",
11+
status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
12+
notifications: [],
13+
}),
14+
],
15+
has_extended_title: true,
16+
is_enabled: true,
17+
message: "My security monitoring rule",
18+
name: "My security monitoring rule",
19+
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
20+
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES,
21+
keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::FIVE_MINUTES,
22+
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::TEN_MINUTES,
23+
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::NEW_VALUE,
24+
new_value_options: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptions.new({
25+
forget_after: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsForgetAfter::ONE_WEEK,
26+
instantaneous_baseline: true,
27+
learning_duration: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningDuration::ONE_DAY,
28+
learning_threshold: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningThreshold::ZERO_OCCURRENCES,
29+
learning_method: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningMethod::DURATION,
30+
}),
31+
}),
32+
queries: [
33+
DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
34+
query: "source:source_here",
35+
group_by_fields: [
36+
"@userIdentity.assumed_role",
37+
],
38+
distinct_fields: [],
39+
metric: "name",
40+
metrics: [
41+
"name",
42+
],
43+
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::NEW_VALUE,
44+
name: "",
45+
data_source: DatadogAPIClient::V2::SecurityMonitoringStandardDataSource::LOGS,
46+
}),
47+
],
48+
tags: [
49+
"env:prod",
50+
"team:security",
51+
],
52+
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION,
53+
})
54+
api_instance.validate_security_monitoring_rule(body)

features/v2/security_monitoring.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,13 @@ Feature: Security Monitoring
17971797
When the request is sent
17981798
Then the response status is 204 OK
17991799

1800+
@team:DataDog/k9-cloud-security-platform
1801+
Scenario: Validate a detection rule with detection method 'new_value' with enabled feature 'instantaneousBaseline' returns "OK" response
1802+
Given new "ValidateSecurityMonitoringRule" request
1803+
And body with value {"cases":[{"name":"","status":"info","notifications":[]}],"hasExtendedTitle":true,"isEnabled":true,"message":"My security monitoring rule","name":"My security monitoring rule","options":{"evaluationWindow":0,"keepAlive":300,"maxSignalDuration":600,"detectionMethod":"new_value","newValueOptions":{"forgetAfter":7,"instantaneousBaseline":true,"learningDuration":1,"learningThreshold":0,"learningMethod":"duration"}},"queries":[{"query":"source:source_here","groupByFields":["@userIdentity.assumed_role"],"distinctFields":[],"metric":"name","metrics":["name"],"aggregation":"new_value","name":"","dataSource":"logs"}],"tags":["env:prod","team:security"],"type":"log_detection"}
1804+
When the request is sent
1805+
Then the response status is 204 OK
1806+
18001807
@team:DataDog/k9-cloud-security-platform
18011808
Scenario: Validate a detection rule with detection method 'sequence_detection' returns "OK" response
18021809
Given new "ValidateSecurityMonitoringRule" request

lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class SecurityMonitoringRuleNewValueOptions
2424
# The duration in days after which a learned value is forgotten.
2525
attr_accessor :forget_after
2626

27+
# When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
28+
attr_accessor :instantaneous_baseline
29+
2730
# The duration in days during which values are learned, and after which signals will be generated for values that
2831
# weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
2932
attr_accessor :learning_duration
@@ -41,6 +44,7 @@ class SecurityMonitoringRuleNewValueOptions
4144
def self.attribute_map
4245
{
4346
:'forget_after' => :'forgetAfter',
47+
:'instantaneous_baseline' => :'instantaneousBaseline',
4448
:'learning_duration' => :'learningDuration',
4549
:'learning_method' => :'learningMethod',
4650
:'learning_threshold' => :'learningThreshold'
@@ -52,6 +56,7 @@ def self.attribute_map
5256
def self.openapi_types
5357
{
5458
:'forget_after' => :'SecurityMonitoringRuleNewValueOptionsForgetAfter',
59+
:'instantaneous_baseline' => :'Boolean',
5560
:'learning_duration' => :'SecurityMonitoringRuleNewValueOptionsLearningDuration',
5661
:'learning_method' => :'SecurityMonitoringRuleNewValueOptionsLearningMethod',
5762
:'learning_threshold' => :'SecurityMonitoringRuleNewValueOptionsLearningThreshold'
@@ -80,6 +85,10 @@ def initialize(attributes = {})
8085
self.forget_after = attributes[:'forget_after']
8186
end
8287

88+
if attributes.key?(:'instantaneous_baseline')
89+
self.instantaneous_baseline = attributes[:'instantaneous_baseline']
90+
end
91+
8392
if attributes.key?(:'learning_duration')
8493
self.learning_duration = attributes[:'learning_duration']
8594
end
@@ -120,6 +129,7 @@ def ==(o)
120129
return true if self.equal?(o)
121130
self.class == o.class &&
122131
forget_after == o.forget_after &&
132+
instantaneous_baseline == o.instantaneous_baseline &&
123133
learning_duration == o.learning_duration &&
124134
learning_method == o.learning_method &&
125135
learning_threshold == o.learning_threshold &&
@@ -130,7 +140,7 @@ def ==(o)
130140
# @return [Integer] Hash code
131141
# @!visibility private
132142
def hash
133-
[forget_after, learning_duration, learning_method, learning_threshold, additional_properties].hash
143+
[forget_after, instantaneous_baseline, learning_duration, learning_method, learning_threshold, additional_properties].hash
134144
end
135145
end
136146
end

0 commit comments

Comments
 (0)