Class RouterNat.Builder (1.41.0)

public static final class RouterNat.Builder extends GeneratedMessageV3.Builder<RouterNat.Builder> implements RouterNatOrBuilder

Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.

Protobuf type google.cloud.compute.v1.RouterNat

Implements

RouterNatOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllDrainNatIps(Iterable<String> values)

public RouterNat.Builder addAllDrainNatIps(Iterable<String> values)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameter
NameDescription
valuesIterable<String>

The drainNatIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addAllEndpointTypes(Iterable<String> values)

public RouterNat.Builder addAllEndpointTypes(Iterable<String> values)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameter
NameDescription
valuesIterable<String>

The endpointTypes to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addAllNatIps(Iterable<String> values)

public RouterNat.Builder addAllNatIps(Iterable<String> values)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameter
NameDescription
valuesIterable<String>

The natIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addAllRules(Iterable<? extends RouterNatRule> values)

public RouterNat.Builder addAllRules(Iterable<? extends RouterNatRule> values)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.compute.v1.RouterNatRule>
Returns
TypeDescription
RouterNat.Builder

addAllSubnetworks(Iterable<? extends RouterNatSubnetworkToNat> values)

public RouterNat.Builder addAllSubnetworks(Iterable<? extends RouterNatSubnetworkToNat> values)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNat>
Returns
TypeDescription
RouterNat.Builder

addDrainNatIps(String value)

public RouterNat.Builder addDrainNatIps(String value)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameter
NameDescription
valueString

The drainNatIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addDrainNatIpsBytes(ByteString value)

public RouterNat.Builder addDrainNatIpsBytes(ByteString value)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameter
NameDescription
valueByteString

The bytes of the drainNatIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addEndpointTypes(String value)

public RouterNat.Builder addEndpointTypes(String value)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameter
NameDescription
valueString

The endpointTypes to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addEndpointTypesBytes(ByteString value)

public RouterNat.Builder addEndpointTypesBytes(ByteString value)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameter
NameDescription
valueByteString

The bytes of the endpointTypes to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addNatIps(String value)

public RouterNat.Builder addNatIps(String value)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameter
NameDescription
valueString

The natIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addNatIpsBytes(ByteString value)

public RouterNat.Builder addNatIpsBytes(ByteString value)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameter
NameDescription
valueByteString

The bytes of the natIps to add.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RouterNat.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RouterNat.Builder
Overrides

addRules(RouterNatRule value)

public RouterNat.Builder addRules(RouterNatRule value)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
valueRouterNatRule
Returns
TypeDescription
RouterNat.Builder

addRules(RouterNatRule.Builder builderForValue)

public RouterNat.Builder addRules(RouterNatRule.Builder builderForValue)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
builderForValueRouterNatRule.Builder
Returns
TypeDescription
RouterNat.Builder

addRules(int index, RouterNatRule value)

public RouterNat.Builder addRules(int index, RouterNatRule value)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameters
NameDescription
indexint
valueRouterNatRule
Returns
TypeDescription
RouterNat.Builder

addRules(int index, RouterNatRule.Builder builderForValue)

public RouterNat.Builder addRules(int index, RouterNatRule.Builder builderForValue)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameters
NameDescription
indexint
builderForValueRouterNatRule.Builder
Returns
TypeDescription
RouterNat.Builder

addRulesBuilder()

public RouterNatRule.Builder addRulesBuilder()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
RouterNatRule.Builder

addRulesBuilder(int index)

public RouterNatRule.Builder addRulesBuilder(int index)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatRule.Builder

addSubnetworks(RouterNatSubnetworkToNat value)

public RouterNat.Builder addSubnetworks(RouterNatSubnetworkToNat value)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
valueRouterNatSubnetworkToNat
Returns
TypeDescription
RouterNat.Builder

addSubnetworks(RouterNatSubnetworkToNat.Builder builderForValue)

public RouterNat.Builder addSubnetworks(RouterNatSubnetworkToNat.Builder builderForValue)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
builderForValueRouterNatSubnetworkToNat.Builder
Returns
TypeDescription
RouterNat.Builder

addSubnetworks(int index, RouterNatSubnetworkToNat value)

public RouterNat.Builder addSubnetworks(int index, RouterNatSubnetworkToNat value)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameters
NameDescription
indexint
valueRouterNatSubnetworkToNat
Returns
TypeDescription
RouterNat.Builder

