# Network Connectivity V1 API - Class Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute (v1.14.0)

1.14.0 (latest) 1.13.0 1.12.0 1.11.0 1.10.1 1.9.0 1.8.0 1.7.0 1.6.0 1.5.1 1.4.0 1.3.0 1.2.0 1.1.0 1.0.1 0.10.0 0.9.2 0.8.0 0.7.0 0.6.1 0.5.0 0.4.1 0.3.0 0.2.0 0.1.4 Reference documentation and code samples for the Network Connectivity V1 API class Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute.

Policy-based routes route L4 network traffic based on not just destination IP
address, but also source IP address, protocol, and more. If a policy-based
route conflicts with other types of routes, the policy-based route always
takes precedence.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #create_time

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

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Protobuf-Timestamp)) --- Output only. Time when the policy-based route was created.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Optional. An optional description of this resource. Provide this field when you create the resource.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. An optional description of this resource. Provide this field when you create the resource.
**Returns**

- (::String) --- Optional. An optional description of this resource. Provide this field when you create the resource.

### #filter

    def filter() -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter

**Returns**

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-Filter)) --- Required. The filter to match L4 traffic.

### #filter=

    def filter=(value) -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter

**Parameter**

- **value** ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-Filter)) --- Required. The filter to match L4 traffic.
**Returns**

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-Filter)) --- Required. The filter to match L4 traffic.

### #interconnect_attachment

    def interconnect_attachment() -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment

**Returns**

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-InterconnectAttachment)) --- Optional. The interconnect attachments that this policy-based route applies to.


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

### #interconnect_attachment=

    def interconnect_attachment=(value) -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment

**Parameter**

- **value** ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-InterconnectAttachment)) --- Optional. The interconnect attachments that this policy-based route applies to.


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

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-InterconnectAttachment)) --- Optional. The interconnect attachments that this policy-based route applies to.


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

### #kind

    def kind() -> ::String

**Returns**

- (::String) --- Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based Route resources.

### #labels

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

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- User-defined labels.

### #labels=

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

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- User-defined labels.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- User-defined labels.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Immutable. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
**Returns**

- (::String) --- Immutable. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`

### #network

    def network() -> ::String

**Returns**

- (::String) --- Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.

### #network=

    def network=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
**Returns**

- (::String) --- Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.

### #next_hop_ilb_ip

    def next_hop_ilb_ip() -> ::String

**Returns**

- (::String) --- Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported.

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

### #next_hop_ilb_ip=

    def next_hop_ilb_ip=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported.


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

- (::String) --- Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported.

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

### #next_hop_other_routes

    def next_hop_other_routes() -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes

**Returns**

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-OtherRoutes)) --- Optional. Other routes that will be referenced to determine the next hop of the packet.


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

### #next_hop_other_routes=

    def next_hop_other_routes=(value) -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes

**Parameter**

- **value** ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-OtherRoutes)) --- Optional. Other routes that will be referenced to determine the next hop of the packet.


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

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-OtherRoutes)) --- Optional. Other routes that will be referenced to determine the next hop of the packet.


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

### #priority

    def priority() -> ::Integer

**Returns**

- (::Integer) --- Optional. The priority of this policy-based route. Priority is used to
  break ties in cases where there are more than one matching policy-based
  routes found. In cases where multiple policy-based routes are matched, the
  one with the lowest-numbered priority value wins. The default value is

  1. The priority value must be from 1 to 65535, inclusive.

### #priority=

    def priority=(value) -> ::Integer

**Parameter**

- **value** (::Integer) ---

  Optional. The priority of this policy-based route. Priority is used to
  break ties in cases where there are more than one matching policy-based
  routes found. In cases where multiple policy-based routes are matched, the
  one with the lowest-numbered priority value wins. The default value is
  1. The priority value must be from 1 to 65535, inclusive.
**Returns**

- (::Integer) --- Optional. The priority of this policy-based route. Priority is used to
  break ties in cases where there are more than one matching policy-based
  routes found. In cases where multiple policy-based routes are matched, the
  one with the lowest-numbered priority value wins. The default value is

  1. The priority value must be from 1 to 65535, inclusive.

### #self_link

    def self_link() -> ::String

**Returns**

- (::String) --- Output only. Server-defined fully-qualified URL for this resource.

### #update_time

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

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Protobuf-Timestamp)) --- Output only. Time when the policy-based route was updated.

### #virtual_machine

    def virtual_machine() -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine

**Returns**

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-VirtualMachine)) --- Optional. VM instances that this policy-based route applies to.


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

### #virtual_machine=

    def virtual_machine=(value) -> ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine

**Parameter**

- **value** ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-VirtualMachine)) --- Optional. VM instances that this policy-based route applies to.


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

- ([::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-VirtualMachine)) --- Optional. VM instances that this policy-based route applies to.


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

### #warnings

    def warnings() -> ::Array<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings>

**Returns**

- (::Array\<[::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_connectivity-v1/latest/Google-Cloud-NetworkConnectivity-V1-PolicyBasedRoute-Warnings)\>) --- Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.