Skip to main content

VpcFlowLogsConfig

Struct VpcFlowLogsConfig 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Identifier. 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

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = VpcFlowLogsConfig::new().set_name("example");
Source

pub fn set_description<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of description.

§Example
let x = VpcFlowLogsConfig::new().set_description("example");
Source

pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
where T: Into<String>,

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>);
Source

pub fn set_state<T>(self, v: T) -> Self
where T: Into<State>,

Sets the value of state.

§Example
use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
Source

pub fn set_or_clear_state<T>(self, v: Option<T>) -> Self
where T: Into<State>,

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>);
Source

pub fn set_aggregation_interval<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_aggregation_interval<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_flow_sampling<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of flow_sampling.

§Example
let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
Source

pub fn set_or_clear_flow_sampling<T>(self, v: Option<T>) -> Self
where T: Into<f32>,

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>);
Source

pub fn set_metadata<T>(self, v: T) -> Self
where T: Into<Metadata>,

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);
Source

pub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
where T: Into<Metadata>,

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>);
Source

pub fn set_metadata_fields<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of metadata_fields.

§Example
let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
Source

pub fn set_filter_expr<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of filter_expr.

§Example
let x = VpcFlowLogsConfig::new().set_filter_expr("example");
Source

pub fn set_or_clear_filter_expr<T>(self, v: Option<T>) -> Self
where T: Into<String>,

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>);
Source

pub fn set_cross_project_metadata<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_cross_project_metadata<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_target_resource_state<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_target_resource_state<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = VpcFlowLogsConfig::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

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>);
Source

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())));
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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

Source§

fn clone(&self) -> VpcFlowLogsConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VpcFlowLogsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VpcFlowLogsConfig

Source§

fn default() -> VpcFlowLogsConfig

Returns the “default value” for a type. Read more
Source§

impl Message for VpcFlowLogsConfig

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for VpcFlowLogsConfig

Source§

fn eq(&self, other: &VpcFlowLogsConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for VpcFlowLogsConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,