addSubnetworks(int index, RouterNatSubnetworkToNat.Builder builderForValue)

public RouterNat.Builder addSubnetworks(int index, RouterNatSubnetworkToNat.Builder builderForValue)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameters
NameDescription
indexint
builderForValueRouterNatSubnetworkToNat.Builder
Returns
TypeDescription
RouterNat.Builder

addSubnetworksBuilder()

public RouterNatSubnetworkToNat.Builder addSubnetworksBuilder()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
RouterNatSubnetworkToNat.Builder

addSubnetworksBuilder(int index)

public RouterNatSubnetworkToNat.Builder addSubnetworksBuilder(int index)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatSubnetworkToNat.Builder

build()

public RouterNat build()
Returns
TypeDescription
RouterNat

buildPartial()

public RouterNat buildPartial()
Returns
TypeDescription
RouterNat

clear()

public RouterNat.Builder clear()
Returns
TypeDescription
RouterNat.Builder
Overrides

clearAutoNetworkTier()

public RouterNat.Builder clearAutoNetworkTier()

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearDrainNatIps()

public RouterNat.Builder clearDrainNatIps()

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearEnableDynamicPortAllocation()

public RouterNat.Builder clearEnableDynamicPortAllocation()

Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.

optional bool enable_dynamic_port_allocation = 532106402;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearEnableEndpointIndependentMapping()

public RouterNat.Builder clearEnableEndpointIndependentMapping()

optional bool enable_endpoint_independent_mapping = 259441819;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearEndpointTypes()

public RouterNat.Builder clearEndpointTypes()

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public RouterNat.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
RouterNat.Builder
Overrides

clearIcmpIdleTimeoutSec()

public RouterNat.Builder clearIcmpIdleTimeoutSec()

Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.

optional int32 icmp_idle_timeout_sec = 3647562;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearLogConfig()

public RouterNat.Builder clearLogConfig()

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Returns
TypeDescription
RouterNat.Builder

clearMaxPortsPerVm()

public RouterNat.Builder clearMaxPortsPerVm()

Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.

optional int32 max_ports_per_vm = 250062049;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearMinPortsPerVm()

public RouterNat.Builder clearMinPortsPerVm()

Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.

optional int32 min_ports_per_vm = 186193587;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearName()

public RouterNat.Builder clearName()

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearNatIpAllocateOption()

public RouterNat.Builder clearNatIpAllocateOption()

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearNatIps()

public RouterNat.Builder clearNatIps()

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public RouterNat.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
RouterNat.Builder
Overrides

clearRules()

public RouterNat.Builder clearRules()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
RouterNat.Builder

clearSourceSubnetworkIpRangesToNat()

public RouterNat.Builder clearSourceSubnetworkIpRangesToNat()

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearSubnetworks()

public RouterNat.Builder clearSubnetworks()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
RouterNat.Builder

clearTcpEstablishedIdleTimeoutSec()

public RouterNat.Builder clearTcpEstablishedIdleTimeoutSec()

Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.

optional int32 tcp_established_idle_timeout_sec = 223098349;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearTcpTimeWaitTimeoutSec()

public RouterNat.Builder clearTcpTimeWaitTimeoutSec()

Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.

optional int32 tcp_time_wait_timeout_sec = 513596925;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearTcpTransitoryIdleTimeoutSec()

public RouterNat.Builder clearTcpTransitoryIdleTimeoutSec()

Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.

optional int32 tcp_transitory_idle_timeout_sec = 205028774;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clearUdpIdleTimeoutSec()

public RouterNat.Builder clearUdpIdleTimeoutSec()

Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

optional int32 udp_idle_timeout_sec = 64919878;

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

clone()

public RouterNat.Builder clone()
Returns
TypeDescription
RouterNat.Builder
Overrides

getAutoNetworkTier()

public String getAutoNetworkTier()

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Returns
TypeDescription
String

The autoNetworkTier.

getAutoNetworkTierBytes()

public ByteString getAutoNetworkTierBytes()

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Returns
TypeDescription
ByteString

The bytes for autoNetworkTier.

getDefaultInstanceForType()

public RouterNat getDefaultInstanceForType()
Returns
TypeDescription
RouterNat

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDrainNatIps(int index)

public String getDrainNatIps(int index)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The drainNatIps at the given index.

getDrainNatIpsBytes(int index)

public ByteString getDrainNatIpsBytes(int index)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the drainNatIps at the given index.

getDrainNatIpsCount()

public int getDrainNatIpsCount()

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Returns
TypeDescription
int

The count of drainNatIps.

getDrainNatIpsList()

public ProtocolStringList getDrainNatIpsList()

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Returns
TypeDescription
ProtocolStringList

A list containing the drainNatIps.

getEnableDynamicPortAllocation()

public boolean getEnableDynamicPortAllocation()

Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.

optional bool enable_dynamic_port_allocation = 532106402;

Returns
TypeDescription
boolean

The enableDynamicPortAllocation.

getEnableEndpointIndependentMapping()

public boolean getEnableEndpointIndependentMapping()

optional bool enable_endpoint_independent_mapping = 259441819;

Returns
TypeDescription
boolean

The enableEndpointIndependentMapping.

getEndpointTypes(int index)

public String getEndpointTypes(int index)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The endpointTypes at the given index.

getEndpointTypesBytes(int index)

public ByteString getEndpointTypesBytes(int index)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the endpointTypes at the given index.

getEndpointTypesCount()

public int getEndpointTypesCount()

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Returns
TypeDescription
int

The count of endpointTypes.

getEndpointTypesList()

public ProtocolStringList getEndpointTypesList()

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Returns
TypeDescription
ProtocolStringList

A list containing the endpointTypes.

getIcmpIdleTimeoutSec()

public int getIcmpIdleTimeoutSec()

Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.

optional int32 icmp_idle_timeout_sec = 3647562;

Returns
TypeDescription
int

The icmpIdleTimeoutSec.

getLogConfig()

public RouterNatLogConfig getLogConfig()

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Returns
TypeDescription
RouterNatLogConfig

The logConfig.

getLogConfigBuilder()

public RouterNatLogConfig.Builder getLogConfigBuilder()

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Returns
TypeDescription
RouterNatLogConfig.Builder

getLogConfigOrBuilder()

public RouterNatLogConfigOrBuilder getLogConfigOrBuilder()

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Returns
TypeDescription
RouterNatLogConfigOrBuilder

getMaxPortsPerVm()

public int getMaxPortsPerVm()

Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.

optional int32 max_ports_per_vm = 250062049;

Returns
TypeDescription
int

The maxPortsPerVm.

getMinPortsPerVm()

public int getMinPortsPerVm()

Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.

optional int32 min_ports_per_vm = 186193587;

Returns
TypeDescription
int

The minPortsPerVm.

getName()

public String getName()

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Returns
TypeDescription
ByteString

The bytes for name.

getNatIpAllocateOption()

public String getNatIpAllocateOption()

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Returns
TypeDescription
String

The natIpAllocateOption.

getNatIpAllocateOptionBytes()

public ByteString getNatIpAllocateOptionBytes()

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Returns
TypeDescription
ByteString

The bytes for natIpAllocateOption.

getNatIps(int index)

public String getNatIps(int index)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The natIps at the given index.

getNatIpsBytes(int index)

public ByteString getNatIpsBytes(int index)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the natIps at the given index.

getNatIpsCount()

public int getNatIpsCount()

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Returns
TypeDescription
int

The count of natIps.

getNatIpsList()

public ProtocolStringList getNatIpsList()

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Returns
TypeDescription
ProtocolStringList

A list containing the natIps.

getRules(int index)

public RouterNatRule getRules(int index)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatRule

getRulesBuilder(int index)

public RouterNatRule.Builder getRulesBuilder(int index)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatRule.Builder

getRulesBuilderList()

public List<RouterNatRule.Builder> getRulesBuilderList()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
List<Builder>

getRulesCount()

public int getRulesCount()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
int

getRulesList()

public List<RouterNatRule> getRulesList()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
List<RouterNatRule>

getRulesOrBuilder(int index)

public RouterNatRuleOrBuilder getRulesOrBuilder(int index)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatRuleOrBuilder

getRulesOrBuilderList()

public List<? extends RouterNatRuleOrBuilder> getRulesOrBuilderList()

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Returns
TypeDescription
List<? extends com.google.cloud.compute.v1.RouterNatRuleOrBuilder>

getSourceSubnetworkIpRangesToNat()

public String getSourceSubnetworkIpRangesToNat()

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Returns
TypeDescription
String

The sourceSubnetworkIpRangesToNat.

getSourceSubnetworkIpRangesToNatBytes()

