Skip to content

Commit 47b8c97

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Cloud SIEM - Add instantaneousBaseline to anomaly detection options (DataDog#3693)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8cadf7c commit 47b8c97

8 files changed

Lines changed: 264 additions & 13 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40874,6 +40874,8 @@ components:
4087440874
type: integer
4087540875
type:
4087640876
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40877+
when_full:
40878+
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4087740879
type: object
4087840880
ObservabilityPipelineMemoryBufferSizeOptions:
4087940881
description: Options for configuring a memory buffer by queue length.
@@ -40885,6 +40887,8 @@ components:
4088540887
type: integer
4088640888
type:
4088740889
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType'
40890+
when_full:
40891+
$ref: '#/components/schemas/ObservabilityPipelineBufferOptionsWhenFull'
4088840892
type: object
4088940893
ObservabilityPipelineMetadataEntry:
4089040894
description: A custom metadata entry.
@@ -53476,6 +53480,8 @@ components:
5347653480
$ref: '#/components/schemas/SecurityMonitoringRuleAnomalyDetectionOptionsBucketDuration'
5347753481
detectionTolerance:
5347853482
$ref: '#/components/schemas/SecurityMonitoringRuleAnomalyDetectionOptionsDetectionTolerance'
53483+
instantaneousBaseline:
53484+
$ref: '#/components/schemas/SecurityMonitoringRuleInstantaneousBaseline'
5347953485
learningDuration:
5348053486
$ref: '#/components/schemas/SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration'
5348153487
learningPeriodBaseline:
@@ -53813,6 +53819,13 @@ components:
5381353819
or credentialed API access.'
5381453820
example: true
5381553821
type: boolean
53822+
SecurityMonitoringRuleInstantaneousBaseline:
53823+
description: When set to true, Datadog uses previous values that fall within
53824+
the defined learning window to construct the baseline, enabling the system
53825+
to establish an accurate baseline more rapidly rather than relying solely
53826+
on gradual learning over time.
53827+
example: false
53828+
type: boolean
5381653829
SecurityMonitoringRuleKeepAlive:
5381753830
description: 'Once a signal is generated, the signal will remain "open" if a
5381853831
case is matched at least once within
@@ -53886,7 +53899,7 @@ components:
5388653899
forgetAfter:
5388753900
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter'
5388853901
instantaneousBaseline:
53889-
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline'
53902+
$ref: '#/components/schemas/SecurityMonitoringRuleInstantaneousBaseline'
5389053903
learningDuration:
5389153904
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration'
5389253905
learningMethod:
@@ -53912,13 +53925,6 @@ components:
5391253925
- TWO_WEEKS
5391353926
- THREE_WEEKS
5391453927
- FOUR_WEEKS
53915-
SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline:
53916-
description: When set to true, Datadog uses previous values that fall within
53917-
the defined learning window to construct the baseline, enabling the system
53918-
to establish an accurate baseline more rapidly rather than relying solely
53919-
on gradual learning over time.
53920-
example: false
53921-
type: boolean
5392253928
SecurityMonitoringRuleNewValueOptionsLearningDuration:
5392353929
default: 0
5392453930
description: 'The duration in days during which values are learned, and after

api/datadogV2/model_observability_pipeline_memory_buffer_options.go

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type ObservabilityPipelineMemoryBufferOptions struct {
1414
MaxSize *int64 `json:"max_size,omitempty"`
1515
// The type of the buffer that will be configured, a memory buffer.
1616
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
17+
// Behavior when the buffer is full (block and stop accepting new events, or drop new events)
18+
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
1719
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1820
UnparsedObject map[string]interface{} `json:"-"`
1921
AdditionalProperties map[string]interface{} `json:"-"`
@@ -27,6 +29,8 @@ func NewObservabilityPipelineMemoryBufferOptions() *ObservabilityPipelineMemoryB
2729
this := ObservabilityPipelineMemoryBufferOptions{}
2830
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
2931
this.Type = &typeVar
32+
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
33+
this.WhenFull = &whenFull
3034
return &this
3135
}
3236

@@ -37,6 +41,8 @@ func NewObservabilityPipelineMemoryBufferOptionsWithDefaults() *ObservabilityPip
3741
this := ObservabilityPipelineMemoryBufferOptions{}
3842
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
3943
this.Type = &typeVar
44+
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
45+
this.WhenFull = &whenFull
4046
return &this
4147
}
4248

