#[non_exhaustive]pub struct BackendServiceLogConfig {
pub enable: Option<bool>,
pub optional_fields: Vec<String>,
pub optional_mode: Option<OptionalMode>,
pub sample_rate: Option<f32>,
/* private fields */
}backend-services or region-backend-services only.Expand description
The available logging options for the load balancer traffic served by this backend service.
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.enable: Option<bool>Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false.
optional_fields: Vec<String>This field can only be specified if logging is enabled for this backend service and “logConfig.optionalMode” was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace
optional_mode: Option<OptionalMode>This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL.
sample_rate: Option<f32>This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.
Implementations§
Source§impl BackendServiceLogConfig
impl BackendServiceLogConfig
pub fn new() -> Self
Sourcepub fn set_enable<T>(self, v: T) -> Self
pub fn set_enable<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_enable<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_enable<T>(self, v: Option<T>) -> Self
Sourcepub fn set_optional_fields<T, V>(self, v: T) -> Self
pub fn set_optional_fields<T, V>(self, v: T) -> Self
Sets the value of optional_fields.
§Example
let x = BackendServiceLogConfig::new().set_optional_fields(["a", "b", "c"]);Sourcepub fn set_optional_mode<T>(self, v: T) -> Selfwhere
T: Into<OptionalMode>,
pub fn set_optional_mode<T>(self, v: T) -> Selfwhere
T: Into<OptionalMode>,
Sets the value of optional_mode.
§Example
use google_cloud_compute_v1::model::backend_service_log_config::OptionalMode;
let x0 = BackendServiceLogConfig::new().set_optional_mode(OptionalMode::ExcludeAllOptional);
let x1 = BackendServiceLogConfig::new().set_optional_mode(OptionalMode::IncludeAllOptional);Sourcepub fn set_or_clear_optional_mode<T>(self, v: Option<T>) -> Selfwhere
T: Into<OptionalMode>,
pub fn set_or_clear_optional_mode<T>(self, v: Option<T>) -> Selfwhere
T: Into<OptionalMode>,
Sets or clears the value of optional_mode.
§Example
use google_cloud_compute_v1::model::backend_service_log_config::OptionalMode;
let x0 = BackendServiceLogConfig::new().set_or_clear_optional_mode(Some(OptionalMode::ExcludeAllOptional));
let x1 = BackendServiceLogConfig::new().set_or_clear_optional_mode(Some(OptionalMode::IncludeAllOptional));
let x_none = BackendServiceLogConfig::new().set_or_clear_optional_mode(None::<OptionalMode>);Sourcepub fn set_sample_rate<T>(self, v: T) -> Self
pub fn set_sample_rate<T>(self, v: T) -> Self
Sets the value of sample_rate.
§Example
let x = BackendServiceLogConfig::new().set_sample_rate(42.0);Sourcepub fn set_or_clear_sample_rate<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_sample_rate<T>(self, v: Option<T>) -> Self
Sets or clears the value of sample_rate.
§Example
let x = BackendServiceLogConfig::new().set_or_clear_sample_rate(Some(42.0));
let x = BackendServiceLogConfig::new().set_or_clear_sample_rate(None::<f32>);Trait Implementations§
Source§impl Clone for BackendServiceLogConfig
impl Clone for BackendServiceLogConfig
Source§fn clone(&self) -> BackendServiceLogConfig
fn clone(&self) -> BackendServiceLogConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more