Skip to content

Commit 94964e7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 67cbeafb of spec repo
1 parent 9a2a5a4 commit 94964e7

File tree

78 files changed

+1100
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1100
-207
lines changed

.apigentools-info

+4-4
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": "2025-05-16 13:56:31.640964",
8-
"spec_repo_commit": "dac51bc6"
7+
"regenerated": "2025-05-16 15:14:08.532665",
8+
"spec_repo_commit": "67cbeafb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-16 13:56:31.658086",
13-
"spec_repo_commit": "dac51bc6"
12+
"regenerated": "2025-05-16 15:14:08.548614",
13+
"spec_repo_commit": "67cbeafb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+95
Original file line numberDiff line numberDiff line change
@@ -7318,6 +7318,8 @@ components:
73187318
CloudWorkloadSecurityAgentPolicyCreateAttributes:
73197319
description: Create a new Cloud Workload Security Agent policy
73207320
properties:
7321+
actions:
7322+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
73217323
description:
73227324
description: The description of the policy
73237325
example: My agent policy
@@ -7399,6 +7401,8 @@ components:
73997401
CloudWorkloadSecurityAgentPolicyUpdateAttributes:
74007402
description: Update an existing Cloud Workload Security Agent policy
74017403
properties:
7404+
actions:
7405+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
74027406
description:
74037407
description: The description of the policy
74047408
example: My agent policy
@@ -7469,6 +7473,50 @@ components:
74697473
type: string
74707474
kill:
74717475
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7476+
metadata:
7477+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7478+
set:
7479+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7480+
type: object
7481+
CloudWorkloadSecurityAgentRuleActionMetadata:
7482+
description: The metadata action applied on the scope matching the rule
7483+
properties:
7484+
image_tag:
7485+
description: The image tag of the metadata action
7486+
type: string
7487+
service:
7488+
description: The service of the metadata action
7489+
type: string
7490+
short_image:
7491+
description: The short image of the metadata action
7492+
type: string
7493+
type: object
7494+
CloudWorkloadSecurityAgentRuleActionSet:
7495+
description: The set action applied on the scope matching the rule
7496+
properties:
7497+
append:
7498+
description: Whether the value should be appended to the field
7499+
type: boolean
7500+
field:
7501+
description: The field of the set action
7502+
type: string
7503+
name:
7504+
description: The name of the set action
7505+
type: string
7506+
scope:
7507+
description: The scope of the set action
7508+
type: string
7509+
size:
7510+
description: The size of the set action
7511+
format: int64
7512+
type: integer
7513+
ttl:
7514+
description: The time to live of the set action
7515+
format: int64
7516+
type: integer
7517+
value:
7518+
description: The value of the set action
7519+
type: string
74727520
type: object
74737521
CloudWorkloadSecurityAgentRuleActions:
74747522
description: The array of actions the rule can perform if triggered
@@ -7484,6 +7532,11 @@ components:
74847532
agentConstraint:
74857533
description: The version of the Agent
74867534
type: string
7535+
blocking:
7536+
description: The blocking policies that the rule belongs to
7537+
items:
7538+
type: string
7539+
type: array
74877540
category:
74887541
description: The category of the Agent rule
74897542
example: Process Activity
@@ -7507,6 +7560,11 @@ components:
75077560
description: The description of the Agent rule
75087561
example: My Agent rule
75097562
type: string
7563+
disabled:
7564+
description: The disabled policies that the rule belongs to
7565+
items:
7566+
type: string
7567+
type: array
75107568
enabled:
75117569
description: Whether the Agent rule is enabled
75127570
example: true
@@ -7520,6 +7578,11 @@ components:
75207578
items:
75217579
type: string
75227580
type: array
7581+
monitoring:
7582+
description: The monitoring policies that the rule belongs to
7583+
items:
7584+
type: string
7585+
type: array
75237586
name:
75247587
description: The name of the Agent rule
75257588
example: my_agent_rule
@@ -7554,10 +7617,22 @@ components:
75547617
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557618
description: Create a new Cloud Workload Security Agent rule.
75567619
properties:
7620+
actions:
7621+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7622+
blocking:
7623+
description: The blocking policies that the rule belongs to
7624+
items:
7625+
type: string
7626+
type: array
75577627
description:
75587628
description: The description of the Agent rule.
75597629
example: My Agent rule
75607630
type: string
7631+
disabled:
7632+
description: The disabled policies that the rule belongs to
7633+
items:
7634+
type: string
7635+
type: array
75617636
enabled:
75627637
description: Whether the Agent rule is enabled
75637638
example: true
@@ -7571,6 +7646,11 @@ components:
75717646
items:
75727647
type: string
75737648
type: array
7649+
monitoring:
7650+
description: The monitoring policies that the rule belongs to
7651+
items:
7652+
type: string
7653+
type: array
75747654
name:
75757655
description: The name of the Agent rule.
75767656
example: my_agent_rule
@@ -7661,10 +7741,20 @@ components:
76617741
CloudWorkloadSecurityAgentRuleUpdateAttributes:
76627742
description: Update an existing Cloud Workload Security Agent rule
76637743
properties:
7744+
blocking:
7745+
description: The blocking policies that the rule belongs to
7746+
items:
7747+
type: string
7748+
type: array
76647749
description:
76657750
description: The description of the Agent rule
76667751
example: My Agent rule
76677752
type: string
7753+
disabled:
7754+
description: The disabled policies that the rule belongs to
7755+
items:
7756+
type: string
7757+
type: array
76687758
enabled:
76697759
description: Whether the Agent rule is enabled
76707760
example: true
@@ -7673,6 +7763,11 @@ components:
76737763
description: The SECL expression of the Agent rule
76747764
example: exec.file.name == "sh"
76757765
type: string
7766+
monitoring:
7767+
description: The monitoring policies that the rule belongs to
7768+
items:
7769+
type: string
7770+
type: array
76767771
policy_id:
76777772
description: The ID of the policy where the Agent rule is saved
76787773
example: a8c8e364-6556-434d-b798-a4c23de29c0b
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Create a CSM Threats Agent rule with set action returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_csm_threats::CSMThreatsAPI;
4+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleAction;
5+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSet;
6+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateAttributes;
7+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateData;
8+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest;
9+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleType;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
// there is a valid "policy_rc" in the system
14+
let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
15+
let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
16+
CloudWorkloadSecurityAgentRuleCreateData::new(
17+
CloudWorkloadSecurityAgentRuleCreateAttributes::new(
18+
r#"exec.file.name == "sh""#.to_string(),
19+
"examplecsmthreat".to_string(),
20+
)
21+
.actions(Some(vec![CloudWorkloadSecurityAgentRuleAction::new().set(
22+
CloudWorkloadSecurityAgentRuleActionSet::new()
23+
.name("test_set".to_string())
24+
.scope("process".to_string())
25+
.value("test_value".to_string()),
26+
)]))
27+
.description("My Agent rule with set action".to_string())
28+
.enabled(true)
29+
.filters(vec![])
30+
.policy_id(policy_data_id.clone())
31+
.product_tags(vec![]),
32+
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
33+
),
34+
);
35+
let configuration = datadog::Configuration::new();
36+
let api = CSMThreatsAPI::with_config(configuration);
37+
let resp = api.create_csm_threats_agent_rule(body).await;
38+
if let Ok(value) = resp {
39+
println!("{:#?}", value);
40+
} else {
41+
println!("{:#?}", resp.unwrap_err());
42+
}
43+
}