@@ -96,6 +102,34 @@ func (o *ObservabilityPipelineMemoryBufferOptions) SetType(v ObservabilityPipeli
96102
o.Type = &v
97103
}
98104

105+
// GetWhenFull returns the WhenFull field value if set, zero value otherwise.
106+
func (o *ObservabilityPipelineMemoryBufferOptions) GetWhenFull() ObservabilityPipelineBufferOptionsWhenFull {
107+
if o == nil || o.WhenFull == nil {
108+
var ret ObservabilityPipelineBufferOptionsWhenFull
109+
return ret
110+
}
111+
return *o.WhenFull
112+
}
113+
114+
// GetWhenFullOk returns a tuple with the WhenFull field value if set, nil otherwise
115+
// and a boolean to check if the value has been set.
116+
func (o *ObservabilityPipelineMemoryBufferOptions) GetWhenFullOk() (*ObservabilityPipelineBufferOptionsWhenFull, bool) {
117+
if o == nil || o.WhenFull == nil {
118+
return nil, false
119+
}
120+
return o.WhenFull, true
121+
}
122+
123+
// HasWhenFull returns a boolean if a field has been set.
124+
func (o *ObservabilityPipelineMemoryBufferOptions) HasWhenFull() bool {
125+
return o != nil && o.WhenFull != nil
126+
}
127+
128+
// SetWhenFull gets a reference to the given ObservabilityPipelineBufferOptionsWhenFull and assigns it to the WhenFull field.
129+
func (o *ObservabilityPipelineMemoryBufferOptions) SetWhenFull(v ObservabilityPipelineBufferOptionsWhenFull) {
130+
o.WhenFull = &v
131+
}
132+
99133
// MarshalJSON serializes the struct using spec logic.
100134
func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error) {
101135
toSerialize := map[string]interface{}{}
@@ -108,6 +142,9 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
108142
if o.Type != nil {
109143
toSerialize["type"] = o.Type
110144
}
145+
if o.WhenFull != nil {
146+
toSerialize["when_full"] = o.WhenFull
147+
}
111148

112149
for key, value := range o.AdditionalProperties {
113150
toSerialize[key] = value
@@ -118,15 +155,16 @@ func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error)
118155
// UnmarshalJSON deserializes the given payload.
119156
func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (err error) {
120157
all := struct {
121-
MaxSize *int64 `json:"max_size,omitempty"`
122-
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
158+
MaxSize *int64 `json:"max_size,omitempty"`
159+
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
160+
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
123161
}{}
124162
if err = datadog.Unmarshal(bytes, &all); err != nil {
125163
return datadog.Unmarshal(bytes, &o.UnparsedObject)
126164
}
127165
additionalProperties := make(map[string]interface{})
128166
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
129-
datadog.DeleteKeys(additionalProperties, &[]string{"max_size", "type"})
167+
datadog.DeleteKeys(additionalProperties, &[]string{"max_size", "type", "when_full"})
130168
} else {
131169
return err
132170
}
@@ -138,6 +176,11 @@ func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (
138176
} else {
139177
o.Type = all.Type
140178
}
179+
if all.WhenFull != nil && !all.WhenFull.IsValid() {
180+
hasInvalidField = true
181+
} else {
182+
o.WhenFull = all.WhenFull
183+
}
141184

142185
if len(additionalProperties) > 0 {
143186
o.AdditionalProperties = additionalProperties

api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type ObservabilityPipelineMemoryBufferSizeOptions struct {
1414
MaxEvents *int64 `json:"max_events,omitempty"`
1515
// The type of the buffer that will be configured, a memory buffer.
1616
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
17+
// Behavior when the buffer is full (block and stop accepting new events, or drop new events)
18+
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
1719
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1820
UnparsedObject map[string]interface{} `json:"-"`
1921
AdditionalProperties map[string]interface{} `json:"-"`
@@ -27,6 +29,8 @@ func NewObservabilityPipelineMemoryBufferSizeOptions() *ObservabilityPipelineMem
2729
this := ObservabilityPipelineMemoryBufferSizeOptions{}
2830
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
2931
this.Type = &typeVar
32+
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
33+
this.WhenFull = &whenFull
3034
return &this
3135
}
3236

@@ -37,6 +41,8 @@ func NewObservabilityPipelineMemoryBufferSizeOptionsWithDefaults() *Observabilit
3741
this := ObservabilityPipelineMemoryBufferSizeOptions{}
3842
var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY
3943
this.Type = &typeVar
44+
var whenFull ObservabilityPipelineBufferOptionsWhenFull = OBSERVABILITYPIPELINEBUFFEROPTIONSWHENFULL_BLOCK
45+
this.WhenFull = &whenFull
4046
return &this
4147
}
4248

@@ -96,6 +102,34 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) SetType(v ObservabilityPi
96102
o.Type = &v
97103
}
98104

