#[non_exhaustive]pub struct VpcFlowLogsConfig {Show 14 fields
pub name: String,
pub description: Option<String>,
pub state: Option<State>,
pub aggregation_interval: Option<AggregationInterval>,
pub flow_sampling: Option<f32>,
pub metadata: Option<Metadata>,
pub metadata_fields: Vec<String>,
pub filter_expr: Option<String>,
pub cross_project_metadata: Option<CrossProjectMetadata>,
pub target_resource_state: Option<TargetResourceState>,
pub labels: HashMap<String, String>,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub target_resource: Option<TargetResource>,
/* private fields */
}Expand description
A configuration to generate VPC Flow Logs.
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.name: StringIdentifier. Unique name of the configuration. The name can have one of the following forms:
-
For project-level configurations:
projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id} -
For organization-level configurations:
organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}
description: Option<String>Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
state: Option<State>Optional. The state of the VPC Flow Log configuration. Default value is ENABLED. When creating a new configuration, it must be enabled. Setting state=DISABLED will pause the log generation for this config.
aggregation_interval: Option<AggregationInterval>Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
flow_sampling: Option<f32>Optional. The value of the field must be in (0, 1]. The sampling rate of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use the state field instead. Default value is 1.0.
metadata: Option<Metadata>Optional. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
metadata_fields: Vec<String>Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if “metadata” was set to CUSTOM_METADATA.
filter_expr: Option<String>Optional. Export filter used to define which VPC Flow Logs should be logged.
cross_project_metadata: Option<CrossProjectMetadata>Optional. Determines whether to include cross project annotations in the logs. This field is available only for organization configurations. If not specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
target_resource_state: Option<TargetResourceState>Output only. Describes the state of the configured target resource for diagnostic purposes.
labels: HashMap<String, String>Optional. Resource labels to represent user-provided metadata.
create_time: Option<Timestamp>Output only. The time the config was created.
update_time: Option<Timestamp>Output only. The time the config was updated.
target_resource: Option<TargetResource>Reference to the resource of the config scope. That is, the scope from which traffic is logged. The target resource must belong to the same project as the configuration. This field is not supported for organization level configurations.
Implementations§
Source§impl VpcFlowLogsConfig
impl VpcFlowLogsConfig
pub fn new() -> Self
Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sets the value of description.
§Example
let x = VpcFlowLogsConfig::new().set_description("example");Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);Sourcepub fn set_or_clear_state<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_state<T>(self, v: Option<T>) -> Self
Sets or clears the value of state.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);Sourcepub fn set_aggregation_interval<T>(self, v: T) -> Selfwhere
T: Into<AggregationInterval>,
pub fn set_aggregation_interval<T>(self, v: T) -> Selfwhere
T: Into<AggregationInterval>,
Sets the value of aggregation_interval.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);Sourcepub fn set_or_clear_aggregation_interval<T>(self, v: Option<T>) -> Selfwhere
T: Into<AggregationInterval>,
pub fn set_or_clear_aggregation_interval<T>(self, v: Option<T>) -> Selfwhere
T: Into<AggregationInterval>,
Sets or clears the value of aggregation_interval.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);Sourcepub fn set_flow_sampling<T>(self, v: T) -> Self
pub fn set_flow_sampling<T>(self, v: T) -> Self
Sets the value of flow_sampling.
§Example
let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);Sourcepub fn set_or_clear_flow_sampling<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_flow_sampling<T>(self, v: Option<T>) -> Self
Sets or clears the value of flow_sampling.
§Example
let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);Sourcepub fn set_metadata<T>(self, v: T) -> Self
pub fn set_metadata<T>(self, v: T) -> Self
Sets the value of metadata.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);Sourcepub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
Sets or clears the value of metadata.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);Sourcepub fn set_metadata_fields<T, V>(self, v: T) -> Self
pub fn set_metadata_fields<T, V>(self, v: T) -> Self
Sets the value of metadata_fields.
§Example
let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);Sourcepub fn set_filter_expr<T>(self, v: T) -> Self
pub fn set_filter_expr<T>(self, v: T) -> Self
Sets the value of filter_expr.
§Example
let x = VpcFlowLogsConfig::new().set_filter_expr("example");Sourcepub fn set_or_clear_filter_expr<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_filter_expr<T>(self, v: Option<T>) -> Self
Sets or clears the value of filter_expr.
§Example
let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);Sourcepub fn set_cross_project_metadata<T>(self, v: T) -> Selfwhere
T: Into<CrossProjectMetadata>,
pub fn set_cross_project_metadata<T>(self, v: T) -> Selfwhere
T: Into<CrossProjectMetadata>,
Sets the value of cross_project_metadata.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);Sourcepub fn set_or_clear_cross_project_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<CrossProjectMetadata>,
pub fn set_or_clear_cross_project_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<CrossProjectMetadata>,
Sets or clears the value of cross_project_metadata.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);Sourcepub fn set_target_resource_state<T>(self, v: T) -> Selfwhere
T: Into<TargetResourceState>,
pub fn set_target_resource_state<T>(self, v: T) -> Selfwhere
T: Into<TargetResourceState>,
Sets the value of target_resource_state.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);Sourcepub fn set_or_clear_target_resource_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetResourceState>,
pub fn set_or_clear_target_resource_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetResourceState>,
Sets or clears the value of target_resource_state.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_target_resource<T: Into<Option<TargetResource>>>(self, v: T) -> Self
pub fn set_target_resource<T: Into<Option<TargetResource>>>(self, v: T) -> Self
Sets the value of target_resource.
Note that all the setters affecting target_resource are mutually
exclusive.
§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));Sourcepub fn network(&self) -> Option<&String>
pub fn network(&self) -> Option<&String>
The value of target_resource
if it holds a Network, None if the field is not set or
holds a different branch.
Sourcepub fn set_network<T: Into<String>>(self, v: T) -> Self
pub fn set_network<T: Into<String>>(self, v: T) -> Self
Sets the value of target_resource
to hold a Network.
Note that all the setters affecting target_resource are
mutually exclusive.
§Example
let x = VpcFlowLogsConfig::new().set_network("example");
assert!(x.network().is_some());
assert!(x.subnet().is_none());
assert!(x.interconnect_attachment().is_none());
assert!(x.vpn_tunnel().is_none());Sourcepub fn subnet(&self) -> Option<&String>
pub fn subnet(&self) -> Option<&String>
The value of target_resource
if it holds a Subnet, None if the field is not set or
holds a different branch.
Sourcepub fn set_subnet<T: Into<String>>(self, v: T) -> Self
pub fn set_subnet<T: Into<String>>(self, v: T) -> Self
Sets the value of target_resource
to hold a Subnet.
Note that all the setters affecting target_resource are
mutually exclusive.
§Example
let x = VpcFlowLogsConfig::new().set_subnet("example");
assert!(x.subnet().is_some());
assert!(x.network().is_none());
assert!(x.interconnect_attachment().is_none());
assert!(x.vpn_tunnel().is_none());Sourcepub fn interconnect_attachment(&self) -> Option<&String>
pub fn interconnect_attachment(&self) -> Option<&String>
The value of target_resource
if it holds a InterconnectAttachment, None if the field is not set or
holds a different branch.
Sourcepub fn set_interconnect_attachment<T: Into<String>>(self, v: T) -> Self
pub fn set_interconnect_attachment<T: Into<String>>(self, v: T) -> Self
Sets the value of target_resource
to hold a InterconnectAttachment.
Note that all the setters affecting target_resource are
mutually exclusive.
§Example
let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
assert!(x.interconnect_attachment().is_some());
assert!(x.network().is_none());
assert!(x.subnet().is_none());
assert!(x.vpn_tunnel().is_none());Sourcepub fn vpn_tunnel(&self) -> Option<&String>
pub fn vpn_tunnel(&self) -> Option<&String>
The value of target_resource
if it holds a VpnTunnel, None if the field is not set or
holds a different branch.
Sourcepub fn set_vpn_tunnel<T: Into<String>>(self, v: T) -> Self
pub fn set_vpn_tunnel<T: Into<String>>(self, v: T) -> Self
Sets the value of target_resource
to hold a VpnTunnel.
Note that all the setters affecting target_resource are
mutually exclusive.
§Example
let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
assert!(x.vpn_tunnel().is_some());
assert!(x.network().is_none());
assert!(x.subnet().is_none());
assert!(x.interconnect_attachment().is_none());Trait Implementations§
Source§impl Clone for VpcFlowLogsConfig
impl Clone for VpcFlowLogsConfig
Source§fn clone(&self) -> VpcFlowLogsConfig
fn clone(&self) -> VpcFlowLogsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more