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

source

pub fn new() -> Self

source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_csm-threats_download_csm_threats_policy.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.download_csm_threats_policy().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v2_csm-threats_list_csm_threats_agent_rules.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.list_csm_threats_agent_rules().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_csm-threats_download_cloud_workload_policy_file.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.download_cloud_workload_policy_file().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_csm-threats_list_cloud_workload_security_agent_rules.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.list_cloud_workload_security_agent_rules().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_csm-threats_get_csm_threats_agent_rule.rs (line 10)
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());
    }
}
examples/v2_csm-threats_delete_csm_threats_agent_rule.rs (line 10)
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());
    }
}
source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

source

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?
examples/v2_csm-threats_create_csm_threats_agent_rule.rs (line 25)
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());
    }
}
source

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.

source

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?
examples/v2_csm-threats_create_cloud_workload_security_agent_rule.rs (line 24)
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());
    }
}
source

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.

source

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?
examples/v2_csm-threats_delete_csm_threats_agent_rule.rs (line 12)
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());
    }
}
source

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.

source

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?
examples/v2_csm-threats_delete_cloud_workload_security_agent_rule.rs (line 12)
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());
    }
}
source

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.

source

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.

Examples found in repository?
examples/v2_csm-threats_download_csm_threats_policy.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.download_csm_threats_policy().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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.

source

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.

Examples found in repository?
examples/v2_csm-threats_download_cloud_workload_policy_file.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.download_cloud_workload_policy_file().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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.

source

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?
examples/v2_csm-threats_get_csm_threats_agent_rule.rs (line 12)
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());
    }
}
source

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.

source

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?
examples/v2_csm-threats_get_cloud_workload_security_agent_rule.rs (line 12)
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());
    }
}
source

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.

source

pub async fn list_csm_threats_agent_rules( &self, ) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCSMThreatsAgentRulesError>>

Get the list of Cloud Security Management Threats Agent rules.

Examples found in repository?
examples/v2_csm-threats_list_csm_threats_agent_rules.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.list_csm_threats_agent_rules().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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.

source

pub async fn list_cloud_workload_security_agent_rules( &self, ) -> Result<CloudWorkloadSecurityAgentRulesListResponse, Error<ListCloudWorkloadSecurityAgentRulesError>>

Get the list of Agent rules.

Examples found in repository?
examples/v2_csm-threats_list_cloud_workload_security_agent_rules.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CSMThreatsAPI::with_config(configuration);
    let resp = api.list_cloud_workload_security_agent_rules().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn list_cloud_workload_security_agent_rules_with_http_info( &self, ) -> Result<ResponseContent<CloudWorkloadSecurityAgentRulesListResponse>, Error<ListCloudWorkloadSecurityAgentRulesError>>

Get the list of Agent rules.

source

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?
examples/v2_csm-threats_update_csm_threats_agent_rule.rs (line 26)
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());
    }
}
source

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.

source

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?
examples/v2_csm-threats_update_cloud_workload_security_agent_rule.rs (line 26)
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());
    }
}
source

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

source§

fn clone(&self) -> CSMThreatsAPI

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CSMThreatsAPI

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CSMThreatsAPI

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more