# Network Management V1 API - Class Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig (v2.11.0)

2.11.0 (latest) 2.10.1 2.9.0 2.8.0 2.7.0 2.6.0 2.5.1 2.4.0 2.3.0 2.2.0 2.1.1 2.0.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.14.0 0.13.0 0.12.0 0.11.0 0.10.2 0.9.0 0.8.0 0.7.0 0.6.1 0.5.1 0.4.0 0.3.0 0.2.0 0.1.3 Reference documentation and code samples for the Network Management V1 API class Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig.

A configuration to generate VPC Flow Logs.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #aggregation_interval

    def aggregation_interval() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::AggregationInterval

**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::AggregationInterval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-AggregationInterval)) --- Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.

### #aggregation_interval=

    def aggregation_interval=(value) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::AggregationInterval

**Parameter**

- **value** ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::AggregationInterval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-AggregationInterval)) --- Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::AggregationInterval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-AggregationInterval)) --- Optional. The aggregation interval for the logs. Default value is INTERVAL_5_SEC.

### #create_time

    def create_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time the config was created.

### #cross_project_metadata

    def cross_project_metadata() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::CrossProjectMetadata

**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::CrossProjectMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.

### #cross_project_metadata=

    def cross_project_metadata=(value) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::CrossProjectMetadata

**Parameter**

- **value** ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::CrossProjectMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.
**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::CrossProjectMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.
**Returns**

- (::String) --- Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum of 512 characters.

### #filter_expr

    def filter_expr() -> ::String

**Returns**

- (::String) --- Optional. Export filter used to define which VPC Flow Logs should be logged.

### #filter_expr=

    def filter_expr=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. Export filter used to define which VPC Flow Logs should be logged.
**Returns**

- (::String) --- Optional. Export filter used to define which VPC Flow Logs should be logged.

### #flow_sampling

    def flow_sampling() -> ::Float

**Returns**

- (::Float) --- 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.

### #flow_sampling=

    def flow_sampling=(value) -> ::Float

**Parameter**

- **value** (::Float) --- 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.
**Returns**

- (::Float) --- 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.

### #interconnect_attachment

    def interconnect_attachment() -> ::String

**Returns**

- (::String) --- Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}

  Note: The following fields are mutually exclusive: `interconnect_attachment`, `network`, `subnet`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #interconnect_attachment=

    def interconnect_attachment=(value) -> ::String

**Parameter**

- **value** (::String) --- Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}


  Note: The following fields are mutually exclusive: `interconnect_attachment`, `network`, `subnet`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}

  Note: The following fields are mutually exclusive: `interconnect_attachment`, `network`, `subnet`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #labels

    def labels() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Resource labels to represent user-provided metadata.

### #labels=

    def labels=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Resource labels to represent user-provided metadata.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Resource labels to represent user-provided metadata.

### #metadata

    def metadata() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::Metadata

**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::Metadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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=

    def metadata=(value) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::Metadata

**Parameter**

- **value** ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::Metadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.
**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::Metadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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

    def metadata_fields() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.

### #metadata_fields=

    def metadata_fields=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.
**Returns**

- (::Array\<::String\>) --- Optional. Custom metadata fields to include in the reported VPC flow logs. Can only be specified if "metadata" was set to CUSTOM_METADATA.

### #name

    def name() -> ::String

**Returns**

- (::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}`

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::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}`

**Returns**

- (::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}`

### #network

    def network() -> ::String

**Returns**

- (::String) --- Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}

  Note: The following fields are mutually exclusive: `network`, `subnet`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #network=

    def network=(value) -> ::String

**Parameter**

- **value** (::String) --- Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}


  Note: The following fields are mutually exclusive: `network`, `subnet`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}

  Note: The following fields are mutually exclusive: `network`, `subnet`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #state

    def state() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::State

**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::State](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.

### #state=

    def state=(value) -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::State

**Parameter**

- **value** ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::State](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.
**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::State](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-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.

### #subnet

    def subnet() -> ::String

**Returns**

- (::String) --- Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}

  Note: The following fields are mutually exclusive: `subnet`, `network`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #subnet=

    def subnet=(value) -> ::String

**Parameter**

- **value** (::String) --- Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}


  Note: The following fields are mutually exclusive: `subnet`, `network`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}

  Note: The following fields are mutually exclusive: `subnet`, `network`, `interconnect_attachment`, `vpn_tunnel`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_resource_state

    def target_resource_state() -> ::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::TargetResourceState

**Returns**

- ([::Google::Cloud::NetworkManagement::V1::VpcFlowLogsConfig::TargetResourceState](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Cloud-NetworkManagement-V1-VpcFlowLogsConfig-TargetResourceState)) --- Output only. Describes the state of the configured target resource for diagnostic purposes.

### #update_time

    def update_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_management-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time the config was updated.

### #vpn_tunnel

    def vpn_tunnel() -> ::String

**Returns**

- (::String) --- Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}

  Note: The following fields are mutually exclusive: `vpn_tunnel`, `network`, `subnet`, `interconnect_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #vpn_tunnel=

    def vpn_tunnel=(value) -> ::String

**Parameter**

- **value** (::String) --- Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}


  Note: The following fields are mutually exclusive: `vpn_tunnel`, `network`, `subnet`, `interconnect_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}

  Note: The following fields are mutually exclusive: `vpn_tunnel`, `network`, `subnet`, `interconnect_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared.