pub struct CSMThreatsAPI { /* private fields */ }
Expand description
Workload Protection monitors file, network, and process activity across your environment to detect real-time threats to your infrastructure. See Workload Protection for more information on setting up Workload Protection.
Note: These endpoints are split based on whether you are using the US1-FED site or not. Please reference the specific resource for the site you are using.
Implementations§
Source§impl CSMThreatsAPI
impl CSMThreatsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = CSMThreatsAPI::with_config(configuration);
10 let resp = api
11 .list_csm_threats_agent_rules(ListCSMThreatsAgentRulesOptionalParams::default())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
6async fn main() {
7 // there is a valid "policy_rc" in the system
8 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CSMThreatsAPI::with_config(configuration);
11 let resp = api
12 .get_csm_threats_agent_policy(policy_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
- examples/v2_csm-threats_DeleteCSMThreatsAgentPolicy.rs
- examples/v2_csm-threats_GetCloudWorkloadSecurityAgentRule.rs
- examples/v2_csm-threats_DeleteCloudWorkloadSecurityAgentRule.rs
- examples/v2_csm-threats_GetCSMThreatsAgentRule.rs
- examples/v2_csm-threats_DeleteCSMThreatsAgentRule.rs
- examples/v2_csm-threats_CreateCSMThreatsAgentPolicy.rs
- examples/v2_csm-threats_CreateCloudWorkloadSecurityAgentRule.rs
- examples/v2_csm-threats_UpdateCloudWorkloadSecurityAgentRule.rs
- examples/v2_csm-threats_UpdateCSMThreatsAgentPolicy.rs
- examples/v2_csm-threats_CreateCSMThreatsAgentRule.rs
- examples/v2_csm-threats_UpdateCSMThreatsAgentRule.rs
- examples/v2_csm-threats_CreateCSMThreatsAgentRule_1295653933.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_csm_threats_agent_policy(
&self,
body: CloudWorkloadSecurityAgentPolicyCreateRequest,
) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<CreateCSMThreatsAgentPolicyError>>
pub async fn create_csm_threats_agent_policy( &self, body: CloudWorkloadSecurityAgentPolicyCreateRequest, ) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<CreateCSMThreatsAgentPolicyError>>
Create a new Workload Protection policy with the given parameters.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
10async fn main() {
11 let body = CloudWorkloadSecurityAgentPolicyCreateRequest::new(
12 CloudWorkloadSecurityAgentPolicyCreateData::new(
13 CloudWorkloadSecurityAgentPolicyCreateAttributes::new("my_agent_policy".to_string())
14 .description("My agent policy".to_string())
15 .enabled(true)
16 .host_tags_lists(vec![vec!["env:test".to_string()]]),
17 CloudWorkloadSecurityAgentPolicyType::POLICY,
18 ),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = CSMThreatsAPI::with_config(configuration);
22 let resp = api.create_csm_threats_agent_policy(body).await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
Sourcepub async fn create_csm_threats_agent_policy_with_http_info(
&self,
body: CloudWorkloadSecurityAgentPolicyCreateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<CreateCSMThreatsAgentPolicyError>>
pub async fn create_csm_threats_agent_policy_with_http_info( &self, body: CloudWorkloadSecurityAgentPolicyCreateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<CreateCSMThreatsAgentPolicyError>>
Create a new Workload Protection policy with the given parameters.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn create_csm_threats_agent_rule(
&self,
body: CloudWorkloadSecurityAgentRuleCreateRequest,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<CreateCSMThreatsAgentRuleError>>
pub async fn create_csm_threats_agent_rule( &self, body: CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<CreateCSMThreatsAgentRuleError>>
Create a new Workload Protection agent rule with the given parameters.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
10async fn main() {
11 // there is a valid "policy_rc" in the system
12 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
13 let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
14 CloudWorkloadSecurityAgentRuleCreateData::new(
15 CloudWorkloadSecurityAgentRuleCreateAttributes::new(
16 r#"exec.file.name == "sh""#.to_string(),
17 "examplecsmthreat".to_string(),
18 )
19 .description("My Agent rule".to_string())
20 .enabled(true)
21 .filters(vec![])
22 .policy_id(policy_data_id.clone())
23 .product_tags(vec![]),
24 CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
25 ),
26 );
27 let configuration = datadog::Configuration::new();
28 let api = CSMThreatsAPI::with_config(configuration);
29 let resp = api.create_csm_threats_agent_rule(body).await;
30 if let Ok(value) = resp {
31 println!("{:#?}", value);
32 } else {
33 println!("{:#?}", resp.unwrap_err());
34 }
35}
More examples
13async 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![
23 CloudWorkloadSecurityAgentRuleAction::new().set(
24 CloudWorkloadSecurityAgentRuleActionSet::new()
25 .name("test_set".to_string())
26 .scope("process".to_string())
27 .value("test_value".to_string()),
28 ),
29 CloudWorkloadSecurityAgentRuleAction::new().hash(BTreeMap::from([])),
30 ]))
31 .description("My Agent rule with set action".to_string())
32 .enabled(true)
33 .filters(vec![])
34 .policy_id(policy_data_id.clone())
35 .product_tags(vec![]),
36 CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
37 ),
38 );
39 let configuration = datadog::Configuration::new();
40 let api = CSMThreatsAPI::with_config(configuration);
41 let resp = api.create_csm_threats_agent_rule(body).await;
42 if let Ok(value) = resp {
43 println!("{:#?}", value);
44 } else {
45 println!("{:#?}", resp.unwrap_err());
46 }
47}
Sourcepub async fn create_csm_threats_agent_rule_with_http_info(
&self,
body: CloudWorkloadSecurityAgentRuleCreateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<CreateCSMThreatsAgentRuleError>>
pub async fn create_csm_threats_agent_rule_with_http_info( &self, body: CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<CreateCSMThreatsAgentRuleError>>
Create a new Workload Protection agent rule with the given parameters.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn create_cloud_workload_security_agent_rule(
&self,
body: CloudWorkloadSecurityAgentRuleCreateRequest,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<CreateCloudWorkloadSecurityAgentRuleError>>
pub async fn create_cloud_workload_security_agent_rule( &self, body: CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<CreateCloudWorkloadSecurityAgentRuleError>>
Create a new agent rule with the given parameters.
Note: This endpoint should only be used for the Government (US1-FED) site.
Examples found in repository?
10async fn main() {
11 let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
12 CloudWorkloadSecurityAgentRuleCreateData::new(
13 CloudWorkloadSecurityAgentRuleCreateAttributes::new(
14 r#"exec.file.name == "sh""#.to_string(),
15 "examplecsmthreat".to_string(),
16 )
17 .description("My Agent rule".to_string())
18 .enabled(true)
19 .filters(vec![]),
20 CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
21 ),
22 );
23 let configuration = datadog::Configuration::new();
24 let api = CSMThreatsAPI::with_config(configuration);
25 let resp = api.create_cloud_workload_security_agent_rule(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
Sourcepub async fn create_cloud_workload_security_agent_rule_with_http_info(
&self,
body: CloudWorkloadSecurityAgentRuleCreateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<CreateCloudWorkloadSecurityAgentRuleError>>
pub async fn create_cloud_workload_security_agent_rule_with_http_info( &self, body: CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<CreateCloudWorkloadSecurityAgentRuleError>>
Create a new agent rule with the given parameters.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn delete_csm_threats_agent_policy(
&self,
policy_id: String,
) -> Result<(), Error<DeleteCSMThreatsAgentPolicyError>>
pub async fn delete_csm_threats_agent_policy( &self, policy_id: String, ) -> Result<(), Error<DeleteCSMThreatsAgentPolicyError>>
Delete a specific Workload Protection policy.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
6async fn main() {
7 // there is a valid "policy_rc" in the system
8 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CSMThreatsAPI::with_config(configuration);
11 let resp = api
12 .delete_csm_threats_agent_policy(policy_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn delete_csm_threats_agent_policy_with_http_info(
&self,
policy_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentPolicyError>>
pub async fn delete_csm_threats_agent_policy_with_http_info( &self, policy_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentPolicyError>>
Delete a specific Workload Protection policy.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn delete_csm_threats_agent_rule(
&self,
agent_rule_id: String,
params: DeleteCSMThreatsAgentRuleOptionalParams,
) -> Result<(), Error<DeleteCSMThreatsAgentRuleError>>
pub async fn delete_csm_threats_agent_rule( &self, agent_rule_id: String, params: DeleteCSMThreatsAgentRuleOptionalParams, ) -> Result<(), Error<DeleteCSMThreatsAgentRuleError>>
Delete a specific Workload Protection agent rule.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
7async fn main() {
8 // there is a valid "agent_rule_rc" in the system
9 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
10
11 // there is a valid "policy_rc" in the system
12 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
13 let configuration = datadog::Configuration::new();
14 let api = CSMThreatsAPI::with_config(configuration);
15 let resp = api
16 .delete_csm_threats_agent_rule(
17 agent_rule_data_id.clone(),
18 DeleteCSMThreatsAgentRuleOptionalParams::default().policy_id(policy_data_id.clone()),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub async fn delete_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
params: DeleteCSMThreatsAgentRuleOptionalParams,
) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentRuleError>>
pub async fn delete_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, params: DeleteCSMThreatsAgentRuleOptionalParams, ) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentRuleError>>
Delete a specific Workload Protection agent rule.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn delete_cloud_workload_security_agent_rule(
&self,
agent_rule_id: String,
) -> Result<(), Error<DeleteCloudWorkloadSecurityAgentRuleError>>
pub async fn delete_cloud_workload_security_agent_rule( &self, agent_rule_id: String, ) -> Result<(), Error<DeleteCloudWorkloadSecurityAgentRuleError>>
Delete a specific agent rule.
Note: This endpoint should only be used for the Government (US1-FED) site.
Examples found in repository?
6async fn main() {
7 // there is a valid "agent_rule" in the system
8 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CSMThreatsAPI::with_config(configuration);
11 let resp = api
12 .delete_cloud_workload_security_agent_rule(agent_rule_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn delete_cloud_workload_security_agent_rule_with_http_info(
&self,
agent_rule_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCloudWorkloadSecurityAgentRuleError>>
pub async fn delete_cloud_workload_security_agent_rule_with_http_info( &self, agent_rule_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCloudWorkloadSecurityAgentRuleError>>
Delete a specific agent rule.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn download_csm_threats_policy(
&self,
) -> Result<Vec<u8>, Error<DownloadCSMThreatsPolicyError>>
pub async fn download_csm_threats_policy( &self, ) -> Result<Vec<u8>, Error<DownloadCSMThreatsPolicyError>>
The download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy
file. This file can then be deployed to
your agents to update the policy running in your environment.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn download_csm_threats_policy_with_http_info(
&self,
) -> Result<ResponseContent<Vec<u8>>, Error<DownloadCSMThreatsPolicyError>>
pub async fn download_csm_threats_policy_with_http_info( &self, ) -> Result<ResponseContent<Vec<u8>>, Error<DownloadCSMThreatsPolicyError>>
The download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy
file. This file can then be deployed to
your agents to update the policy running in your environment.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn download_cloud_workload_policy_file(
&self,
) -> Result<Vec<u8>, Error<DownloadCloudWorkloadPolicyFileError>>
pub async fn download_cloud_workload_policy_file( &self, ) -> Result<Vec<u8>, Error<DownloadCloudWorkloadPolicyFileError>>
The download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy
file. This file can then be deployed to
your agents to update the policy running in your environment.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn download_cloud_workload_policy_file_with_http_info(
&self,
) -> Result<ResponseContent<Vec<u8>>, Error<DownloadCloudWorkloadPolicyFileError>>
pub async fn download_cloud_workload_policy_file_with_http_info( &self, ) -> Result<ResponseContent<Vec<u8>>, Error<DownloadCloudWorkloadPolicyFileError>>
The download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy
file. This file can then be deployed to
your agents to update the policy running in your environment.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn get_csm_threats_agent_policy(
&self,
policy_id: String,
) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<GetCSMThreatsAgentPolicyError>>
pub async fn get_csm_threats_agent_policy( &self, policy_id: String, ) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<GetCSMThreatsAgentPolicyError>>
Get the details of a specific Workload Protection policy.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
6async fn main() {
7 // there is a valid "policy_rc" in the system
8 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CSMThreatsAPI::with_config(configuration);
11 let resp = api
12 .get_csm_threats_agent_policy(policy_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn get_csm_threats_agent_policy_with_http_info(
&self,
policy_id: String,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<GetCSMThreatsAgentPolicyError>>
pub async fn get_csm_threats_agent_policy_with_http_info( &self, policy_id: String, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<GetCSMThreatsAgentPolicyError>>
Get the details of a specific Workload Protection policy.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn get_csm_threats_agent_rule(
&self,
agent_rule_id: String,
params: GetCSMThreatsAgentRuleOptionalParams,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCSMThreatsAgentRuleError>>
pub async fn get_csm_threats_agent_rule( &self, agent_rule_id: String, params: GetCSMThreatsAgentRuleOptionalParams, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCSMThreatsAgentRuleError>>
Get the details of a specific Workload Protection agent rule.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
7async fn main() {
8 // there is a valid "agent_rule_rc" in the system
9 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
10
11 // there is a valid "policy_rc" in the system
12 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
13 let configuration = datadog::Configuration::new();
14 let api = CSMThreatsAPI::with_config(configuration);
15 let resp = api
16 .get_csm_threats_agent_rule(
17 agent_rule_data_id.clone(),
18 GetCSMThreatsAgentRuleOptionalParams::default().policy_id(policy_data_id.clone()),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub async fn get_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
params: GetCSMThreatsAgentRuleOptionalParams,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCSMThreatsAgentRuleError>>
pub async fn get_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, params: GetCSMThreatsAgentRuleOptionalParams, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCSMThreatsAgentRuleError>>
Get the details of a specific Workload Protection agent rule.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn get_cloud_workload_security_agent_rule(
&self,
agent_rule_id: String,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCloudWorkloadSecurityAgentRuleError>>
pub async fn get_cloud_workload_security_agent_rule( &self, agent_rule_id: String, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCloudWorkloadSecurityAgentRuleError>>
Get the details of a specific agent rule.
Note: This endpoint should only be used for the Government (US1-FED) site.
Examples found in repository?
6async fn main() {
7 // there is a valid "agent_rule" in the system
8 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CSMThreatsAPI::with_config(configuration);
11 let resp = api
12 .get_cloud_workload_security_agent_rule(agent_rule_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn get_cloud_workload_security_agent_rule_with_http_info(
&self,
agent_rule_id: String,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCloudWorkloadSecurityAgentRuleError>>
pub async fn get_cloud_workload_security_agent_rule_with_http_info( &self, agent_rule_id: String, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCloudWorkloadSecurityAgentRuleError>>
Get the details of a specific agent rule.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn list_csm_threats_agent_policies(
&self,
) -> Result<CloudWorkloadSecurityAgentPoliciesListResponse, Error<ListCSMThreatsAgentPoliciesError>>
pub async fn list_csm_threats_agent_policies( &self, ) -> Result<CloudWorkloadSecurityAgentPoliciesListResponse, Error<ListCSMThreatsAgentPoliciesError>>
Get the list of Workload Protection policies.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn list_csm_threats_agent_policies_with_http_info(
&self,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentPoliciesListResponse>, Error<ListCSMThreatsAgentPoliciesError>>
pub async fn list_csm_threats_agent_policies_with_http_info( &self, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentPoliciesListResponse>, Error<ListCSMThreatsAgentPoliciesError>>
Get the list of Workload Protection policies.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn list_csm_threats_agent_rules(
&self,
params: ListCSMThreatsAgentRulesOptionalParams,
) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCSMThreatsAgentRulesError>>
pub async fn list_csm_threats_agent_rules( &self, params: ListCSMThreatsAgentRulesOptionalParams, ) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCSMThreatsAgentRulesError>>
Get the list of Workload Protection agent rules.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = CSMThreatsAPI::with_config(configuration);
10 let resp = api
11 .list_csm_threats_agent_rules(ListCSMThreatsAgentRulesOptionalParams::default())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn list_csm_threats_agent_rules_with_http_info(
&self,
params: ListCSMThreatsAgentRulesOptionalParams,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCSMThreatsAgentRulesError>>
pub async fn list_csm_threats_agent_rules_with_http_info( &self, params: ListCSMThreatsAgentRulesOptionalParams, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCSMThreatsAgentRulesError>>
Get the list of Workload Protection agent rules.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn list_cloud_workload_security_agent_rules(
&self,
) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCloudWorkloadSecurityAgentRulesError>>
pub async fn list_cloud_workload_security_agent_rules( &self, ) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCloudWorkloadSecurityAgentRulesError>>
Get the list of agent rules.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn list_cloud_workload_security_agent_rules_with_http_info(
&self,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCloudWorkloadSecurityAgentRulesError>>
pub async fn list_cloud_workload_security_agent_rules_with_http_info( &self, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCloudWorkloadSecurityAgentRulesError>>
Get the list of agent rules.
Note: This endpoint should only be used for the Government (US1-FED) site.
Sourcepub async fn update_csm_threats_agent_policy(
&self,
policy_id: String,
body: CloudWorkloadSecurityAgentPolicyUpdateRequest,
) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<UpdateCSMThreatsAgentPolicyError>>
pub async fn update_csm_threats_agent_policy( &self, policy_id: String, body: CloudWorkloadSecurityAgentPolicyUpdateRequest, ) -> Result<CloudWorkloadSecurityAgentPolicyResponse, Error<UpdateCSMThreatsAgentPolicyError>>
Update a specific Workload Protection policy. Returns the policy object when the request is successful.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
10async fn main() {
11 // there is a valid "policy_rc" in the system
12 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
13 let body = CloudWorkloadSecurityAgentPolicyUpdateRequest::new(
14 CloudWorkloadSecurityAgentPolicyUpdateData::new(
15 CloudWorkloadSecurityAgentPolicyUpdateAttributes::new()
16 .description("Updated agent policy".to_string())
17 .enabled(true)
18 .host_tags_lists(vec![vec!["env:test".to_string()]])
19 .name("updated_agent_policy".to_string()),
20 CloudWorkloadSecurityAgentPolicyType::POLICY,
21 )
22 .id(policy_data_id.clone()),
23 );
24 let configuration = datadog::Configuration::new();
25 let api = CSMThreatsAPI::with_config(configuration);
26 let resp = api
27 .update_csm_threats_agent_policy(policy_data_id.clone(), body)
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub async fn update_csm_threats_agent_policy_with_http_info(
&self,
policy_id: String,
body: CloudWorkloadSecurityAgentPolicyUpdateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<UpdateCSMThreatsAgentPolicyError>>
pub async fn update_csm_threats_agent_policy_with_http_info( &self, policy_id: String, body: CloudWorkloadSecurityAgentPolicyUpdateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentPolicyResponse>, Error<UpdateCSMThreatsAgentPolicyError>>
Update a specific Workload Protection policy. Returns the policy object when the request is successful.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn update_csm_threats_agent_rule(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
params: UpdateCSMThreatsAgentRuleOptionalParams,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCSMThreatsAgentRuleError>>
pub async fn update_csm_threats_agent_rule( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, params: UpdateCSMThreatsAgentRuleOptionalParams, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCSMThreatsAgentRuleError>>
Update a specific Workload Protection Agent rule. Returns the agent rule object when the request is successful.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Examples found in repository?
11async fn main() {
12 // there is a valid "agent_rule_rc" in the system
13 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
14
15 // there is a valid "policy_rc" in the system
16 let policy_data_id = std::env::var("POLICY_DATA_ID").unwrap();
17 let body = CloudWorkloadSecurityAgentRuleUpdateRequest::new(
18 CloudWorkloadSecurityAgentRuleUpdateData::new(
19 CloudWorkloadSecurityAgentRuleUpdateAttributes::new()
20 .description("My Agent rule".to_string())
21 .enabled(true)
22 .expression(r#"exec.file.name == "sh""#.to_string())
23 .policy_id(policy_data_id.clone())
24 .product_tags(vec![]),
25 CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
26 )
27 .id(agent_rule_data_id.clone()),
28 );
29 let configuration = datadog::Configuration::new();
30 let api = CSMThreatsAPI::with_config(configuration);
31 let resp = api
32 .update_csm_threats_agent_rule(
33 agent_rule_data_id.clone(),
34 body,
35 UpdateCSMThreatsAgentRuleOptionalParams::default().policy_id(policy_data_id.clone()),
36 )
37 .await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
Sourcepub async fn update_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
params: UpdateCSMThreatsAgentRuleOptionalParams,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCSMThreatsAgentRuleError>>
pub async fn update_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, params: UpdateCSMThreatsAgentRuleOptionalParams, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCSMThreatsAgentRuleError>>
Update a specific Workload Protection Agent rule. Returns the agent rule object when the request is successful.
Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
Sourcepub async fn update_cloud_workload_security_agent_rule(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCloudWorkloadSecurityAgentRuleError>>
pub async fn update_cloud_workload_security_agent_rule( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCloudWorkloadSecurityAgentRuleError>>
Update a specific agent rule. Returns the agent rule object when the request is successful.
Note: This endpoint should only be used for the Government (US1-FED) site.
Examples found in repository?
10async fn main() {
11 // there is a valid "agent_rule" in the system
12 let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
13 let body = CloudWorkloadSecurityAgentRuleUpdateRequest::new(
14 CloudWorkloadSecurityAgentRuleUpdateData::new(
15 CloudWorkloadSecurityAgentRuleUpdateAttributes::new()
16 .description("Updated Agent rule".to_string())
17 .expression(r#"exec.file.name == "sh""#.to_string()),
18 CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
19 )
20 .id(agent_rule_data_id.clone()),
21 );
22 let configuration = datadog::Configuration::new();
23 let api = CSMThreatsAPI::with_config(configuration);
24 let resp = api
25 .update_cloud_workload_security_agent_rule(agent_rule_data_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub async fn update_cloud_workload_security_agent_rule_with_http_info(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCloudWorkloadSecurityAgentRuleError>>
pub async fn update_cloud_workload_security_agent_rule_with_http_info( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCloudWorkloadSecurityAgentRuleError>>
Update a specific agent rule. Returns the agent rule object when the request is successful.
Note: This endpoint should only be used for the Government (US1-FED) site.
Trait Implementations§
Source§impl Clone for CSMThreatsAPI
impl Clone for CSMThreatsAPI
Source§fn clone(&self) -> CSMThreatsAPI
fn clone(&self) -> CSMThreatsAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more