Skip to content

Commit 48c592a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1f8661bb of spec repo
1 parent 1efe957 commit 48c592a

File tree

81 files changed

+1263
-270
lines changed

Some content is hidden

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

81 files changed

+1263
-270
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": "2025-05-14 09:52:33.683433",
8-
"spec_repo_commit": "996fd99d"
7+
"regenerated": "2025-05-14 15:09:59.371921",
8+
"spec_repo_commit": "1f8661bb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-14 09:52:33.700097",
13-
"spec_repo_commit": "996fd99d"
12+
"regenerated": "2025-05-14 15:09:59.388112",
13+
"spec_repo_commit": "1f8661bb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 104 additions & 0 deletions
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,59 @@ 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+
anyOf:
7519+
- type: string
7520+
- format: double
7521+
type: number
7522+
- format: int64
7523+
type: integer
7524+
- type: boolean
7525+
- items: {}
7526+
type: array
7527+
- type: object
7528+
description: The value of the set action
74727529
type: object
74737530
CloudWorkloadSecurityAgentRuleActions:
74747531
description: The array of actions the rule can perform if triggered
@@ -7484,6 +7541,11 @@ components:
74847541
agentConstraint:
74857542
description: The version of the Agent
74867543
type: string
7544+
blocking:
7545+
description: The blocking policies that the rule belongs to
7546+
items:
7547+
type: string
7548+
type: array
74877549
category:
74887550
description: The category of the Agent rule
74897551
example: Process Activity
@@ -7507,6 +7569,11 @@ components:
75077569
description: The description of the Agent rule
75087570
example: My Agent rule
75097571
type: string
7572+
disabled:
7573+
description: The disabled policies that the rule belongs to
7574+
items:
7575+
type: string
7576+
type: array
75107577
enabled:
75117578
description: Whether the Agent rule is enabled
75127579
example: true
@@ -7520,6 +7587,11 @@ components:
75207587
items:
75217588
type: string
75227589
type: array
7590+
monitoring:
7591+
description: The monitoring policies that the rule belongs to
7592+
items:
7593+
type: string
7594+
type: array
75237595
name:
75247596
description: The name of the Agent rule
75257597
example: my_agent_rule
@@ -7554,10 +7626,22 @@ components:
75547626
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557627
description: Create a new Cloud Workload Security Agent rule.
75567628
properties:
7629+
actions:
7630+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7631+
blocking:
7632+
description: The blocking policies that the rule belongs to
7633+
items:
7634+
type: string
7635+
type: array
75577636
description:
75587637
description: The description of the Agent rule.
75597638
example: My Agent rule
75607639
type: string
7640+
disabled:
7641+
description: The disabled policies that the rule belongs to
7642+
items:
7643+
type: string
7644+
type: array
75617645
enabled:
75627646
description: Whether the Agent rule is enabled
75637647
example: true
@@ -7571,6 +7655,11 @@ components:
75717655
items:
75727656
type: string
75737657
type: array
7658+
monitoring:
7659+
description: The monitoring policies that the rule belongs to
7660+
items:
7661+
type: string
7662+
type: array
75747663
name:
75757664
description: The name of the Agent rule.
75767665
example: my_agent_rule
@@ -7661,10 +7750,20 @@ components:
76617750
CloudWorkloadSecurityAgentRuleUpdateAttributes:
76627751
description: Update an existing Cloud Workload Security Agent rule
76637752
properties:
7753+
blocking:
7754+
description: The blocking policies that the rule belongs to
7755+
items:
7756+
type: string
7757+
type: array
76647758
description:
76657759
description: The description of the Agent rule
76667760
example: My Agent rule
76677761
type: string
7762+
disabled:
7763+
description: The disabled policies that the rule belongs to
7764+
items:
7765+
type: string
7766+
type: array
76687767
enabled:
76697768
description: Whether the Agent rule is enabled
76707769
example: true
@@ -7673,6 +7772,11 @@ components:
76737772
description: The SECL expression of the Agent rule
76747773
example: exec.file.name == "sh"
76757774
type: string
7775+
monitoring:
7776+
description: The monitoring policies that the rule belongs to
7777+
items:
7778+
type: string
7779+
type: array
76767780
policy_id:
76777781
description: The ID of the policy where the Agent rule is saved
76787782
example: a8c8e364-6556-434d-b798-a4c23de29c0b
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
use serde_json::Value;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
// there is a valid "policy_rc" in the system
15+
let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
16+
let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
17+
CloudWorkloadSecurityAgentRuleCreateData::new(
18+
CloudWorkloadSecurityAgentRuleCreateAttributes::new(
19+
r#"exec.file.name == "sh""#.to_string(),
20+
"examplecsmthreat".to_string(),
21+
)
22+
.actions(Some(vec![CloudWorkloadSecurityAgentRuleAction::new().set(
23+
CloudWorkloadSecurityAgentRuleActionSet::new()
24+
.name("test_set".to_string())
25+
.scope("process".to_string())
26+
.value(Value::from("test_value")),
27+
)]))
28+
.description("My Agent rule with set action".to_string())
29+
.enabled(true)
30+
.filters(vec![])
31+
.policy_id(policy_data_id.clone())
32+
.product_tags(vec![]),
33+
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
34+
),
35+
);
36+
let configuration = datadog::Configuration::new();
37+
let api = CSMThreatsAPI::with_config(configuration);
38+
let resp = api.create_csm_threats_agent_rule(body).await;
39+
if let Ok(value) = resp {
40+
println!("{:#?}", value);
41+
} else {
42+
println!("{:#?}", resp.unwrap_err());
43+
}
44+
}

src/datadogV2/model/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,6 +3100,12 @@ 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;
3107+
pub mod model_cloud_workload_security_agent_rule_action_set_value;
3108+
pub use self::model_cloud_workload_security_agent_rule_action_set_value::CloudWorkloadSecurityAgentRuleActionSetValue;
31033109
pub mod model_cloud_workload_security_agent_rule_creator_attributes;
31043110
pub use self::model_cloud_workload_security_agent_rule_creator_attributes::CloudWorkloadSecurityAgentRuleCreatorAttributes;
31053111
pub mod model_cloud_workload_security_agent_rule_updater_attributes;

src/datadogV2/model/model_cloud_workload_security_agent_policy_create_attributes.rs

Lines changed: 23 additions & 0 deletions
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

Lines changed: 23 additions & 0 deletions
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)