src/datadogV2/model/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3100,6 +3100,10 @@ pub mod model_cloud_workload_security_agent_rule_action;
31003100
pub use self::model_cloud_workload_security_agent_rule_action::CloudWorkloadSecurityAgentRuleAction;
31013101
pub mod model_cloud_workload_security_agent_rule_kill;
31023102
pub use self::model_cloud_workload_security_agent_rule_kill::CloudWorkloadSecurityAgentRuleKill;
3103+
pub mod model_cloud_workload_security_agent_rule_action_metadata;
3104+
pub use self::model_cloud_workload_security_agent_rule_action_metadata::CloudWorkloadSecurityAgentRuleActionMetadata;
3105+
pub mod model_cloud_workload_security_agent_rule_action_set;
3106+
pub use self::model_cloud_workload_security_agent_rule_action_set::CloudWorkloadSecurityAgentRuleActionSet;
31033107
pub mod model_cloud_workload_security_agent_rule_creator_attributes;
31043108
pub use self::model_cloud_workload_security_agent_rule_creator_attributes::CloudWorkloadSecurityAgentRuleCreatorAttributes;
31053109
pub mod model_cloud_workload_security_agent_rule_updater_attributes;

src/datadogV2/model/model_cloud_workload_security_agent_policy_create_attributes.rs

