pub struct SensitiveDataScannerAPI { /* private fields */ }
Expand description
Create, update, delete, and retrieve sensitive data scanner groups and rules. See the Sensitive Data Scanner page for more information.
Implementations§
Source§impl SensitiveDataScannerAPI
impl SensitiveDataScannerAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
8async fn main() {
9 // the "scanning_group" has a "scanning_rule"
10 let rule_data_id = std::env::var("RULE_DATA_ID").unwrap();
11 let body =
12 SensitiveDataScannerRuleDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new());
13 let configuration = datadog::Configuration::new();
14 let api = SensitiveDataScannerAPI::with_config(configuration);
15 let resp = api.delete_scanning_rule(rule_data_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
8async fn main() {
9 // there is a valid "scanning_group" in the system
10 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
11 let body =
12 SensitiveDataScannerGroupDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new());
13 let configuration = datadog::Configuration::new();
14 let api = SensitiveDataScannerAPI::with_config(configuration);
15 let resp = api.delete_scanning_group(group_data_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
14async fn main() {
15 // there is a valid "scanning_group" in the system
16 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
17
18 // a valid "configuration" in the system
19 let configuration_data_id = std::env::var("CONFIGURATION_DATA_ID").unwrap();
20 let body = SensitiveDataScannerConfigRequest::new(
21 SensitiveDataScannerReorderConfig::new()
22 .id(configuration_data_id.clone())
23 .relationships(
24 SensitiveDataScannerConfigurationRelationships::new().groups(
25 SensitiveDataScannerGroupList::new().data(vec![
26 SensitiveDataScannerGroupItem::new()
27 .id(group_data_id.clone())
28 .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP),
29 ]),
30 ),
31 )
32 .type_(SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS),
33 SensitiveDataScannerMetaVersionOnly::new(),
34 );
35 let configuration = datadog::Configuration::new();
36 let api = SensitiveDataScannerAPI::with_config(configuration);
37 let resp = api.reorder_scanning_groups(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
14async fn main() {
15 // the "scanning_group" has a "scanning_rule"
16 let rule_data_id = std::env::var("RULE_DATA_ID").unwrap();
17 let body = SensitiveDataScannerRuleUpdateRequest::new(
18 SensitiveDataScannerRuleUpdate::new()
19 .attributes(
20 SensitiveDataScannerRuleAttributes::new()
21 .included_keyword_configuration(
22 SensitiveDataScannerIncludedKeywordConfiguration::new(
23 35,
24 vec!["credit card".to_string(), "cc".to_string()],
25 ),
26 )
27 .is_enabled(true)
28 .name("Example-Sensitive-Data-Scanner".to_string())
29 .pattern("pattern".to_string())
30 .priority(5)
31 .tags(vec!["sensitive_data:true".to_string()])
32 .text_replacement(
33 SensitiveDataScannerTextReplacement::new()
34 .type_(SensitiveDataScannerTextReplacementType::NONE),
35 ),
36 )
37 .id(rule_data_id.clone())
38 .type_(SensitiveDataScannerRuleType::SENSITIVE_DATA_SCANNER_RULE),
39 SensitiveDataScannerMetaVersionOnly::new(),
40 );
41 let configuration = datadog::Configuration::new();
42 let api = SensitiveDataScannerAPI::with_config(configuration);
43 let resp = api.update_scanning_rule(rule_data_id.clone(), body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_scanning_group(
&self,
body: SensitiveDataScannerGroupCreateRequest,
) -> Result<SensitiveDataScannerCreateGroupResponse, Error<CreateScanningGroupError>>
pub async fn create_scanning_group( &self, body: SensitiveDataScannerGroupCreateRequest, ) -> Result<SensitiveDataScannerCreateGroupResponse, Error<CreateScanningGroupError>>
Create a scanning group. The request MAY include a configuration relationship. A rules relationship can be omitted entirely, but if it is included it MUST be null or an empty array (rules cannot be created at the same time). The new group will be ordered last within the configuration.
Examples found in repository?
18async fn main() {
19 // a valid "configuration" in the system
20 let configuration_data_id = std::env::var("CONFIGURATION_DATA_ID").unwrap();
21 let body =
22 SensitiveDataScannerGroupCreateRequest::new()
23 .data(
24 SensitiveDataScannerGroupCreate::new(
25 SensitiveDataScannerGroupAttributes::new()
26 .filter(SensitiveDataScannerFilter::new().query("*".to_string()))
27 .is_enabled(false)
28 .name("Example-Sensitive-Data-Scanner".to_string())
29 .product_list(vec![SensitiveDataScannerProduct::LOGS]),
30 SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP,
31 ).relationships(
32 SensitiveDataScannerGroupRelationships::new()
33 .configuration(
34 SensitiveDataScannerConfigurationData
35 ::new().data(
36 SensitiveDataScannerConfiguration::new()
37 .id(configuration_data_id.clone())
38 .type_(
39 SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS,
40 ),
41 ),
42 )
43 .rules(SensitiveDataScannerRuleData::new().data(vec![])),
44 ),
45 )
46 .meta(SensitiveDataScannerMetaVersionOnly::new());
47 let configuration = datadog::Configuration::new();
48 let api = SensitiveDataScannerAPI::with_config(configuration);
49 let resp = api.create_scanning_group(body).await;
50 if let Ok(value) = resp {
51 println!("{:#?}", value);
52 } else {
53 println!("{:#?}", resp.unwrap_err());
54 }
55}
Sourcepub async fn create_scanning_group_with_http_info(
&self,
body: SensitiveDataScannerGroupCreateRequest,
) -> Result<ResponseContent<SensitiveDataScannerCreateGroupResponse>, Error<CreateScanningGroupError>>
pub async fn create_scanning_group_with_http_info( &self, body: SensitiveDataScannerGroupCreateRequest, ) -> Result<ResponseContent<SensitiveDataScannerCreateGroupResponse>, Error<CreateScanningGroupError>>
Create a scanning group. The request MAY include a configuration relationship. A rules relationship can be omitted entirely, but if it is included it MUST be null or an empty array (rules cannot be created at the same time). The new group will be ordered last within the configuration.
Sourcepub async fn create_scanning_rule(
&self,
body: SensitiveDataScannerRuleCreateRequest,
) -> Result<SensitiveDataScannerCreateRuleResponse, Error<CreateScanningRuleError>>
pub async fn create_scanning_rule( &self, body: SensitiveDataScannerRuleCreateRequest, ) -> Result<SensitiveDataScannerCreateRuleResponse, Error<CreateScanningRuleError>>
Create a scanning rule in a sensitive data scanner group, ordered last. The posted rule MUST include a group relationship. It MUST include either a standard_pattern relationship or a regex attribute, but not both. If included_attributes is empty or missing, we will scan all attributes except excluded_attributes. If both are missing, we will scan the whole event.
Examples found in repository?
18async fn main() {
19 // there is a valid "scanning_group" in the system
20 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
21 let body = SensitiveDataScannerRuleCreateRequest::new(
22 SensitiveDataScannerRuleCreate::new(
23 SensitiveDataScannerRuleAttributes::new()
24 .excluded_namespaces(vec!["admin.name".to_string()])
25 .included_keyword_configuration(
26 SensitiveDataScannerIncludedKeywordConfiguration::new(
27 35,
28 vec!["credit card".to_string()],
29 ),
30 )
31 .is_enabled(true)
32 .name("Example-Sensitive-Data-Scanner".to_string())
33 .namespaces(vec!["admin".to_string()])
34 .pattern("pattern".to_string())
35 .priority(1)
36 .tags(vec!["sensitive_data:true".to_string()])
37 .text_replacement(
38 SensitiveDataScannerTextReplacement::new()
39 .type_(SensitiveDataScannerTextReplacementType::NONE),
40 ),
41 SensitiveDataScannerRuleRelationships::new().group(
42 SensitiveDataScannerGroupData::new().data(
43 SensitiveDataScannerGroup::new()
44 .id(group_data_id.clone())
45 .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP),
46 ),
47 ),
48 SensitiveDataScannerRuleType::SENSITIVE_DATA_SCANNER_RULE,
49 ),
50 SensitiveDataScannerMetaVersionOnly::new(),
51 );
52 let configuration = datadog::Configuration::new();
53 let api = SensitiveDataScannerAPI::with_config(configuration);
54 let resp = api.create_scanning_rule(body).await;
55 if let Ok(value) = resp {
56 println!("{:#?}", value);
57 } else {
58 println!("{:#?}", resp.unwrap_err());
59 }
60}
Sourcepub async fn create_scanning_rule_with_http_info(
&self,
body: SensitiveDataScannerRuleCreateRequest,
) -> Result<ResponseContent<SensitiveDataScannerCreateRuleResponse>, Error<CreateScanningRuleError>>
pub async fn create_scanning_rule_with_http_info( &self, body: SensitiveDataScannerRuleCreateRequest, ) -> Result<ResponseContent<SensitiveDataScannerCreateRuleResponse>, Error<CreateScanningRuleError>>
Create a scanning rule in a sensitive data scanner group, ordered last. The posted rule MUST include a group relationship. It MUST include either a standard_pattern relationship or a regex attribute, but not both. If included_attributes is empty or missing, we will scan all attributes except excluded_attributes. If both are missing, we will scan the whole event.
Sourcepub async fn delete_scanning_group(
&self,
group_id: String,
body: SensitiveDataScannerGroupDeleteRequest,
) -> Result<SensitiveDataScannerGroupDeleteResponse, Error<DeleteScanningGroupError>>
pub async fn delete_scanning_group( &self, group_id: String, body: SensitiveDataScannerGroupDeleteRequest, ) -> Result<SensitiveDataScannerGroupDeleteResponse, Error<DeleteScanningGroupError>>
Delete a given group.
Examples found in repository?
8async fn main() {
9 // there is a valid "scanning_group" in the system
10 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
11 let body =
12 SensitiveDataScannerGroupDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new());
13 let configuration = datadog::Configuration::new();
14 let api = SensitiveDataScannerAPI::with_config(configuration);
15 let resp = api.delete_scanning_group(group_data_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn delete_scanning_group_with_http_info(
&self,
group_id: String,
body: SensitiveDataScannerGroupDeleteRequest,
) -> Result<ResponseContent<SensitiveDataScannerGroupDeleteResponse>, Error<DeleteScanningGroupError>>
pub async fn delete_scanning_group_with_http_info( &self, group_id: String, body: SensitiveDataScannerGroupDeleteRequest, ) -> Result<ResponseContent<SensitiveDataScannerGroupDeleteResponse>, Error<DeleteScanningGroupError>>
Delete a given group.
Sourcepub async fn delete_scanning_rule(
&self,
rule_id: String,
body: SensitiveDataScannerRuleDeleteRequest,
) -> Result<SensitiveDataScannerRuleDeleteResponse, Error<DeleteScanningRuleError>>
pub async fn delete_scanning_rule( &self, rule_id: String, body: SensitiveDataScannerRuleDeleteRequest, ) -> Result<SensitiveDataScannerRuleDeleteResponse, Error<DeleteScanningRuleError>>
Delete a given rule.
Examples found in repository?
8async fn main() {
9 // the "scanning_group" has a "scanning_rule"
10 let rule_data_id = std::env::var("RULE_DATA_ID").unwrap();
11 let body =
12 SensitiveDataScannerRuleDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new());
13 let configuration = datadog::Configuration::new();
14 let api = SensitiveDataScannerAPI::with_config(configuration);
15 let resp = api.delete_scanning_rule(rule_data_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn delete_scanning_rule_with_http_info(
&self,
rule_id: String,
body: SensitiveDataScannerRuleDeleteRequest,
) -> Result<ResponseContent<SensitiveDataScannerRuleDeleteResponse>, Error<DeleteScanningRuleError>>
pub async fn delete_scanning_rule_with_http_info( &self, rule_id: String, body: SensitiveDataScannerRuleDeleteRequest, ) -> Result<ResponseContent<SensitiveDataScannerRuleDeleteResponse>, Error<DeleteScanningRuleError>>
Delete a given rule.
Sourcepub async fn list_scanning_groups(
&self,
) -> Result<SensitiveDataScannerGetConfigResponse, Error<ListScanningGroupsError>>
pub async fn list_scanning_groups( &self, ) -> Result<SensitiveDataScannerGetConfigResponse, Error<ListScanningGroupsError>>
List all the Scanning groups in your organization.
Sourcepub async fn list_scanning_groups_with_http_info(
&self,
) -> Result<ResponseContent<SensitiveDataScannerGetConfigResponse>, Error<ListScanningGroupsError>>
pub async fn list_scanning_groups_with_http_info( &self, ) -> Result<ResponseContent<SensitiveDataScannerGetConfigResponse>, Error<ListScanningGroupsError>>
List all the Scanning groups in your organization.
Sourcepub async fn list_standard_patterns(
&self,
) -> Result<SensitiveDataScannerStandardPatternsResponseData, Error<ListStandardPatternsError>>
pub async fn list_standard_patterns( &self, ) -> Result<SensitiveDataScannerStandardPatternsResponseData, Error<ListStandardPatternsError>>
Returns all standard patterns.
Sourcepub async fn list_standard_patterns_with_http_info(
&self,
) -> Result<ResponseContent<SensitiveDataScannerStandardPatternsResponseData>, Error<ListStandardPatternsError>>
pub async fn list_standard_patterns_with_http_info( &self, ) -> Result<ResponseContent<SensitiveDataScannerStandardPatternsResponseData>, Error<ListStandardPatternsError>>
Returns all standard patterns.
Sourcepub async fn reorder_scanning_groups(
&self,
body: SensitiveDataScannerConfigRequest,
) -> Result<SensitiveDataScannerReorderGroupsResponse, Error<ReorderScanningGroupsError>>
pub async fn reorder_scanning_groups( &self, body: SensitiveDataScannerConfigRequest, ) -> Result<SensitiveDataScannerReorderGroupsResponse, Error<ReorderScanningGroupsError>>
Reorder the list of groups.
Examples found in repository?
14async fn main() {
15 // there is a valid "scanning_group" in the system
16 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
17
18 // a valid "configuration" in the system
19 let configuration_data_id = std::env::var("CONFIGURATION_DATA_ID").unwrap();
20 let body = SensitiveDataScannerConfigRequest::new(
21 SensitiveDataScannerReorderConfig::new()
22 .id(configuration_data_id.clone())
23 .relationships(
24 SensitiveDataScannerConfigurationRelationships::new().groups(
25 SensitiveDataScannerGroupList::new().data(vec![
26 SensitiveDataScannerGroupItem::new()
27 .id(group_data_id.clone())
28 .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP),
29 ]),
30 ),
31 )
32 .type_(SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS),
33 SensitiveDataScannerMetaVersionOnly::new(),
34 );
35 let configuration = datadog::Configuration::new();
36 let api = SensitiveDataScannerAPI::with_config(configuration);
37 let resp = api.reorder_scanning_groups(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
Sourcepub async fn reorder_scanning_groups_with_http_info(
&self,
body: SensitiveDataScannerConfigRequest,
) -> Result<ResponseContent<SensitiveDataScannerReorderGroupsResponse>, Error<ReorderScanningGroupsError>>
pub async fn reorder_scanning_groups_with_http_info( &self, body: SensitiveDataScannerConfigRequest, ) -> Result<ResponseContent<SensitiveDataScannerReorderGroupsResponse>, Error<ReorderScanningGroupsError>>
Reorder the list of groups.
Sourcepub async fn update_scanning_group(
&self,
group_id: String,
body: SensitiveDataScannerGroupUpdateRequest,
) -> Result<SensitiveDataScannerGroupUpdateResponse, Error<UpdateScanningGroupError>>
pub async fn update_scanning_group( &self, group_id: String, body: SensitiveDataScannerGroupUpdateRequest, ) -> Result<SensitiveDataScannerGroupUpdateResponse, Error<UpdateScanningGroupError>>
Update a group, including the order of the rules. Rules within the group are reordered by including a rules relationship. If the rules relationship is present, its data section MUST contain linkages for all of the rules currently in the group, and MUST NOT contain any others.
Examples found in repository?
18async fn main() {
19 // there is a valid "scanning_group" in the system
20 let group_data_id = std::env::var("GROUP_DATA_ID").unwrap();
21
22 // a valid "configuration" in the system
23 let configuration_data_id = std::env::var("CONFIGURATION_DATA_ID").unwrap();
24 let body =
25 SensitiveDataScannerGroupUpdateRequest::new(
26 SensitiveDataScannerGroupUpdate::new()
27 .attributes(
28 SensitiveDataScannerGroupAttributes::new()
29 .filter(SensitiveDataScannerFilter::new().query("*".to_string()))
30 .is_enabled(false)
31 .name("Example-Sensitive-Data-Scanner".to_string())
32 .product_list(vec![SensitiveDataScannerProduct::LOGS]),
33 )
34 .id(group_data_id.clone())
35 .relationships(
36 SensitiveDataScannerGroupRelationships::new()
37 .configuration(
38 SensitiveDataScannerConfigurationData
39 ::new().data(
40 SensitiveDataScannerConfiguration::new()
41 .id(configuration_data_id.clone())
42 .type_(
43 SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS,
44 ),
45 ),
46 )
47 .rules(SensitiveDataScannerRuleData::new().data(vec![])),
48 )
49 .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP),
50 SensitiveDataScannerMetaVersionOnly::new(),
51 );
52 let configuration = datadog::Configuration::new();
53 let api = SensitiveDataScannerAPI::with_config(configuration);
54 let resp = api.update_scanning_group(group_data_id.clone(), body).await;
55 if let Ok(value) = resp {
56 println!("{:#?}", value);
57 } else {
58 println!("{:#?}", resp.unwrap_err());
59 }
60}
Sourcepub async fn update_scanning_group_with_http_info(
&self,
group_id: String,
body: SensitiveDataScannerGroupUpdateRequest,
) -> Result<ResponseContent<SensitiveDataScannerGroupUpdateResponse>, Error<UpdateScanningGroupError>>
pub async fn update_scanning_group_with_http_info( &self, group_id: String, body: SensitiveDataScannerGroupUpdateRequest, ) -> Result<ResponseContent<SensitiveDataScannerGroupUpdateResponse>, Error<UpdateScanningGroupError>>
Update a group, including the order of the rules. Rules within the group are reordered by including a rules relationship. If the rules relationship is present, its data section MUST contain linkages for all of the rules currently in the group, and MUST NOT contain any others.
Sourcepub async fn update_scanning_rule(
&self,
rule_id: String,
body: SensitiveDataScannerRuleUpdateRequest,
) -> Result<SensitiveDataScannerRuleUpdateResponse, Error<UpdateScanningRuleError>>
pub async fn update_scanning_rule( &self, rule_id: String, body: SensitiveDataScannerRuleUpdateRequest, ) -> Result<SensitiveDataScannerRuleUpdateResponse, Error<UpdateScanningRuleError>>
Update a scanning rule. The request body MUST NOT include a standard_pattern relationship, as that relationship is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern relationship will also result in an error.
Examples found in repository?
14async fn main() {
15 // the "scanning_group" has a "scanning_rule"
16 let rule_data_id = std::env::var("RULE_DATA_ID").unwrap();
17 let body = SensitiveDataScannerRuleUpdateRequest::new(
18 SensitiveDataScannerRuleUpdate::new()
19 .attributes(
20 SensitiveDataScannerRuleAttributes::new()
21 .included_keyword_configuration(
22 SensitiveDataScannerIncludedKeywordConfiguration::new(
23 35,
24 vec!["credit card".to_string(), "cc".to_string()],
25 ),
26 )
27 .is_enabled(true)
28 .name("Example-Sensitive-Data-Scanner".to_string())
29 .pattern("pattern".to_string())
30 .priority(5)
31 .tags(vec!["sensitive_data:true".to_string()])
32 .text_replacement(
33 SensitiveDataScannerTextReplacement::new()
34 .type_(SensitiveDataScannerTextReplacementType::NONE),
35 ),
36 )
37 .id(rule_data_id.clone())
38 .type_(SensitiveDataScannerRuleType::SENSITIVE_DATA_SCANNER_RULE),
39 SensitiveDataScannerMetaVersionOnly::new(),
40 );
41 let configuration = datadog::Configuration::new();
42 let api = SensitiveDataScannerAPI::with_config(configuration);
43 let resp = api.update_scanning_rule(rule_data_id.clone(), body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
Sourcepub async fn update_scanning_rule_with_http_info(
&self,
rule_id: String,
body: SensitiveDataScannerRuleUpdateRequest,
) -> Result<ResponseContent<SensitiveDataScannerRuleUpdateResponse>, Error<UpdateScanningRuleError>>
pub async fn update_scanning_rule_with_http_info( &self, rule_id: String, body: SensitiveDataScannerRuleUpdateRequest, ) -> Result<ResponseContent<SensitiveDataScannerRuleUpdateResponse>, Error<UpdateScanningRuleError>>
Update a scanning rule. The request body MUST NOT include a standard_pattern relationship, as that relationship is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern relationship will also result in an error.
Trait Implementations§
Source§impl Clone for SensitiveDataScannerAPI
impl Clone for SensitiveDataScannerAPI
Source§fn clone(&self) -> SensitiveDataScannerAPI
fn clone(&self) -> SensitiveDataScannerAPI
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more