Class PolicyBasedRoute (1.27.0)

public final class PolicyBasedRoute extends GeneratedMessageV3 implements PolicyBasedRouteOrBuilder

Policy Based Routes (PBR) are more powerful routes that allows GCP customers to route their L4 network traffic based on not just destination IP, but also source IP, protocol and more. A PBR always take precedence when it conflicts with other types of routes. Next id: 22

Protobuf type google.cloud.networkconnectivity.v1.PolicyBasedRoute

Static Fields

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

FILTER_FIELD_NUMBER

public static final int FILTER_FIELD_NUMBER
Field Value
TypeDescription
int

INTERCONNECT_ATTACHMENT_FIELD_NUMBER

public static final int INTERCONNECT_ATTACHMENT_FIELD_NUMBER
Field Value
TypeDescription
int

KIND_FIELD_NUMBER

public static final int KIND_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

NETWORK_FIELD_NUMBER

public static final int NETWORK_FIELD_NUMBER
Field Value
TypeDescription
int

NEXT_HOP_ILB_IP_FIELD_NUMBER

public static final int NEXT_HOP_ILB_IP_FIELD_NUMBER
Field Value
TypeDescription
int

NEXT_HOP_OTHER_ROUTES_FIELD_NUMBER

public static final int NEXT_HOP_OTHER_ROUTES_FIELD_NUMBER
Field Value
TypeDescription
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
TypeDescription
int
public static final int SELF_LINK_FIELD_NUMBER
Field Value
TypeDescription
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

VIRTUAL_MACHINE_FIELD_NUMBER

public static final int VIRTUAL_MACHINE_FIELD_NUMBER
Field Value
TypeDescription
int

WARNINGS_FIELD_NUMBER

public static final int WARNINGS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static PolicyBasedRoute getDefaultInstance()
Returns
TypeDescription
PolicyBasedRoute

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static PolicyBasedRoute.Builder newBuilder()
Returns
TypeDescription
PolicyBasedRoute.Builder

newBuilder(PolicyBasedRoute prototype)

public static PolicyBasedRoute.Builder newBuilder(PolicyBasedRoute prototype)
Parameter
NameDescription
prototypePolicyBasedRoute
Returns
TypeDescription
PolicyBasedRoute.Builder

parseDelimitedFrom(InputStream input)

public static PolicyBasedRoute parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static PolicyBasedRoute parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PolicyBasedRoute parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PolicyBasedRoute parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static PolicyBasedRoute parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static PolicyBasedRoute parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PolicyBasedRoute parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PolicyBasedRoute
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<PolicyBasedRoute> parser()
Returns
TypeDescription
Parser<PolicyBasedRoute>

Methods

containsLabels(String key)

public boolean containsLabels(String key)

User-defined labels.

map<string, string> labels = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCreateTime()

public Timestamp getCreateTime()

Output only. Time when the PolicyBasedRoute was created.

.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time when the PolicyBasedRoute was created.

.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public PolicyBasedRoute getDefaultInstanceForType()
Returns
TypeDescription
PolicyBasedRoute

getDescription()

public String getDescription()

Optional. An optional description of this resource. Provide this field when you create the resource.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. An optional description of this resource. Provide this field when you create the resource.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for description.

getFilter()

public PolicyBasedRoute.Filter getFilter()

Required. The filter to match L4 traffic.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
PolicyBasedRoute.Filter

The filter.

getFilterOrBuilder()

public PolicyBasedRoute.FilterOrBuilder getFilterOrBuilder()

Required. The filter to match L4 traffic.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
PolicyBasedRoute.FilterOrBuilder

getInterconnectAttachment()

public PolicyBasedRoute.InterconnectAttachment getInterconnectAttachment()

Optional. The interconnect attachments to which this route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PolicyBasedRoute.InterconnectAttachment

The interconnectAttachment.

getInterconnectAttachmentOrBuilder()

public PolicyBasedRoute.InterconnectAttachmentOrBuilder getInterconnectAttachmentOrBuilder()

Optional. The interconnect attachments to which this route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PolicyBasedRoute.InterconnectAttachmentOrBuilder

getKind()

public String getKind()

Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for Policy Based Route resources.

string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The kind.

getKindBytes()

public ByteString getKindBytes()

Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for Policy Based Route resources.

string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for kind.

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

User-defined labels.

map<string, string> labels = 4;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

User-defined labels.

map<string, string> labels = 4;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

User-defined labels.

map<string, string> labels = 4;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

User-defined labels.

map<string, string> labels = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getName()

public String getName()

Immutable. A unique name of the resource in the form of projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. A unique name of the resource in the form of projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for name.

getNetwork()

public String getNetwork()

Required. Fully-qualified URL of the network that this route applies to. e.g. projects/my-project/global/networks/my-network.

