public final class RouterNat extends GeneratedMessageV3 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
Static Fields
DRAIN_NAT_IPS_FIELD_NUMBER
public static final int DRAIN_NAT_IPS_FIELD_NUMBER
Field Value
ENABLE_ENDPOINT_INDEPENDENT_MAPPING_FIELD_NUMBER
public static final int ENABLE_ENDPOINT_INDEPENDENT_MAPPING_FIELD_NUMBER
Field Value
ICMP_IDLE_TIMEOUT_SEC_FIELD_NUMBER
public static final int ICMP_IDLE_TIMEOUT_SEC_FIELD_NUMBER
Field Value
LOG_CONFIG_FIELD_NUMBER
public static final int LOG_CONFIG_FIELD_NUMBER
Field Value
MIN_PORTS_PER_VM_FIELD_NUMBER
public static final int MIN_PORTS_PER_VM_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
NAT_IPS_FIELD_NUMBER
public static final int NAT_IPS_FIELD_NUMBER
Field Value
NAT_IP_ALLOCATE_OPTION_FIELD_NUMBER
public static final int NAT_IP_ALLOCATE_OPTION_FIELD_NUMBER
Field Value
RULES_FIELD_NUMBER
public static final int RULES_FIELD_NUMBER
Field Value
SOURCE_SUBNETWORK_IP_RANGES_TO_NAT_FIELD_NUMBER
public static final int SOURCE_SUBNETWORK_IP_RANGES_TO_NAT_FIELD_NUMBER
Field Value
SUBNETWORKS_FIELD_NUMBER
public static final int SUBNETWORKS_FIELD_NUMBER
Field Value
TCP_ESTABLISHED_IDLE_TIMEOUT_SEC_FIELD_NUMBER
public static final int TCP_ESTABLISHED_IDLE_TIMEOUT_SEC_FIELD_NUMBER
Field Value
TCP_TIME_WAIT_TIMEOUT_SEC_FIELD_NUMBER
public static final int TCP_TIME_WAIT_TIMEOUT_SEC_FIELD_NUMBER
Field Value
TCP_TRANSITORY_IDLE_TIMEOUT_SEC_FIELD_NUMBER
public static final int TCP_TRANSITORY_IDLE_TIMEOUT_SEC_FIELD_NUMBER
Field Value
UDP_IDLE_TIMEOUT_SEC_FIELD_NUMBER
public static final int UDP_IDLE_TIMEOUT_SEC_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static RouterNat getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static RouterNat.Builder newBuilder()
Returns
newBuilder(RouterNat prototype)
public static RouterNat.Builder newBuilder(RouterNat prototype)
Parameter
Returns
public static RouterNat parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static RouterNat parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static RouterNat parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static RouterNat parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static RouterNat parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static RouterNat parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static RouterNat parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static RouterNat parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static RouterNat parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static RouterNat parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static RouterNat parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static RouterNat parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<RouterNat> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public RouterNat getDefaultInstanceForType()
Returns
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
Name | Description |
index | int
The index of the element to return.
|
Returns
Type | Description |
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
Name | Description |
index | int
The index of the value to return.
|
Returns
Type | Description |
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
Type | Description |
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
getEnableEndpointIndependentMapping()
public boolean getEnableEndpointIndependentMapping()
optional bool enable_endpoint_independent_mapping = 259441819;
Returns
Type | Description |
boolean | The enableEndpointIndependentMapping.
|
getIcmpIdleTimeoutSec()
public int getIcmpIdleTimeoutSec()
Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
optional int32 icmp_idle_timeout_sec = 3647562;
Returns
Type | Description |
int | The icmpIdleTimeoutSec.
|
getLogConfig()
public RouterNatLogConfig getLogConfig()
Configure logging on this NAT.
optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;
Returns
getLogConfigOrBuilder()
public RouterNatLogConfigOrBuilder getLogConfigOrBuilder()
Configure logging on this NAT.
optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741;
Returns
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
Type | Description |
int | The minPortsPerVm.
|
getName()
Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
optional string name = 3373707;
Returns
Type | Description |
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
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
Type | Description |
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
Type | Description |
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
Name | Description |
index | int
The index of the element to return.
|
Returns
Type | Description |
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
Name | Description |
index | int
The index of the value to return.
|
Returns
Type | Description |
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
Type | Description |
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
getParserForType()
public Parser<RouterNat> getParserForType()
Returns
Overrides
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
Returns
getRulesCount()
public int getRulesCount()
A list of rules associated with this NAT.
repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;
Returns
getRulesList()
public List<RouterNatRule> getRulesList()
A list of rules associated with this NAT.
repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;
Returns
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
Returns
getRulesOrBuilderList()
public List<? extends RouterNatRuleOrBuilder> getRulesOrBuilderList()
A list of rules associated with this NAT.
repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975;
Returns
Type | Description |
List<? extends com.google.cloud.compute.v1.RouterNatRuleOrBuilder> | |
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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 or ALL_SUBNETWORKS_ALL_PRIMARY_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
Type | Description |
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 or ALL_SUBNETWORKS_ALL_PRIMARY_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
Type | Description |
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
Returns
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
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
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
Returns
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
Type | Description |
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
Type | Description |
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
Type | Description |
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
Type | Description |
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
Type | Description |
int | The udpIdleTimeoutSec.
|
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hasEnableEndpointIndependentMapping()
public boolean hasEnableEndpointIndependentMapping()
optional bool enable_endpoint_independent_mapping = 259441819;
Returns
Type | Description |
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
Type | Description |
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
Type | Description |
boolean | Whether the logConfig 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
Type | Description |
boolean | Whether the minPortsPerVm field is set.
|
hasName()
Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.
optional string name = 3373707;
Returns
Type | Description |
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
Type | Description |
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 or ALL_SUBNETWORKS_ALL_PRIMARY_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
Type | Description |
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
Type | Description |
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
Type | Description |
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
Type | Description |
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
Type | Description |
boolean | Whether the udpIdleTimeoutSec field is set.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public RouterNat.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected RouterNat.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public RouterNat.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions