Skip to content

Commit ddf9f44

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Deprecate metric field of Security Monitoring Rules (#1723)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3b04e15 commit ddf9f44

File tree

28 files changed

+94
-85
lines changed

28 files changed

+94
-85
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-10-14 14:06:52.995839",
8-
"spec_repo_commit": "7eb6ca7a"
7+
"regenerated": "2022-10-20 09:07:43.391926",
8+
"spec_repo_commit": "148c906a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-10-14 14:06:53.009989",
13-
"spec_repo_commit": "7eb6ca7a"
12+
"regenerated": "2022-10-20 09:07:43.404402",
13+
"spec_repo_commit": "148c906a"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8174,8 +8174,7 @@ components:
81748174
maximum: 9
81758175
type: integer
81768176
metrics:
8177-
description: Group of target fields to aggregate over when using the new
8178-
value aggregations.
8177+
description: Group of target fields to aggregate over.
81798178
items:
81808179
description: Field.
81818180
type: string
@@ -8278,8 +8277,7 @@ components:
82788277
example: d3f-ru1-e1d
82798278
type: string
82808279
metrics:
8281-
description: Group of target fields to aggregate over when using the new
8282-
value aggregations.
8280+
description: Group of target fields to aggregate over.
82838281
items:
82848282
description: Field.
82858283
type: string
@@ -8533,13 +8531,17 @@ components:
85338531
type: string
85348532
type: array
85358533
metric:
8536-
description: 'The target field to aggregate over when using the sum or max
8534+
deprecated: true
8535+
description: '(Deprecated) The target field to aggregate over when using
8536+
the sum or max
85378537

8538-
aggregations.'
8538+
aggregations. `metrics` field should be used instead.'
85398539
type: string
85408540
metrics:
8541-
description: Group of target fields to aggregate over when using the new
8542-
value aggregations.
8541+
description: Group of target fields to aggregate over when using the sum,
8542+
max, geo data, or new value aggregations. The sum, max, and geo data aggregations
8543+
only accept one value in this list, whereas the new value aggregation
8544+
accepts up to five values.
85438545
items:
85448546
description: Field.
85458547
type: string

api/datadogV2/model_security_monitoring_signal_rule_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type SecurityMonitoringSignalRuleQuery struct {
1717
CorrelatedByFields []string `json:"correlatedByFields,omitempty"`
1818
// Index of the rule query used to retrieve the correlated field.
1919
CorrelatedQueryIndex *int32 `json:"correlatedQueryIndex,omitempty"`
20-
// Group of target fields to aggregate over when using the new value aggregations.
20+
// Group of target fields to aggregate over.
2121
Metrics []string `json:"metrics,omitempty"`
2222
// Name of the query.
2323
Name *string `json:"name,omitempty"`

api/datadogV2/model_security_monitoring_signal_rule_response_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type SecurityMonitoringSignalRuleResponseQuery struct {
1818
CorrelatedQueryIndex *int32 `json:"correlatedQueryIndex,omitempty"`
1919
// Default Rule ID to match on signals.
2020
DefaultRuleId *string `json:"defaultRuleId,omitempty"`
21-
// Group of target fields to aggregate over when using the new value aggregations.
21+
// Group of target fields to aggregate over.
2222
Metrics []string `json:"metrics,omitempty"`
2323
// Name of the query.
2424
Name *string `json:"name,omitempty"`

api/datadogV2/model_security_monitoring_standard_rule_query.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ type SecurityMonitoringStandardRuleQuery struct {
1717
DistinctFields []string `json:"distinctFields,omitempty"`
1818
// Fields to group by.
1919
GroupByFields []string `json:"groupByFields,omitempty"`
20-
// The target field to aggregate over when using the sum or max
21-
// aggregations.
20+
// (Deprecated) The target field to aggregate over when using the sum or max
21+
// aggregations. `metrics` field should be used instead.
22+
// Deprecated
2223
Metric *string `json:"metric,omitempty"`
23-
// Group of target fields to aggregate over when using the new value aggregations.
24+
// Group of target fields to aggregate over when using the sum, max, geo data, or new value aggregations. The sum, max, and geo data aggregations only accept one value in this list, whereas the new value aggregation accepts up to five values.
2425
Metrics []string `json:"metrics,omitempty"`
2526
// Name of the query.
2627
Name *string `json:"name,omitempty"`
@@ -134,6 +135,7 @@ func (o *SecurityMonitoringStandardRuleQuery) SetGroupByFields(v []string) {
134135
}
135136

136137
// GetMetric returns the Metric field value if set, zero value otherwise.
138+
// Deprecated
137139
func (o *SecurityMonitoringStandardRuleQuery) GetMetric() string {
138140
if o == nil || o.Metric == nil {
139141
var ret string
@@ -144,6 +146,7 @@ func (o *SecurityMonitoringStandardRuleQuery) GetMetric() string {
144146

145147
// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise
146148
// and a boolean to check if the value has been set.
149+
// Deprecated
147150
func (o *SecurityMonitoringStandardRuleQuery) GetMetricOk() (*string, bool) {
148151
if o == nil || o.Metric == nil {
149152
return nil, false
@@ -157,6 +160,7 @@ func (o *SecurityMonitoringStandardRuleQuery) HasMetric() bool {
157160
}
158161

159162
// SetMetric gets a reference to the given string and assigns it to the Metric field.
163+
// Deprecated
160164
func (o *SecurityMonitoringStandardRuleQuery) SetMetric(v string) {
161165
o.Metric = &v
162166
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-09-27T13:06:48.381Z
1+
2022-10-19T13:36:33.262Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_returns_Bad_Request_response.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1664284008","options":{},"queries":[{"query":""}],"tags":[]}
4+
{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1666186593","options":{},"queries":[{"query":""}],"tags":[]}
55
form: {}
66
headers:
77
Accept:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-09-27T13:06:48.898Z
1+
2022-10-19T13:36:33.666Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_returns_OK_response.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_OK_response-1664284008","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}
4+
{"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_OK_response-1666186593","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
url: https://api.datadoghq.com/api/v2/security_monitoring/rules
1313
response:
1414
body: '{"creationAuthorId":1445416,"tags":[],"isEnabled":true,"hasExtendedTitle":false,"message":"Test
15-
rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1664284009174,"filters":[],"queries":[{"query":"@test:true","groupByFields":[],"aggregation":"count","name":"","distinctFields":[]}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a
16-
> 0"}],"type":"log_detection","id":"dam-cha-bya","isDefault":false,"name":"Test-Create_a_detection_rule_returns_OK_response-1664284008"}
15+
rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1666186594041,"filters":[],"queries":[{"query":"@test:true","groupByFields":[],"aggregation":"count","name":"","distinctFields":[]}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a
16+
> 0"}],"type":"log_detection","id":"2zr-mrk-aq9","isDefault":false,"name":"Test-Create_a_detection_rule_returns_OK_response-1666186593"}
1717
1818
'
1919
code: 200
@@ -29,7 +29,7 @@ interactions:
2929
Accept:
3030
- '*/*'
3131
method: DELETE
32-
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/dam-cha-bya
32+
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/2zr-mrk-aq9
3333
response:
3434
body: ''
3535
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-09-27T13:06:50.436Z
1+
2022-10-19T13:36:34.442Z

0 commit comments

Comments
 (0)