+23
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct CloudWorkloadSecurityAgentPolicyCreateAttributes {
14+
/// The array of actions the rule can perform if triggered
15+
#[serde(
16+
rename = "actions",
17+
default,
18+
with = "::serde_with::rust::double_option"
19+
)]
20+
pub actions: Option<Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>>,
1421
/// The description of the policy
1522
#[serde(rename = "description")]
1623
pub description: Option<String>,
@@ -36,6 +43,7 @@ pub struct CloudWorkloadSecurityAgentPolicyCreateAttributes {
3643
impl CloudWorkloadSecurityAgentPolicyCreateAttributes {
3744
pub fn new(name: String) -> CloudWorkloadSecurityAgentPolicyCreateAttributes {
3845
CloudWorkloadSecurityAgentPolicyCreateAttributes {
46+
actions: None,
3947
description: None,
4048
enabled: None,
4149
host_tags: None,
@@ -46,6 +54,14 @@ impl CloudWorkloadSecurityAgentPolicyCreateAttributes {
4654
}
4755
}
4856

57+
pub fn actions(
58+
mut self,
59+
value: Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>,
60+
) -> Self {
61+
self.actions = Some(value);
62+
self
63+
}
64+
4965
pub fn description(mut self, value: String) -> Self {
5066
self.description = Some(value);
5167
self
@@ -92,6 +108,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyCreateAttributes
92108
where
93109
M: MapAccess<'a>,
94110
{
111+
let mut actions: Option<
112+
Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>,
113+
> = None;
95114
let mut description: Option<String> = None;
96115
let mut enabled: Option<bool> = None;
97116
let mut host_tags: Option<Vec<String>> = None;
@@ -105,6 +124,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyCreateAttributes
105124

106125
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
107126
match k.as_str() {
127+
"actions" => {
128+
actions = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
129+
}
108130
"description" => {
109131
if v.is_null() {
110132
continue;
@@ -144,6 +166,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyCreateAttributes
144166
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
145167

146168
let content = CloudWorkloadSecurityAgentPolicyCreateAttributes {
169+
actions,
147170
description,
148171
enabled,
149172
host_tags,

src/datadogV2/model/model_cloud_workload_security_agent_policy_update_attributes.rs

+23
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct CloudWorkloadSecurityAgentPolicyUpdateAttributes {
14+
/// The array of actions the rule can perform if triggered
15+
#[serde(
16+
rename = "actions",
17+
default,
18+
with = "::serde_with::rust::double_option"
19+
)]
20+
pub actions: Option<Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>>,
1421
/// The description of the policy
1522
#[serde(rename = "description")]
1623
pub description: Option<String>,
@@ -36,6 +43,7 @@ pub struct CloudWorkloadSecurityAgentPolicyUpdateAttributes {
3643
impl CloudWorkloadSecurityAgentPolicyUpdateAttributes {
3744
pub fn new() -> CloudWorkloadSecurityAgentPolicyUpdateAttributes {
3845
CloudWorkloadSecurityAgentPolicyUpdateAttributes {
46+
actions: None,
3947
description: None,
4048
enabled: None,
4149
host_tags: None,
@@ -46,6 +54,14 @@ impl CloudWorkloadSecurityAgentPolicyUpdateAttributes {
4654
}
4755
}
4856

57+
pub fn actions(
58+
mut self,
59+
value: Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>,
60+
) -> Self {
61+
self.actions = Some(value);
62+
self
63+
}
64+
4965
pub fn description(mut self, value: String) -> Self {
5066
self.description = Some(value);
5167
self
@@ -103,6 +119,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyUpdateAttributes
103119
where
104120
M: MapAccess<'a>,
105121
{
122+
let mut actions: Option<
123+
Option<Vec<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleAction>>,
124+
> = None;
106125
let mut description: Option<String> = None;
107126
let mut enabled: Option<bool> = None;
108127
let mut host_tags: Option<Vec<String>> = None;
@@ -116,6 +135,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyUpdateAttributes
116135

117136
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
118137
match k.as_str() {
138+
"actions" => {
139+
actions = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
140+
}
119141
"description" => {
120142
if v.is_null() {
121143
continue;
@@ -157,6 +179,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyUpdateAttributes
157179
}
158180

159181
let content = CloudWorkloadSecurityAgentPolicyUpdateAttributes {
182+
actions,
160183
description,
161184
enabled,
162185
host_tags,

0 commit comments

Comments
 (0)