Skip to content

Commit 5aecaab

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
add start_date to suppression APIs (#2291)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 6bf7ce4 commit 5aecaab

12 files changed

+78
-37
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.6",
7-
"regenerated": "2024-12-26 16:01:50.554338",
8-
"spec_repo_commit": "f2e98b01"
7+
"regenerated": "2025-01-02 14:39:45.568008",
8+
"spec_repo_commit": "b4e964b3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-26 16:01:50.573108",
13-
"spec_repo_commit": "f2e98b01"
12+
"regenerated": "2025-01-02 14:39:45.582278",
13+
"spec_repo_commit": "b4e964b3"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24825,6 +24825,12 @@ components:
2482524825
as the search bar for detection rules.
2482624826
example: type:log_detection source:cloudtrail
2482724827
type: string
24828+
start_date:
24829+
description: A Unix millisecond timestamp giving the start date for the
24830+
suppression rule. After this date, it starts suppressing signals.
24831+
example: 1703187336000
24832+
format: int64
24833+
type: integer
2482824834
suppression_query:
2482924835
description: The suppression query of the suppression rule. If a signal
2483024836
matches this query, it is suppressed and not triggered. Same syntax as
@@ -24880,6 +24886,12 @@ components:
2488024886
as the search bar for detection rules.
2488124887
example: type:log_detection source:cloudtrail
2488224888
type: string
24889+
start_date:
24890+
description: A Unix millisecond timestamp giving the start date for the
24891+
suppression rule. After this date, it starts suppressing signals.
24892+
example: 1703187336000
24893+
format: int64
24894+
type: integer
2488324895
suppression_query:
2488424896
description: The suppression query of the suppression rule. If a signal
2488524897
matches this query, it is suppressed and is not triggered. It uses the
@@ -24966,6 +24978,15 @@ components:
2496624978
as the search bar for detection rules.
2496724979
example: type:log_detection source:cloudtrail
2496824980
type: string
24981+
start_date:
24982+
description: A Unix millisecond timestamp giving the start date for the
24983+
suppression rule. After this date, it starts suppressing signals. If unset,
24984+
the start date of the suppression rule is left untouched. If set to `null`,
24985+
the start date is removed.
24986+
example: 1703187336000
24987+
format: int64
24988+
nullable: true
24989+
type: integer
2496924990
suppression_query:
2497024991
description: The suppression query of the suppression rule. If a signal
2497124992
matches this query, it is suppressed and not triggered. Same syntax as

examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
attributes=SecurityMonitoringSuppressionCreateAttributes(
2121
description="This rule suppresses low-severity signals in staging environments.",
2222
enabled=True,
23+
start_date=1637493071000,
2324
expiration_date=1638443471000,
2425
name="Example-Security-Monitoring",
2526
rule_query="type:log_detection source:cloudtrail",

examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
attributes=SecurityMonitoringSuppressionCreateAttributes(
2121
description="This rule suppresses low-severity signals in staging environments.",
2222
enabled=True,
23+
start_date=1637493071000,
2324
expiration_date=1638443471000,
2425
name="Example-Security-Monitoring",
2526
rule_query="type:log_detection source:cloudtrail",

src/datadog_api_client/v2/model/security_monitoring_suppression_attributes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def openapi_types(_):
3838
"expiration_date": (int,),
3939
"name": (str,),
4040
"rule_query": (str,),
41+
"start_date": (int,),
4142
"suppression_query": (str,),
4243
"update_date": (int,),
4344
"updater": (SecurityMonitoringUser,),
@@ -54,6 +55,7 @@ def openapi_types(_):
5455
"expiration_date": "expiration_date",
5556
"name": "name",
5657
"rule_query": "rule_query",
58+
"start_date": "start_date",
5759
"suppression_query": "suppression_query",
5860
"update_date": "update_date",
5961
"updater": "updater",
@@ -71,6 +73,7 @@ def __init__(
7173
expiration_date: Union[int, UnsetType] = unset,
7274
name: Union[str, UnsetType] = unset,
7375
rule_query: Union[str, UnsetType] = unset,
76+
start_date: Union[int, UnsetType] = unset,
7477
suppression_query: Union[str, UnsetType] = unset,
7578
update_date: Union[int, UnsetType] = unset,
7679
updater: Union[SecurityMonitoringUser, UnsetType] = unset,
@@ -107,6 +110,9 @@ def __init__(
107110
:param rule_query: The rule query of the suppression rule, with the same syntax as the search bar for detection rules.
108111
:type rule_query: str, optional
109112
113+
:param start_date: A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals.
114+
:type start_date: int, optional
115+
110116
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
111117
:type suppression_query: str, optional
112118
@@ -137,6 +143,8 @@ def __init__(
137143
kwargs["name"] = name
138144
if rule_query is not unset:
139145
kwargs["rule_query"] = rule_query
146+
if start_date is not unset:
147+
kwargs["start_date"] = start_date
140148
if suppression_query is not unset:
141149
kwargs["suppression_query"] = suppression_query
142150
if update_date is not unset:

src/datadog_api_client/v2/model/security_monitoring_suppression_create_attributes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def openapi_types(_):
2323
"expiration_date": (int,),
2424
"name": (str,),
2525
"rule_query": (str,),
26+
"start_date": (int,),
2627
"suppression_query": (str,),
2728
}
2829

@@ -33,6 +34,7 @@ def openapi_types(_):
3334
"expiration_date": "expiration_date",
3435
"name": "name",
3536
"rule_query": "rule_query",
37+
"start_date": "start_date",
3638
"suppression_query": "suppression_query",
3739
}
3840

@@ -44,6 +46,7 @@ def __init__(
4446
data_exclusion_query: Union[str, UnsetType] = unset,
4547
description: Union[str, UnsetType] = unset,
4648
expiration_date: Union[int, UnsetType] = unset,
49+
start_date: Union[int, UnsetType] = unset,
4750
suppression_query: Union[str, UnsetType] = unset,
4851
**kwargs,
4952
):
@@ -68,6 +71,9 @@ def __init__(
6871
:param rule_query: The rule query of the suppression rule, with the same syntax as the search bar for detection rules.
6972
:type rule_query: str
7073
74+
:param start_date: A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals.
75+
:type start_date: int, optional
76+
7177
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the same syntax as the queries to search signals in the Signals Explorer.
7278
:type suppression_query: str, optional
7379
"""
@@ -77,6 +83,8 @@ def __init__(
7783
kwargs["description"] = description
7884
if expiration_date is not unset:
7985
kwargs["expiration_date"] = expiration_date
86+
if start_date is not unset:
87+
kwargs["start_date"] = start_date
8088
if suppression_query is not unset:
8189
kwargs["suppression_query"] = suppression_query
8290
super().__init__(kwargs)

src/datadog_api_client/v2/model/security_monitoring_suppression_update_attributes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def openapi_types(_):
3030
"expiration_date": (int, none_type),
3131
"name": (str,),
3232
"rule_query": (str,),
33+
"start_date": (int, none_type),
3334
"suppression_query": (str,),
3435
"version": (int,),
3536
}
@@ -41,6 +42,7 @@ def openapi_types(_):
4142
"expiration_date": "expiration_date",
4243
"name": "name",
4344
"rule_query": "rule_query",
45+
"start_date": "start_date",
4446
"suppression_query": "suppression_query",
4547
"version": "version",
4648
}
@@ -53,6 +55,7 @@ def __init__(
5355
expiration_date: Union[int, none_type, UnsetType] = unset,
5456
name: Union[str, UnsetType] = unset,
5557
rule_query: Union[str, UnsetType] = unset,
58+
start_date: Union[int, none_type, UnsetType] = unset,
5659
suppression_query: Union[str, UnsetType] = unset,
5760
version: Union[int, UnsetType] = unset,
5861
**kwargs,
@@ -78,6 +81,9 @@ def __init__(
7881
:param rule_query: The rule query of the suppression rule, with the same syntax as the search bar for detection rules.
7982
:type rule_query: str, optional
8083
84+
:param start_date: A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals. If unset, the start date of the suppression rule is left untouched. If set to ``null`` , the start date is removed.
85+
:type start_date: int, none_type, optional
86+
8187
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
8288
:type suppression_query: str, optional
8389
@@ -96,6 +102,8 @@ def __init__(
96102
kwargs["name"] = name
97103
if rule_query is not unset:
98104
kwargs["rule_query"] = rule_query
105+
if start_date is not unset:
106+
kwargs["start_date"] = start_date
99107
if suppression_query is not unset:
100108
kwargs["suppression_query"] = suppression_query
101109
if version is not unset:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-05-20T17:07:03.155Z
1+
2024-11-27T15:22:34.711Z

tests/v2/cassettes/test_scenarios/test_create_a_suppression_rule_returns_ok_response.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"description":"This rule suppresses low-severity
4-
signals in staging environments.","enabled":true,"expiration_date":1718039223000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1716224823","rule_query":"type:log_detection
5-
source:cloudtrail","suppression_query":"env:staging status:low"},"type":"suppressions"}}'
4+
signals in staging environments.","enabled":true,"expiration_date":1734535354000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1732720954","rule_query":"type:log_detection
5+
source:cloudtrail","start_date":1733584954000,"suppression_query":"env:staging
6+
status:low"},"type":"suppressions"}}'
67
headers:
78
accept:
89
- application/json
@@ -12,14 +13,13 @@ interactions:
1213
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions
1314
response:
1415
body:
15-
string: '{"data":{"id":"8qj-mmz-zym","attributes":{"name":"Test-Create_a_suppression_rule_returns_OK_response-1716224823","enabled":true,"description":"This
16-
rule suppresses low-severity signals in staging environments.","rule_query":"type:log_detection
17-
source:cloudtrail","suppression_query":"env:staging status:low","data_exclusion_query":"","expiration_date":1718039223000,"version":1,"creation_date":1716224823374,"update_date":1716224823374,"creator":{"name":null,"handle":"[email protected]"},"updater":{"name":null,"handle":"[email protected]"}},"type":"suppressions"}}
18-
19-
'
16+
string: '{"data":{"id":"ejv-ksi-r4j","type":"suppressions","attributes":{"creation_date":1732720954868,"creator":{"handle":"[email protected]","name":""},"data_exclusion_query":"","description":"This
17+
rule suppresses low-severity signals in staging environments.","editable":true,"enabled":true,"expiration_date":1734535354000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1732720954","rule_query":"type:log_detection
18+
source:cloudtrail","start_date":1733584954000,"suppression_query":"env:staging
19+
status:low","update_date":1732720954868,"updater":{"handle":"[email protected]","name":""},"version":1}}}'
2020
headers:
2121
content-type:
22-
- application/json
22+
- application/vnd.api+json
2323
status:
2424
code: 200
2525
message: OK
@@ -29,13 +29,11 @@ interactions:
2929
accept:
3030
- '*/*'
3131
method: DELETE
32-
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/8qj-mmz-zym
32+
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j
3333
response:
3434
body:
3535
string: ''
36-
headers:
37-
content-type:
38-
- text/html; charset=utf-8
36+
headers: {}
3937
status:
4038
code: 204
4139
message: No Content
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-05-20T17:07:12.131Z
1+
2024-11-27T15:24:35.169Z

tests/v2/cassettes/test_scenarios/test_create_a_suppression_rule_with_an_exclusion_query_returns_ok_response.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"data_exclusion_query":"account_id:12345","description":"This
4-
rule suppresses low-severity signals in staging environments.","enabled":true,"expiration_date":1718039232000,"name":"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832","rule_query":"type:log_detection
5-
source:cloudtrail"},"type":"suppressions"}}'
4+
rule suppresses low-severity signals in staging environments.","enabled":true,"expiration_date":1734535475000,"name":"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075","rule_query":"type:log_detection
5+
source:cloudtrail","start_date":1733585075000},"type":"suppressions"}}'
66
headers:
77
accept:
88
- application/json
@@ -12,14 +12,12 @@ interactions:
1212
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions
1313
response:
1414
body:
15-
string: '{"data":{"id":"i9m-nqb-ets","attributes":{"name":"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832","enabled":true,"description":"This
16-
rule suppresses low-severity signals in staging environments.","rule_query":"type:log_detection
17-
source:cloudtrail","suppression_query":"","data_exclusion_query":"account_id:12345","expiration_date":1718039232000,"version":1,"creation_date":1716224832354,"update_date":1716224832355,"creator":{"name":null,"handle":"[email protected]"},"updater":{"name":null,"handle":"[email protected]"}},"type":"suppressions"}}
18-
19-
'
15+
string: '{"data":{"id":"rv5-3sh-tvp","type":"suppressions","attributes":{"creation_date":1732721075298,"creator":{"handle":"[email protected]","name":""},"data_exclusion_query":"account_id:12345","description":"This
16+
rule suppresses low-severity signals in staging environments.","editable":true,"enabled":true,"expiration_date":1734535475000,"name":"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075","rule_query":"type:log_detection
17+
source:cloudtrail","start_date":1733585075000,"suppression_query":"","update_date":1732721075298,"updater":{"handle":"[email protected]","name":""},"version":1}}}'
2018
headers:
2119
content-type:
22-
- application/json
20+
- application/vnd.api+json
2321
status:
2422
code: 200
2523
message: OK
@@ -29,13 +27,11 @@ interactions:
2927
accept:
3028
- '*/*'
3129
method: DELETE
32-
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/i9m-nqb-ets
30+
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/rv5-3sh-tvp
3331
response:
3432
body:
3533
string: ''
36-
headers:
37-
content-type:
38-
- text/html; charset=utf-8
34+
headers: {}
3935
status:
4036
code: 204
4137
message: No Content

0 commit comments

Comments
 (0)