ForwardingRule class final
Represents a Forwarding Rule resource.
Forwarding rule resources in Google Cloud can be either regional or global in scope:
A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud load balancer. Forwarding rules can also reference target instances and Cloud VPN Classic gateways (targetVpnGateway).
For more information, read Forwarding rule concepts and Using protocol forwarding.
Constructors
-
ForwardingRule({String? iPAddress, String? iPProtocol, bool? allPorts, bool? allowGlobalAccess, bool? allowPscGlobalAccess, List<
ForwardingRuleAttachedExtension> attachedExtensions = const [], String? backendService, String? baseForwardingRule, String? creationTimestamp, String? description, String? externalManagedBackendBucketMigrationState, double? externalManagedBackendBucketMigrationTestingPercentage, String? fingerprint, BigInt? id, String? ipCollection, String? ipVersion, bool? isMirroringCollector, String? kind, String? labelFingerprint, Map<String, String> labels = const {}, String? loadBalancingScheme, List<MetadataFilter> metadataFilters = const [], String? name, String? network, String? networkTier, bool? noAutomateDnsZone, String? portRange, List<String> ports = const [], BigInt? pscConnectionId, String? pscConnectionStatus, String? region, String? selfLink, String? selfLinkWithId, List<ForwardingRuleServiceDirectoryRegistration> serviceDirectoryRegistrations = const [], String? serviceLabel, String? serviceName, List<String> sourceIpRanges = const [], String? subnetwork, String? target}) - ForwardingRule.fromJson(Object? j)
-
factory
Properties
- allowGlobalAccess → bool?
-
If set to true, clients can access the internal passthrough Network Load
Balancers, the regional internal Application Load Balancer, and the
regional internal proxy Network Load Balancer from all regions.
If false, only allows access from the local region the load balancer is
located at. Note that for INTERNAL_MANAGED forwarding rules, this field
cannot be changed after the forwarding rule is created.
final
- allowPscGlobalAccess → bool?
-
This is used in PSC consumer ForwardingRule to control whether the PSC
endpoint can be accessed from another region.
final
- allPorts → bool?
-
The ports, portRange, and allPorts
fields are mutually exclusive. Only packets addressed to ports in the
specified range will be forwarded to the backends configured with this
forwarding rule.
final
-
attachedExtensions
→ List<
ForwardingRuleAttachedExtension> -
Output only.
Output Only. The extensions that are attached to this ForwardingRule.final - backendService → String?
-
Identifies the backend service to which the forwarding rule sends traffic.
final
- baseForwardingRule → String?
-
Output only.
Output OnlyThe URL for the corresponding base forwarding rule. By base forwarding rule, we mean the forwarding rule that has the same IP address, protocol, and port settings with the current forwarding rule, but without sourceIPRanges specified. Always empty if the current forwarding rule does not have sourceIPRanges specified.final - creationTimestamp → String?
-
Output only.
Output OnlyCreation timestamp inRFC3339 text format.final - description → String?
-
An optional description of this resource. Provide this property when you
create the resource.
final
- externalManagedBackendBucketMigrationState → String?
-
Specifies the canary migration state for the backend buckets attached to
this forwarding rule. Possible values are PREPARE, TEST_BY_PERCENTAGE, and
TEST_ALL_TRAFFIC.
final
- externalManagedBackendBucketMigrationTestingPercentage → double?
-
Determines the fraction of requests to backend buckets that should be
processed by the global external Application Load Balancer.
final
- fingerprint → String?
-
Fingerprint of this resource. A hash of the contents stored in this object.
This field is used in optimistic locking. This field will be ignored when
inserting a ForwardingRule. Include the fingerprint in patch request to
ensure that you do not overwrite changes that were applied from another
concurrent request.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → BigInt?
-
Output OnlyThe unique identifier for the resource. This identifier is defined by the server.final - iPAddress → String?
-
IP address for which this forwarding rule accepts traffic. When a client
sends traffic to this IP address, the forwarding rule directs the traffic
to the referenced target or backendService.
While creating a forwarding rule, specifying an IPAddress is
required under the following circumstances:
final
- ipCollection → String?
-
Resource reference of a PublicDelegatedPrefix. The PDP must
be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode.
final
- iPProtocol → String?
-
The IP protocol to which this rule applies.
final
- ipVersion → String?
-
The IP Version that will be used by this forwarding rule. Valid options
are IPV4 or IPV6.
Check the IpVersion enum for the list of possible values.
final
- isMirroringCollector → bool?
-
Indicates whether or not this load balancer can be used as a collector for
packet mirroring. To prevent mirroring loops, instances behind this
load balancer will not have their traffic mirrored even if aPacketMirroring rule applies to them.
This can only be set to true for load balancers that have theirloadBalancingScheme set to INTERNAL.
final
- kind → String?
-
Output only.
Output OnlyType of the resource. Alwayscompute#forwardingRule for forwarding rule resources.final - labelFingerprint → String?
-
A fingerprint for the labels being applied to this resource, which is
essentially a hash of the labels set used for optimistic locking. The
fingerprint is initially generated by Compute Engine and changes after
every request to modify or update labels. You must always provide an
up-to-date fingerprint hash in order to update or change labels,
otherwise the request will fail with error412 conditionNotMet.
final
-
labels
→ Map<
String, String> -
Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.
Label values may be empty.
final
- loadBalancingScheme → String?
-
Specifies the forwarding rule type.
final
-
metadataFilters
→ List<
MetadataFilter> -
Opaque filter criteria used by load balancer to restrict routing
configuration to a limited set of xDS
compliant clients. In their xDS requests to load balancer, xDS clients
present node
metadata. When there is a match, the relevant configuration
is made available to those proxies. Otherwise, all the resources (e.g.TargetHttpProxy, UrlMap)
referenced by the ForwardingRule are not visible to
those proxies.
final
- name → String?
-
Name of the resource; provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression
[a-z]([-a-z0-9]*[a-z0-9])?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.final - network → String?
-
This field is not used for global external load balancing.
final
- networkTier → String?
-
This signifies the networking tier used for configuring
this load balancer and can only take the following values:PREMIUM, STANDARD.
final
- noAutomateDnsZone → bool?
-
This is used in PSC consumer ForwardingRule to control whether it should
try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use
this field. Once set, this field is not mutable.
final
- portRange → String?
-
The ports, portRange, and allPorts
fields are mutually exclusive. Only packets addressed to ports in the
specified range will be forwarded to the backends configured with this
forwarding rule.
final
-
ports
→ List<
String> -
The ports, portRange, and allPorts
fields are mutually exclusive. Only packets addressed to ports in the
specified range will be forwarded to the backends configured with this
forwarding rule.
final
- pscConnectionId → BigInt?
-
Output OnlyThe PSC connection id of the PSC forwarding rule.final - pscConnectionStatus → String?
-
Check the PscConnectionStatus enum for the list of possible values.
final
- qualifiedName → String
-
The fully qualified name of this message, i.e.,
google.protobuf.Durationorgoogle.rpc.ErrorInfo.finalinherited - region → String?
-
Output only.
Output OnlyURL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selfLink → String?
-
Output OnlyServer-defined URL for the resource.final - selfLinkWithId → String?
-
Output only.
Output OnlyServer-defined URL for this resource with the resource id.final -
serviceDirectoryRegistrations
→ List<
ForwardingRuleServiceDirectoryRegistration> -
Service Directory resources to register this forwarding rule with.
Currently, only supports a single Service Directory resource.
final
- serviceLabel → String?
-
An optional prefix to the service name for this forwarding rule.
If specified, the prefix is the first label of the fully qualified service
name.
final
- serviceName → String?
-
Output OnlyThe internal fully qualified service name for this forwarding rule.final -
sourceIpRanges
→ List<
String> -
If not empty, this forwarding rule will only forward the traffic when the
source IP address matches one of the IP addresses or CIDR ranges set here.
Note that a forwarding rule can only have up to 64 source IP ranges, and
this field can only be used with a regional forwarding rule whose scheme isEXTERNAL.
Each source_ip_range entry should be either an IP address (for
example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24).
final
- subnetwork → String?
-
This field identifies the subnetwork that the load balanced IP should
belong to for this forwarding rule, used with internal load balancers and
external passthrough Network Load Balancers with IPv6.
final
- target → String?
-
The URL of the target resource to receive the matched traffic. For
regional forwarding rules, this target must be in the same region as the
forwarding rule. For global forwarding rules, this target must be a global
load balancing resource.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- fullyQualifiedName → const String