Skip to content

Commit 5046867

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Deprecate metric field of Security Monitoring Rules (#1208)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent b1a7e8e commit 5046867

File tree

29 files changed

+93
-88
lines changed

29 files changed

+93
-88
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:46.179649",
8-
"spec_repo_commit": "7eb6ca7a"
7+
"regenerated": "2022-10-20 09:07:34.924350",
8+
"spec_repo_commit": "148c906a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-10-14 14:06:46.195461",
13-
"spec_repo_commit": "7eb6ca7a"
12+
"regenerated": "2022-10-20 09:07:34.965011",
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

src/datadog_api_client/v2/model/security_monitoring_rule_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ def __init__(self, **kwargs):
2424
:param group_by_fields: Fields to group by.
2525
:type group_by_fields: [str], optional
2626
27-
:param metric: The target field to aggregate over when using the sum or max
28-
aggregations.
27+
:param metric: (Deprecated) The target field to aggregate over when using the sum or max
28+
aggregations. `metrics` field should be used instead.
2929
:type metric: str, optional
3030
31-
:param metrics: Group of target fields to aggregate over when using the new value aggregations.
31+
:param metrics: 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.
3232
:type metrics: [str], optional
3333
3434
:param name: Name of the query.

src/datadog_api_client/v2/model/security_monitoring_signal_rule_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(
7272
:param correlated_query_index: Index of the rule query used to retrieve the correlated field.
7373
:type correlated_query_index: int, optional
7474
75-
:param metrics: Group of target fields to aggregate over when using the new value aggregations.
75+
:param metrics: Group of target fields to aggregate over.
7676
:type metrics: [str], optional
7777
7878
:param name: Name of the query.

src/datadog_api_client/v2/model/security_monitoring_signal_rule_response_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(
7878
:param default_rule_id: Default Rule ID to match on signals.
7979
:type default_rule_id: str, optional
8080
81-
:param metrics: Group of target fields to aggregate over when using the new value aggregations.
81+
:param metrics: Group of target fields to aggregate over.
8282
:type metrics: [str], optional
8383
8484
:param name: Name of the query.

src/datadog_api_client/v2/model/security_monitoring_standard_rule_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def __init__(
6969
:param group_by_fields: Fields to group by.
7070
:type group_by_fields: [str], optional
7171
72-
:param metric: The target field to aggregate over when using the sum or max
73-
aggregations.
72+
:param metric: (Deprecated) The target field to aggregate over when using the sum or max
73+
aggregations. ``metrics`` field should be used instead. **Deprecated**.
7474
:type metric: str, optional
7575
76-
:param metrics: Group of target fields to aggregate over when using the new value aggregations.
76+
:param metrics: 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.
7777
:type metrics: [str], optional
7878
7979
:param name: Name of the query.
Lines changed: 1 addition & 1 deletion
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/v2/cassettes/test_scenarios/test_create_a_detection_rule_returns_bad_request_response.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1664284008","options":{},"queries":[{"query":""}],"tags":[]}'
3+
body: '{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1666186593","options":{},"queries":[{"query":""}],"tags":[]}'
44
headers:
55
accept:
66
- application/json
Lines changed: 1 addition & 1 deletion
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/v2/cassettes/test_scenarios/test_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: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test
4-
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+
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
headers:
66
accept:
77
- application/json
@@ -12,8 +12,8 @@ interactions:
1212
response:
1313
body:
1414
string: '{"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
headers:
@@ -28,7 +28,7 @@ interactions:
2828
accept:
2929
- '*/*'
3030
method: DELETE
31-
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/dam-cha-bya
31+
uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/2zr-mrk-aq9
3232
response:
3333
body:
3434
string: ''

0 commit comments

Comments
 (0)