public ByteString getSourceSubnetworkIpRangesToNatBytes()

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Returns
TypeDescription
ByteString

The bytes for sourceSubnetworkIpRangesToNat.

getSubnetworks(int index)

public RouterNatSubnetworkToNat getSubnetworks(int index)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatSubnetworkToNat

getSubnetworksBuilder(int index)

public RouterNatSubnetworkToNat.Builder getSubnetworksBuilder(int index)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatSubnetworkToNat.Builder

getSubnetworksBuilderList()

public List<RouterNatSubnetworkToNat.Builder> getSubnetworksBuilderList()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
List<Builder>

getSubnetworksCount()

public int getSubnetworksCount()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
int

getSubnetworksList()

public List<RouterNatSubnetworkToNat> getSubnetworksList()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
List<RouterNatSubnetworkToNat>

getSubnetworksOrBuilder(int index)

public RouterNatSubnetworkToNatOrBuilder getSubnetworksOrBuilder(int index)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNatSubnetworkToNatOrBuilder

getSubnetworksOrBuilderList()

public List<? extends RouterNatSubnetworkToNatOrBuilder> getSubnetworksOrBuilderList()

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Returns
TypeDescription
List<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNatOrBuilder>

getTcpEstablishedIdleTimeoutSec()

public int getTcpEstablishedIdleTimeoutSec()

Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.

optional int32 tcp_established_idle_timeout_sec = 223098349;

Returns
TypeDescription
int

The tcpEstablishedIdleTimeoutSec.

getTcpTimeWaitTimeoutSec()

public int getTcpTimeWaitTimeoutSec()

Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.

optional int32 tcp_time_wait_timeout_sec = 513596925;

Returns
TypeDescription
int

The tcpTimeWaitTimeoutSec.

getTcpTransitoryIdleTimeoutSec()

public int getTcpTransitoryIdleTimeoutSec()

Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.

optional int32 tcp_transitory_idle_timeout_sec = 205028774;

Returns
TypeDescription
int

The tcpTransitoryIdleTimeoutSec.

getUdpIdleTimeoutSec()

public int getUdpIdleTimeoutSec()

Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

optional int32 udp_idle_timeout_sec = 64919878;

Returns
TypeDescription
int

The udpIdleTimeoutSec.

hasAutoNetworkTier()

public boolean hasAutoNetworkTier()

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Returns
TypeDescription
boolean

Whether the autoNetworkTier field is set.

hasEnableDynamicPortAllocation()

public boolean hasEnableDynamicPortAllocation()

Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.

optional bool enable_dynamic_port_allocation = 532106402;

Returns
TypeDescription
boolean

Whether the enableDynamicPortAllocation field is set.

hasEnableEndpointIndependentMapping()

public boolean hasEnableEndpointIndependentMapping()

optional bool enable_endpoint_independent_mapping = 259441819;

Returns
TypeDescription
boolean

Whether the enableEndpointIndependentMapping field is set.

hasIcmpIdleTimeoutSec()

public boolean hasIcmpIdleTimeoutSec()

Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.

optional int32 icmp_idle_timeout_sec = 3647562;

Returns
TypeDescription
boolean

Whether the icmpIdleTimeoutSec field is set.

hasLogConfig()

public boolean hasLogConfig()

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Returns
TypeDescription
boolean

Whether the logConfig field is set.

hasMaxPortsPerVm()

public boolean hasMaxPortsPerVm()

Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.

optional int32 max_ports_per_vm = 250062049;

Returns
TypeDescription
boolean

Whether the maxPortsPerVm field is set.

hasMinPortsPerVm()

public boolean hasMinPortsPerVm()

Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.

optional int32 min_ports_per_vm = 186193587;

Returns
TypeDescription
boolean

Whether the minPortsPerVm field is set.

hasName()

public boolean hasName()

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Returns
TypeDescription
boolean

Whether the name field is set.

hasNatIpAllocateOption()

public boolean hasNatIpAllocateOption()

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Returns
TypeDescription
boolean

Whether the natIpAllocateOption field is set.

hasSourceSubnetworkIpRangesToNat()

public boolean hasSourceSubnetworkIpRangesToNat()

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Returns
TypeDescription
boolean

Whether the sourceSubnetworkIpRangesToNat field is set.

hasTcpEstablishedIdleTimeoutSec()

public boolean hasTcpEstablishedIdleTimeoutSec()

Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.

optional int32 tcp_established_idle_timeout_sec = 223098349;

