Struct datadog_api_client::datadogV2::api::api_csm_threats::CSMThreatsAPI
source · pub struct CSMThreatsAPI { /* private fields */ }
Expand description
Cloud Security Management Threats (CSM Threats) monitors file, network, and process activity across your environment to detect real-time threats to your infrastructure. See Cloud Security Management Threats for more information on setting up CSM Threats.
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
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule_rc" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.get_csm_threats_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule_rc" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.delete_csm_threats_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
- examples/v2_csm-threats_get_cloud_workload_security_agent_rule.rs
- examples/v2_csm-threats_delete_cloud_workload_security_agent_rule.rs
- examples/v2_csm-threats_create_cloud_workload_security_agent_rule.rs
- examples/v2_csm-threats_create_csm_threats_agent_rule.rs
- examples/v2_csm-threats_update_csm_threats_agent_rule.rs
- examples/v2_csm-threats_update_cloud_workload_security_agent_rule.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
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 Cloud Security Management Threats Agent rule with the given parameters.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
async fn main() {
let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
CloudWorkloadSecurityAgentRuleCreateData::new(
CloudWorkloadSecurityAgentRuleCreateAttributes::new(
r#"exec.file.name == "sh""#.to_string(),
"examplecsmthreat".to_string(),
)
.description("My Agent rule".to_string())
.enabled(true)
.filters(vec![r#"os == "linux""#.to_string()]),
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
),
);
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api.create_csm_threats_agent_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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 Cloud Security Management Threats Agent rule with the given parameters.
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.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = CloudWorkloadSecurityAgentRuleCreateRequest::new(
CloudWorkloadSecurityAgentRuleCreateData::new(
CloudWorkloadSecurityAgentRuleCreateAttributes::new(
r#"exec.file.name == "sh""#.to_string(),
"examplecsmthreat".to_string(),
)
.description("Test Agent rule".to_string())
.enabled(true),
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
),
);
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api.create_cloud_workload_security_agent_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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.
sourcepub async fn delete_csm_threats_agent_rule(
&self,
agent_rule_id: String,
) -> Result<(), Error<DeleteCSMThreatsAgentRuleError>>
pub async fn delete_csm_threats_agent_rule( &self, agent_rule_id: String, ) -> Result<(), Error<DeleteCSMThreatsAgentRuleError>>
Delete a specific Cloud Security Management Threats Agent rule.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule_rc" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.delete_csm_threats_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub async fn delete_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentRuleError>>
pub async fn delete_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCSMThreatsAgentRuleError>>
Delete a specific Cloud Security Management Threats Agent rule.
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.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.delete_cloud_workload_security_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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.
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 CSM Threats policy file from your currently active
CSM Threats 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.
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 CSM Threats policy file from your currently active
CSM Threats 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.
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 Cloud Workload Security policy file from your currently active Cloud Workload Security 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.
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 Cloud Workload Security policy file from your currently active Cloud Workload Security 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.
sourcepub async fn get_csm_threats_agent_rule(
&self,
agent_rule_id: String,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCSMThreatsAgentRuleError>>
pub async fn get_csm_threats_agent_rule( &self, agent_rule_id: String, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<GetCSMThreatsAgentRuleError>>
Get the details of a specific Cloud Security Management Threats Agent rule.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule_rc" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.get_csm_threats_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub async fn get_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCSMThreatsAgentRuleError>>
pub async fn get_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<GetCSMThreatsAgentRuleError>>
Get the details of a specific Cloud Security Management Threats Agent rule.
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.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "agent_rule" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.get_cloud_workload_security_agent_rule(agent_rule_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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.
sourcepub async fn list_csm_threats_agent_rules(
&self,
) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCSMThreatsAgentRulesError>>
pub async fn list_csm_threats_agent_rules( &self, ) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCSMThreatsAgentRulesError>>
Get the list of Cloud Security Management Threats Agent rules.
sourcepub async fn list_csm_threats_agent_rules_with_http_info(
&self,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCSMThreatsAgentRulesError>>
pub async fn list_csm_threats_agent_rules_with_http_info( &self, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCSMThreatsAgentRulesError>>
Get the list of Cloud Security Management Threats Agent rules.
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.
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.
sourcepub async fn update_csm_threats_agent_rule(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCSMThreatsAgentRuleError>>
pub async fn update_csm_threats_agent_rule( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result<CloudWorkloadSecurityAgentRuleResponse, Error<UpdateCSMThreatsAgentRuleError>>
Update a specific Cloud Security Management Threats Agent rule. Returns the Agent rule object when the request is successful.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
async fn main() {
// there is a valid "agent_rule_rc" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let body = CloudWorkloadSecurityAgentRuleUpdateRequest::new(
CloudWorkloadSecurityAgentRuleUpdateData::new(
CloudWorkloadSecurityAgentRuleUpdateAttributes::new()
.description("Test Agent rule".to_string())
.enabled(true)
.expression(r#"exec.file.name == "sh""#.to_string()),
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
)
.id(agent_rule_data_id.clone()),
);
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.update_csm_threats_agent_rule(agent_rule_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub async fn update_csm_threats_agent_rule_with_http_info(
&self,
agent_rule_id: String,
body: CloudWorkloadSecurityAgentRuleUpdateRequest,
) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCSMThreatsAgentRuleError>>
pub async fn update_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, body: CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRuleResponse>, Error<UpdateCSMThreatsAgentRuleError>>
Update a specific Cloud Security Management Threats Agent rule. Returns the Agent rule object when the request is successful.
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.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
async fn main() {
// there is a valid "agent_rule" in the system
let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap();
let body = CloudWorkloadSecurityAgentRuleUpdateRequest::new(
CloudWorkloadSecurityAgentRuleUpdateData::new(
CloudWorkloadSecurityAgentRuleUpdateAttributes::new()
.description("Test Agent rule".to_string())
.enabled(true)
.expression(r#"exec.file.name == "sh""#.to_string()),
CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
)
.id(agent_rule_data_id.clone()),
);
let configuration = datadog::Configuration::new();
let api = CSMThreatsAPI::with_config(configuration);
let resp = api
.update_cloud_workload_security_agent_rule(agent_rule_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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.
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 moresource§impl Debug for CSMThreatsAPI
impl Debug for CSMThreatsAPI
Auto Trait Implementations§
impl Freeze for CSMThreatsAPI
impl !RefUnwindSafe for CSMThreatsAPI
impl Send for CSMThreatsAPI
impl Sync for CSMThreatsAPI
impl Unpin for CSMThreatsAPI
impl !UnwindSafe for CSMThreatsAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)