#[non_exhaustive]pub struct CustomDestinationUpdateRequestAttributes {
pub enabled: Option<bool>,
pub forward_tags: Option<bool>,
pub forward_tags_restriction_list: Option<Vec<String>>,
pub forward_tags_restriction_list_type: Option<CustomDestinationAttributeTagsRestrictionListType>,
pub forwarder_destination: Option<CustomDestinationForwardDestination>,
pub name: Option<String>,
pub query: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The attributes associated with the custom destination.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.enabled: Option<bool>
Whether logs matching this custom destination should be forwarded or not.
Whether tags from the forwarded logs should be forwarded or not.
List of keys of tags to be restricted from being forwarded.
An empty list represents no restriction is in place and either all or no tags will be forwarded depending on forward_tags_restriction_list_type
parameter.
How forward_tags_restriction_list
parameter should be interpreted.
If ALLOW_LIST
, then only tags whose keys on the forwarded logs match the ones on the restriction list
are forwarded.
BLOCK_LIST
works the opposite way. It does not forward the tags matching the ones on the list.
forwarder_destination: Option<CustomDestinationForwardDestination>
A custom destination’s location to forward logs.
name: Option<String>
The custom destination name.
query: Option<String>
The custom destination query and filter. Logs matching this query are forwarded to the destination.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CustomDestinationUpdateRequestAttributes
impl CustomDestinationUpdateRequestAttributes
Sourcepub fn new() -> CustomDestinationUpdateRequestAttributes
pub fn new() -> CustomDestinationUpdateRequestAttributes
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn enabled(self, value: bool) -> Self
pub fn enabled(self, value: bool) -> Self
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
pub fn forwarder_destination( self, value: CustomDestinationForwardDestination, ) -> Self
Sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn query(self, value: String) -> Self
pub fn query(self, value: String) -> Self
Examples found in repository?
11async fn main() {
12 // there is a valid "custom_destination" in the system
13 let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
14 let body = CustomDestinationUpdateRequest::new().data(
15 CustomDestinationUpdateRequestDefinition::new(
16 custom_destination_data_id.clone(),
17 CustomDestinationType::CUSTOM_DESTINATION,
18 )
19 .attributes(
20 CustomDestinationUpdateRequestAttributes::new()
21 .enabled(false)
22 .forward_tags(false)
23 .forward_tags_restriction_list_type(
24 CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
25 )
26 .name("Nginx logs (Updated)".to_string())
27 .query("source:nginx".to_string()),
28 ),
29 );
30 let configuration = datadog::Configuration::new();
31 let api = LogsCustomDestinationsAPI::with_config(configuration);
32 let resp = api
33 .update_logs_custom_destination(custom_destination_data_id.clone(), body)
34 .await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CustomDestinationUpdateRequestAttributes
impl Clone for CustomDestinationUpdateRequestAttributes
Source§fn clone(&self) -> CustomDestinationUpdateRequestAttributes
fn clone(&self) -> CustomDestinationUpdateRequestAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de> Deserialize<'de> for CustomDestinationUpdateRequestAttributes
impl<'de> Deserialize<'de> for CustomDestinationUpdateRequestAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for CustomDestinationUpdateRequestAttributes
impl PartialEq for CustomDestinationUpdateRequestAttributes
Source§fn eq(&self, other: &CustomDestinationUpdateRequestAttributes) -> bool
fn eq(&self, other: &CustomDestinationUpdateRequestAttributes) -> bool
self
and other
values to be equal, and is used by ==
.