string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The network.

getNetworkBytes()

public ByteString getNetworkBytes()

Required. Fully-qualified URL of the network that this route applies to. e.g. projects/my-project/global/networks/my-network.

string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for network.

getNextHopCase()

public PolicyBasedRoute.NextHopCase getNextHopCase()
Returns
TypeDescription
PolicyBasedRoute.NextHopCase

getNextHopIlbIp()

public String getNextHopIlbIp()

Optional. The IP of a global access enabled L4 ILB that should be the next hop to handle matching packets. For this version, only next_hop_ilb_ip is supported.

string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The nextHopIlbIp.

getNextHopIlbIpBytes()

public ByteString getNextHopIlbIpBytes()

Optional. The IP of a global access enabled L4 ILB that should be the next hop to handle matching packets. For this version, only next_hop_ilb_ip is supported.

string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for nextHopIlbIp.

getNextHopOtherRoutes()

public PolicyBasedRoute.OtherRoutes getNextHopOtherRoutes()

Optional. Other routes that will be referenced to determine the next hop of the packet.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes next_hop_other_routes = 21 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PolicyBasedRoute.OtherRoutes

The nextHopOtherRoutes.

getNextHopOtherRoutesValue()

public int getNextHopOtherRoutesValue()

Optional. Other routes that will be referenced to determine the next hop of the packet.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes next_hop_other_routes = 21 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The enum numeric value on the wire for nextHopOtherRoutes.

getParserForType()

public Parser<PolicyBasedRoute> getParserForType()
Returns
TypeDescription
Parser<PolicyBasedRoute>
Overrides

getPriority()

public int getPriority()

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.

int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The priority.

public String getSelfLink()

Output only. Server-defined fully-qualified URL for this resource.

string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The selfLink.

getSelfLinkBytes()

public ByteString getSelfLinkBytes()

Output only. Server-defined fully-qualified URL for this resource.

string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for selfLink.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getTargetCase()

public PolicyBasedRoute.TargetCase getTargetCase()
Returns
TypeDescription
PolicyBasedRoute.TargetCase

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Time when the PolicyBasedRoute was updated.

.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Time when the PolicyBasedRoute was updated.

.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getVirtualMachine()

public PolicyBasedRoute.VirtualMachine getVirtualMachine()

Optional. VM instances to which this policy based route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PolicyBasedRoute.VirtualMachine

The virtualMachine.

getVirtualMachineOrBuilder()

public PolicyBasedRoute.VirtualMachineOrBuilder getVirtualMachineOrBuilder()

Optional. VM instances to which this policy based route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PolicyBasedRoute.VirtualMachineOrBuilder

getWarnings(int index)

public PolicyBasedRoute.Warnings getWarnings(int index)

Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
PolicyBasedRoute.Warnings

getWarningsCount()

public int getWarningsCount()

Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

getWarningsList()

public List<PolicyBasedRoute.Warnings> getWarningsList()

Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
List<Warnings>

getWarningsOrBuilder(int index)

public PolicyBasedRoute.WarningsOrBuilder getWarningsOrBuilder(int index)

Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
PolicyBasedRoute.WarningsOrBuilder

getWarningsOrBuilderList()

public List<? extends PolicyBasedRoute.WarningsOrBuilder> getWarningsOrBuilderList()

Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
List<? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder>

hasCreateTime()

public boolean hasCreateTime()

Output only. Time when the PolicyBasedRoute was created.

.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the createTime field is set.

hasFilter()

public boolean hasFilter()

Required. The filter to match L4 traffic.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the filter field is set.

hasInterconnectAttachment()

public boolean hasInterconnectAttachment()

Optional. The interconnect attachments to which this route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the interconnectAttachment field is set.

hasNextHopIlbIp()

public boolean hasNextHopIlbIp()

Optional. The IP of a global access enabled L4 ILB that should be the next hop to handle matching packets. For this version, only next_hop_ilb_ip is supported.

string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the nextHopIlbIp field is set.

hasNextHopOtherRoutes()

public boolean hasNextHopOtherRoutes()

Optional. Other routes that will be referenced to determine the next hop of the packet.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes next_hop_other_routes = 21 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the nextHopOtherRoutes field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Time when the PolicyBasedRoute was updated.

.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the updateTime field is set.

hasVirtualMachine()

public boolean hasVirtualMachine()

Optional. VM instances to which this policy based route applies to.

.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the virtualMachine field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public PolicyBasedRoute.Builder newBuilderForType()
Returns
TypeDescription
PolicyBasedRoute.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PolicyBasedRoute.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
PolicyBasedRoute.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public PolicyBasedRoute.Builder toBuilder()
Returns
TypeDescription
PolicyBasedRoute.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException