Class RouterNat.Builder (1.88.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
Type Description
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
Name Description
values Iterable<String>

The drainNatIps to add.

Returns
Type Description
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
Name Description
values Iterable<String>

The endpointTypes to add.

Returns
Type Description
RouterNat.Builder

This builder for chaining.

addAllNat64Subnetworks(Iterable<? extends RouterNatSubnetworkToNat64> values)

public RouterNat.Builder addAllNat64Subnetworks(Iterable<? extends RouterNatSubnetworkToNat64> values)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNat64>
Returns
Type Description
RouterNat.Builder

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
Name Description
values Iterable<String>

The natIps to add.

Returns
Type Description
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
Name Description
values Iterable<? extends com.google.cloud.compute.v1.RouterNatRule>
Returns
Type Description
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
Name Description
values Iterable<? extends com.google.cloud.compute.v1.RouterNatSubnetworkToNat>
Returns
Type Description
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
Name Description
value String

The drainNatIps to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the drainNatIps to add.

Returns
Type Description
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
Name Description
value String

The endpointTypes to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the endpointTypes to add.

Returns
Type Description
RouterNat.Builder

This builder for chaining.

addNat64Subnetworks(RouterNatSubnetworkToNat64 value)

public RouterNat.Builder addNat64Subnetworks(RouterNatSubnetworkToNat64 value)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameter
Name Description
value RouterNatSubnetworkToNat64
Returns
Type Description
RouterNat.Builder

addNat64Subnetworks(RouterNatSubnetworkToNat64.Builder builderForValue)

public RouterNat.Builder addNat64Subnetworks(RouterNatSubnetworkToNat64.Builder builderForValue)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameter
Name Description
builderForValue RouterNatSubnetworkToNat64.Builder
Returns
Type Description
RouterNat.Builder

addNat64Subnetworks(int index, RouterNatSubnetworkToNat64 value)

public RouterNat.Builder addNat64Subnetworks(int index, RouterNatSubnetworkToNat64 value)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameters
Name Description
index int
value RouterNatSubnetworkToNat64
Returns
Type Description
RouterNat.Builder

addNat64Subnetworks(int index, RouterNatSubnetworkToNat64.Builder builderForValue)

public RouterNat.Builder addNat64Subnetworks(int index, RouterNatSubnetworkToNat64.Builder builderForValue)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameters
Name Description
index int
builderForValue RouterNatSubnetworkToNat64.Builder
Returns
Type Description
RouterNat.Builder

addNat64SubnetworksBuilder()

public RouterNatSubnetworkToNat64.Builder addNat64SubnetworksBuilder()

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Returns
Type Description
RouterNatSubnetworkToNat64.Builder

addNat64SubnetworksBuilder(int index)

public RouterNatSubnetworkToNat64.Builder addNat64SubnetworksBuilder(int index)

List of Subnetwork resources whose traffic should be translated by NAT64 Gateway. It is used only when LIST_OF_IPV6_SUBNETWORKS is selected for the SubnetworkIpRangeToNat64Option above.

repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat64 nat64_subnetworks = 63585701;

Parameter
Name Description
index int
Returns
Type Description
RouterNatSubnetworkToNat64.Builder

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
Name Description
value String

The natIps to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the natIps to add.

Returns
Type Description
RouterNat.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RouterNat.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value RouterNatRule
Returns
Type Description
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
Name Description
builderForValue RouterNatRule.Builder
Returns
Type Description
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
Name Description
index int
value RouterNatRule
Returns
Type Description
Rou