Struct datadog_api_client::datadogV2::model::model_custom_destination_update_request_attributes::CustomDestinationUpdateRequestAttributes
source · #[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?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn enabled(self, value: bool) -> Self
pub fn enabled(self, value: bool) -> Self
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn query(self, value: String) -> Self
pub fn query(self, value: String) -> Self
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
async fn main() {
// there is a valid "custom_destination" in the system
let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
let body = CustomDestinationUpdateRequest::new().data(
CustomDestinationUpdateRequestDefinition::new(
custom_destination_data_id.clone(),
CustomDestinationType::CUSTOM_DESTINATION,
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = LogsCustomDestinationsAPI::with_config(configuration);
let resp = api
.update_logs_custom_destination(custom_destination_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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 ==.impl StructuralPartialEq for CustomDestinationUpdateRequestAttributes
Auto Trait Implementations§
impl Freeze for CustomDestinationUpdateRequestAttributes
impl RefUnwindSafe for CustomDestinationUpdateRequestAttributes
impl Send for CustomDestinationUpdateRequestAttributes
impl Sync for CustomDestinationUpdateRequestAttributes
impl Unpin for CustomDestinationUpdateRequestAttributes
impl UnwindSafe for CustomDestinationUpdateRequestAttributes
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)