105+
// GetWhenFull returns the WhenFull field value if set, zero value otherwise.
106+
func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetWhenFull() ObservabilityPipelineBufferOptionsWhenFull {
107+
if o == nil || o.WhenFull == nil {
108+
var ret ObservabilityPipelineBufferOptionsWhenFull
109+
return ret
110+
}
111+
return *o.WhenFull
112+
}
113+
114+
// GetWhenFullOk returns a tuple with the WhenFull field value if set, nil otherwise
115+
// and a boolean to check if the value has been set.
116+
func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetWhenFullOk() (*ObservabilityPipelineBufferOptionsWhenFull, bool) {
117+
if o == nil || o.WhenFull == nil {
118+
return nil, false
119+
}
120+
return o.WhenFull, true
121+
}
122+
123+
// HasWhenFull returns a boolean if a field has been set.
124+
func (o *ObservabilityPipelineMemoryBufferSizeOptions) HasWhenFull() bool {
125+
return o != nil && o.WhenFull != nil
126+
}
127+
128+
// SetWhenFull gets a reference to the given ObservabilityPipelineBufferOptionsWhenFull and assigns it to the WhenFull field.
129+
func (o *ObservabilityPipelineMemoryBufferSizeOptions) SetWhenFull(v ObservabilityPipelineBufferOptionsWhenFull) {
130+
o.WhenFull = &v
131+
}
132+
99133
// MarshalJSON serializes the struct using spec logic.
100134
func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, error) {
101135
toSerialize := map[string]interface{}{}
@@ -108,6 +142,9 @@ func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, err
108142
if o.Type != nil {
109143
toSerialize["type"] = o.Type
110144
}
145+
if o.WhenFull != nil {
146+
toSerialize["when_full"] = o.WhenFull
147+
}
111148

112149
for key, value := range o.AdditionalProperties {
113150
toSerialize[key] = value
@@ -120,13 +157,14 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
120157
all := struct {
121158
MaxEvents *int64 `json:"max_events,omitempty"`
122159
Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,omitempty"`
160+
WhenFull *ObservabilityPipelineBufferOptionsWhenFull `json:"when_full,omitempty"`
123161
}{}
124162
if err = datadog.Unmarshal(bytes, &all); err != nil {
125163
return datadog.Unmarshal(bytes, &o.UnparsedObject)
126164
}
127165
additionalProperties := make(map[string]interface{})
128166
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
129-
datadog.DeleteKeys(additionalProperties, &[]string{"max_events", "type"})
167+
datadog.DeleteKeys(additionalProperties, &[]string{"max_events", "type", "when_full"})
130168
} else {
131169
return err
132170
}
@@ -138,6 +176,11 @@ func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byt
138176
} else {
139177
o.Type = all.Type
140178
}
179+
if all.WhenFull != nil && !all.WhenFull.IsValid() {
180+
hasInvalidField = true
181+
} else {
182+
o.WhenFull = all.WhenFull
183+
}
141184

