Skip to content

Commit 65fd90d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0b2b5768 of spec repo
1 parent a55292d commit 65fd90d

File tree

7 files changed

+35
-12
lines changed

7 files changed

+35
-12
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-05-20 18:10:15.592955",
8-
"spec_repo_commit": "6340fda5"
7+
"regenerated": "2024-05-22 16:28:27.280443",
8+
"spec_repo_commit": "0b2b5768"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-05-20 18:10:15.610532",
13-
"spec_repo_commit": "6340fda5"
12+
"regenerated": "2024-05-22 16:28:27.298205",
13+
"spec_repo_commit": "0b2b5768"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4105,6 +4105,11 @@ components:
41054105
description: The SECL expression of the Agent rule.
41064106
example: exec.file.name == \"sh\"
41074107
type: string
4108+
filters:
4109+
description: The platforms the Agent rule is supported on.
4110+
items:
4111+
type: string
4112+
type: array
41084113
name:
41094114
description: The name of the Agent rule.
41104115
example: my_agent_rule

examples/v2_csm-threats_create_csm_threats_agent_rule.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ async fn main() {
1515
"examplecsmthreat".to_string(),
1616
)
1717
.description("My Agent rule".to_string())
18-
.enabled(true),
18+
.enabled(true)
19+
.filters(vec![r#"os == "linux""#.to_string()]),
1920
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
2021
),
2122
);

src/datadogV2/model/model_cloud_workload_security_agent_rule_create_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub struct CloudWorkloadSecurityAgentRuleCreateAttributes {
2020
/// The SECL expression of the Agent rule.
2121
#[serde(rename = "expression")]
2222
pub expression: String,
23+
/// The platforms the Agent rule is supported on.
24+
#[serde(rename = "filters")]
25+
pub filters: Option<Vec<String>>,
2326
/// The name of the Agent rule.
2427
#[serde(rename = "name")]
2528
pub name: String,
@@ -34,6 +37,7 @@ impl CloudWorkloadSecurityAgentRuleCreateAttributes {
3437
description: None,
3538
enabled: None,
3639
expression,
40+
filters: None,
3741
name,
3842
_unparsed: false,
3943
}
@@ -48,6 +52,11 @@ impl CloudWorkloadSecurityAgentRuleCreateAttributes {
4852
self.enabled = Some(value);
4953
self
5054
}
55+
56+
pub fn filters(mut self, value: Vec<String>) -> Self {
57+
self.filters = Some(value);
58+
self
59+
}
5160
}
5261

5362
impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleCreateAttributes {
@@ -70,6 +79,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleCreateAttributes {
7079
let mut description: Option<String> = None;
7180
let mut enabled: Option<bool> = None;
7281
let mut expression: Option<String> = None;
82+
let mut filters: Option<Vec<String>> = None;
7383
let mut name: Option<String> = None;
7484
let mut _unparsed = false;
7585

@@ -91,6 +101,12 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleCreateAttributes {
91101
"expression" => {
92102
expression = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
93103
}
104+
"filters" => {
105+
if v.is_null() {
106+
continue;
107+
}
108+
filters = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
109+
}
94110
"name" => {
95111
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
96112
}
@@ -104,6 +120,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleCreateAttributes {
104120
description,
105121
enabled,
106122
expression,
123+
filters,
107124
name,
108125
_unparsed,
109126
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-23T17:57:44.371Z
1+
2024-05-22T16:21:27.323Z

tests/scenarios/cassettes/v2/csm_threats/Create-a-CSM-Threats-Agent-rule-returns-OK-response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testcreateacsmthreatsagentrulereturnsokresponse1713895064\"},\"type\":\"agent_rule\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"name\":\"testcreateacsmthreatsagentrulereturnsokresponse1716394887\"},\"type\":\"agent_rule\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"922-a60-32v\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1713895064438,\"creator\":{\"name\":\"\",\"handle\":\"[email protected]\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"name\":\"testcreateacsmthreatsagentrulereturnsokresponse1713895064\",\"updateDate\":1713895064438,\"updater\":{\"name\":\"\",\"handle\":\"[email protected]\"}}}}",
22+
"string": "{\"data\":{\"id\":\"ym3-tqe-ocf\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1716394887738,\"creator\":{\"name\":\"\",\"handle\":\"[email protected]\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"name\":\"testcreateacsmthreatsagentrulereturnsokresponse1716394887\",\"updateDate\":1716394887738,\"updater\":{\"name\":\"\",\"handle\":\"[email protected]\"}}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Tue, 23 Apr 2024 17:57:44 GMT"
35+
"recorded_at": "Wed, 22 May 2024 16:21:27 GMT"
3636
},
3737
{
3838
"request": {
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"method": "delete",
46-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/922-a60-32v"
46+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/ym3-tqe-ocf"
4747
},
4848
"response": {
4949
"body": {
@@ -60,7 +60,7 @@
6060
"message": "No Content"
6161
}
6262
},
63-
"recorded_at": "Tue, 23 Apr 2024 17:57:44 GMT"
63+
"recorded_at": "Wed, 22 May 2024 16:21:27 GMT"
6464
}
6565
],
6666
"recorded_with": "VCR 6.0.0"

tests/scenarios/features/v2/csm_threats.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Feature: CSM Threats
2828
@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
2929
Scenario: Create a CSM Threats Agent rule returns "OK" response
3030
Given new "CreateCSMThreatsAgentRule" request
31-
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \"sh\"", "name": "{{ unique_lower_alnum }}"}, "type": "agent_rule"}}
31+
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \"sh\"", "filters": ["os == \"linux\""], "name": "{{ unique_lower_alnum }}"}, "type": "agent_rule"}}
3232
When the request is sent
3333
Then the response status is 200 OK
3434

0 commit comments

Comments
 (0)