Returns
TypeDescription
boolean

Whether the tcpEstablishedIdleTimeoutSec field is set.

hasTcpTimeWaitTimeoutSec()

public boolean hasTcpTimeWaitTimeoutSec()

Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.

optional int32 tcp_time_wait_timeout_sec = 513596925;

Returns
TypeDescription
boolean

Whether the tcpTimeWaitTimeoutSec field is set.

hasTcpTransitoryIdleTimeoutSec()

public boolean hasTcpTransitoryIdleTimeoutSec()

Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.

optional int32 tcp_transitory_idle_timeout_sec = 205028774;

Returns
TypeDescription
boolean

Whether the tcpTransitoryIdleTimeoutSec field is set.

hasUdpIdleTimeoutSec()

public boolean hasUdpIdleTimeoutSec()

Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

optional int32 udp_idle_timeout_sec = 64919878;

Returns
TypeDescription
boolean

Whether the udpIdleTimeoutSec field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(RouterNat other)

public RouterNat.Builder mergeFrom(RouterNat other)
Parameter
NameDescription
otherRouterNat
Returns
TypeDescription
RouterNat.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RouterNat.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
RouterNat.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public RouterNat.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
RouterNat.Builder
Overrides

mergeLogConfig(RouterNatLogConfig value)

public RouterNat.Builder mergeLogConfig(RouterNatLogConfig value)

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Parameter
NameDescription
valueRouterNatLogConfig
Returns
TypeDescription
RouterNat.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final RouterNat.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RouterNat.Builder
Overrides

removeRules(int index)

public RouterNat.Builder removeRules(int index)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNat.Builder

removeSubnetworks(int index)

public RouterNat.Builder removeSubnetworks(int index)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameter
NameDescription
indexint
Returns
TypeDescription
RouterNat.Builder

setAutoNetworkTier(String value)

public RouterNat.Builder setAutoNetworkTier(String value)

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Parameter
NameDescription
valueString

The autoNetworkTier to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setAutoNetworkTierBytes(ByteString value)

public RouterNat.Builder setAutoNetworkTierBytes(ByteString value)

The network tier to use when automatically reserving IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, PREMIUM tier will be used. Check the AutoNetworkTier enum for the list of possible values.

optional string auto_network_tier = 269770211;

Parameter
NameDescription
valueByteString

The bytes for autoNetworkTier to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setDrainNatIps(int index, String value)

public RouterNat.Builder setDrainNatIps(int index, String value)

A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.

repeated string drain_nat_ips = 504078535;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The drainNatIps to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setEnableDynamicPortAllocation(boolean value)

public RouterNat.Builder setEnableDynamicPortAllocation(boolean value)

Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config.

optional bool enable_dynamic_port_allocation = 532106402;

Parameter
NameDescription
valueboolean

The enableDynamicPortAllocation to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setEnableEndpointIndependentMapping(boolean value)

public RouterNat.Builder setEnableEndpointIndependentMapping(boolean value)

optional bool enable_endpoint_independent_mapping = 259441819;

Parameter
NameDescription
valueboolean

The enableEndpointIndependentMapping to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setEndpointTypes(int index, String value)

public RouterNat.Builder setEndpointTypes(int index, String value)

List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list of possible values.

repeated string endpoint_types = 502633807;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The endpointTypes to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public RouterNat.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RouterNat.Builder
Overrides

setIcmpIdleTimeoutSec(int value)

public RouterNat.Builder setIcmpIdleTimeoutSec(int value)

Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.

optional int32 icmp_idle_timeout_sec = 3647562;

Parameter
NameDescription
valueint

The icmpIdleTimeoutSec to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setLogConfig(RouterNatLogConfig value)

public RouterNat.Builder setLogConfig(RouterNatLogConfig value)

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Parameter
NameDescription
valueRouterNatLogConfig
Returns
TypeDescription
RouterNat.Builder

setLogConfig(RouterNatLogConfig.Builder builderForValue)

public RouterNat.Builder setLogConfig(RouterNatLogConfig.Builder builderForValue)

Configure logging on this NAT.

optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;

Parameter
NameDescription
builderForValueRouterNatLogConfig.Builder
Returns
TypeDescription
RouterNat.Builder

setMaxPortsPerVm(int value)

public RouterNat.Builder setMaxPortsPerVm(int value)

Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.

optional int32 max_ports_per_vm = 250062049;

Parameter
NameDescription
valueint

The maxPortsPerVm to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setMinPortsPerVm(int value)

public RouterNat.Builder setMinPortsPerVm(int value)

Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.

optional int32 min_ports_per_vm = 186193587;

Parameter
NameDescription
valueint

The minPortsPerVm to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setName(String value)

public RouterNat.Builder setName(String value)

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setNameBytes(ByteString value)

public RouterNat.Builder setNameBytes(ByteString value)

Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.

optional string name = 3373707;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setNatIpAllocateOption(String value)

public RouterNat.Builder setNatIpAllocateOption(String value)

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Parameter
NameDescription
valueString

The natIpAllocateOption to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setNatIpAllocateOptionBytes(ByteString value)

public RouterNat.Builder setNatIpAllocateOptionBytes(ByteString value)

Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. Check the NatIpAllocateOption enum for the list of possible values.

optional string nat_ip_allocate_option = 429726845;

Parameter
NameDescription
valueByteString

The bytes for natIpAllocateOption to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setNatIps(int index, String value)

public RouterNat.Builder setNatIps(int index, String value)

A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.

repeated string nat_ips = 117635086;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The natIps to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public RouterNat.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
RouterNat.Builder
Overrides

setRules(int index, RouterNatRule value)

public RouterNat.Builder setRules(int index, RouterNatRule value)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameters
NameDescription
indexint
valueRouterNatRule
Returns
TypeDescription
RouterNat.Builder

setRules(int index, RouterNatRule.Builder builderForValue)

public RouterNat.Builder setRules(int index, RouterNatRule.Builder builderForValue)

A list of rules associated with this NAT.

repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;

Parameters
NameDescription
indexint
builderForValueRouterNatRule.Builder
Returns
TypeDescription
RouterNat.Builder

setSourceSubnetworkIpRangesToNat(String value)

public RouterNat.Builder setSourceSubnetworkIpRangesToNat(String value)

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Parameter
NameDescription
valueString

The sourceSubnetworkIpRangesToNat to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setSourceSubnetworkIpRangesToNatBytes(ByteString value)

public RouterNat.Builder setSourceSubnetworkIpRangesToNatBytes(ByteString value)

Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. Check the SourceSubnetworkIpRangesToNat enum for the list of possible values.

optional string source_subnetwork_ip_ranges_to_nat = 252213211;

Parameter
NameDescription
valueByteString

The bytes for sourceSubnetworkIpRangesToNat to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setSubnetworks(int index, RouterNatSubnetworkToNat value)

public RouterNat.Builder setSubnetworks(int index, RouterNatSubnetworkToNat value)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameters
NameDescription
indexint
valueRouterNatSubnetworkToNat
Returns
TypeDescription
RouterNat.Builder

setSubnetworks(int index, RouterNatSubnetworkToNat.Builder builderForValue)

public RouterNat.Builder setSubnetworks(int index, RouterNatSubnetworkToNat.Builder builderForValue)

A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125;

Parameters
NameDescription
indexint
builderForValueRouterNatSubnetworkToNat.Builder
Returns
TypeDescription
RouterNat.Builder

setTcpEstablishedIdleTimeoutSec(int value)

public RouterNat.Builder setTcpEstablishedIdleTimeoutSec(int value)

Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.

optional int32 tcp_established_idle_timeout_sec = 223098349;

Parameter
NameDescription
valueint

The tcpEstablishedIdleTimeoutSec to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setTcpTimeWaitTimeoutSec(int value)

public RouterNat.Builder setTcpTimeWaitTimeoutSec(int value)

Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.

optional int32 tcp_time_wait_timeout_sec = 513596925;

Parameter
NameDescription
valueint

The tcpTimeWaitTimeoutSec to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setTcpTransitoryIdleTimeoutSec(int value)

public RouterNat.Builder setTcpTransitoryIdleTimeoutSec(int value)

Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.

optional int32 tcp_transitory_idle_timeout_sec = 205028774;

Parameter
NameDescription
valueint

The tcpTransitoryIdleTimeoutSec to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setUdpIdleTimeoutSec(int value)

public RouterNat.Builder setUdpIdleTimeoutSec(int value)

Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

optional int32 udp_idle_timeout_sec = 64919878;

Parameter
NameDescription
valueint

The udpIdleTimeoutSec to set.

Returns
TypeDescription
RouterNat.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final RouterNat.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RouterNat.Builder
Overrides