142185
if len(additionalProperties) > 0 {
143186
o.AdditionalProperties = additionalProperties

api/datadogV2/model_security_monitoring_rule_anomaly_detection_options.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type SecurityMonitoringRuleAnomalyDetectionOptions struct {
1616
// An optional parameter that sets how permissive anomaly detection is.
1717
// Higher values require higher deviations before triggering a signal.
1818
DetectionTolerance *SecurityMonitoringRuleAnomalyDetectionOptionsDetectionTolerance `json:"detectionTolerance,omitempty"`
19+
// 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.
20+
InstantaneousBaseline *bool `json:"instantaneousBaseline,omitempty"`
1921
// Learning duration in hours. Anomaly detection waits for at least this amount of historical data before it starts evaluating.
2022
LearningDuration *SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration `json:"learningDuration,omitempty"`
2123
// An optional override baseline to apply while the rule is in the learning period. Must be greater than or equal to 0.
@@ -98,6 +100,34 @@ func (o *SecurityMonitoringRuleAnomalyDetectionOptions) SetDetectionTolerance(v
98100
o.DetectionTolerance = &v
99101
}
100102

103+
// GetInstantaneousBaseline returns the InstantaneousBaseline field value if set, zero value otherwise.
104+
func (o *SecurityMonitoringRuleAnomalyDetectionOptions) GetInstantaneousBaseline() bool {
105+
if o == nil || o.InstantaneousBaseline == nil {
106+
var ret bool
107+
return ret
108+
}
109+
return *o.InstantaneousBaseline
110+
}
111+
112+
// GetInstantaneousBaselineOk returns a tuple with the InstantaneousBaseline field value if set, nil otherwise
113+
// and a boolean to check if the value has been set.
114+
func (o *SecurityMonitoringRuleAnomalyDetectionOptions) GetInstantaneousBaselineOk() (*bool, bool) {
115+
if o == nil || o.InstantaneousBaseline == nil {
116+
return nil, false
117+
}
118+
return o.InstantaneousBaseline, true
119+
}
120+
121+
// HasInstantaneousBaseline returns a boolean if a field has been set.
122+
func (o *SecurityMonitoringRuleAnomalyDetectionOptions) HasInstantaneousBaseline() bool {
123+
return o != nil && o.InstantaneousBaseline != nil
124+
}
125+
126+
// SetInstantaneousBaseline gets a reference to the given bool and assigns it to the InstantaneousBaseline field.
127+
func (o *SecurityMonitoringRuleAnomalyDetectionOptions) SetInstantaneousBaseline(v bool) {
128+
o.InstantaneousBaseline = &v
129+
}
130+
101131
// GetLearningDuration returns the LearningDuration field value if set, zero value otherwise.
102132
func (o *SecurityMonitoringRuleAnomalyDetectionOptions) GetLearningDuration() SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration {
103133
if o == nil || o.LearningDuration == nil {
@@ -166,6 +196,9 @@ func (o SecurityMonitoringRuleAnomalyDetectionOptions) MarshalJSON() ([]byte, er
166196
if o.DetectionTolerance != nil {
167197
toSerialize["detectionTolerance"] = o.DetectionTolerance
168198
}
199+
if o.InstantaneousBaseline != nil {
200+
toSerialize["instantaneousBaseline"] = o.InstantaneousBaseline
201+
}
169202
if o.LearningDuration != nil {
170203
toSerialize["learningDuration"] = o.LearningDuration
171204
}
@@ -184,6 +217,7 @@ func (o *SecurityMonitoringRuleAnomalyDetectionOptions) UnmarshalJSON(bytes []by
184217
all := struct {
185218
BucketDuration *SecurityMonitoringRuleAnomalyDetectionOptionsBucketDuration `json:"bucketDuration,omitempty"`
186219
DetectionTolerance *SecurityMonitoringRuleAnomalyDetectionOptionsDetectionTolerance `json:"detectionTolerance,omitempty"`
220+
InstantaneousBaseline *bool `json:"instantaneousBaseline,omitempty"`
187221
LearningDuration *SecurityMonitoringRuleAnomalyDetectionOptionsLearningDuration `json:"learningDuration,omitempty"`
188222
LearningPeriodBaseline *int64 `json:"learningPeriodBaseline,omitempty"`
189223
}{}
@@ -192,7 +226,7 @@ func (o *SecurityMonitoringRuleAnomalyDetectionOptions) UnmarshalJSON(bytes []by
192226
}
193227
additionalProperties := make(map[string]interface{})
194228
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
195-
datadog.DeleteKeys(additionalProperties, &[]string{"bucketDuration", "detectionTolerance", "learningDuration", "learningPeriodBaseline"})
229+
datadog.DeleteKeys(additionalProperties, &[]string{"bucketDuration", "detectionTolerance", "instantaneousBaseline", "learningDuration", "learningPeriodBaseline"})
196230
} else {
197231
return err
198232
}
@@ -208,6 +242,7 @@ func (o *SecurityMonitoringRuleAnomalyDetectionOptions) UnmarshalJSON(bytes []by
208242
} else {
209243
o.DetectionTolerance = all.DetectionTolerance
210244
}
245+
o.InstantaneousBaseline = all.InstantaneousBaseline
211246
if all.LearningDuration != nil && !all.LearningDuration.IsValid() {
212247
hasInvalidField = true
213248
} else {

0 commit comments

Comments
 (0)