BackendService class

Represents a Backend Service resource.

A backend service defines how Google Cloud load balancers distribute traffic. The backend service configuration contains a set of values, such as the protocol used to connect to backends, various distribution and session settings, health checks, and timeouts.

These settings provide fine-grained control over how your load balancer behaves. Most of the settings have default values that allow for easy configuration if you need to get started quickly.

Backend services in Google Compute Engine can be either regionally or globally scoped.

Global * Regional

For more information, seeBackend Services.

Constructors

BackendService({int? affinityCookieTtlSec, List<Backend>? backends, BackendServiceCdnPolicy? cdnPolicy, CircuitBreakers? circuitBreakers, String? compressionMode, ConnectionDraining? connectionDraining, BackendServiceConnectionTrackingPolicy? connectionTrackingPolicy, ConsistentHashLoadBalancerSettings? consistentHash, String? creationTimestamp, List<BackendServiceCustomMetric>? customMetrics, List<String>? customRequestHeaders, List<String>? customResponseHeaders, String? description, String? edgeSecurityPolicy, bool? enableCDN, String? externalManagedMigrationState, double? externalManagedMigrationTestingPercentage, BackendServiceFailoverPolicy? failoverPolicy, String? fingerprint, BackendServiceHAPolicy? haPolicy, List<String>? healthChecks, BackendServiceIAP? iap, String? id, String? ipAddressSelectionPolicy, String? kind, String? loadBalancingScheme, List<BackendServiceLocalityLoadBalancingPolicyConfig>? localityLbPolicies, String? localityLbPolicy, BackendServiceLogConfig? logConfig, Duration? maxStreamDuration, Map<String, String>? metadatas, String? name, String? network, BackendServiceNetworkPassThroughLbTrafficPolicy? networkPassThroughLbTrafficPolicy, BackendServiceOrchestrationInfo? orchestrationInfo, OutlierDetection? outlierDetection, BackendServiceParams? params, int? port, String? portName, String? protocol, String? region, String? securityPolicy, SecuritySettings? securitySettings, String? selfLink, List<String>? serviceBindings, String? serviceLbPolicy, String? sessionAffinity, BackendServiceHttpCookie? strongSessionAffinityCookie, Subsetting? subsetting, int? timeoutSec, BackendServiceTlsSettings? tlsSettings, List<BackendServiceUsedBy>? usedBy})
BackendService.fromJson(Map json_)

Properties

affinityCookieTtlSec ↔ int?
Lifetime of cookies in seconds.
getter/setter pair
backends ↔ List<Backend>?
The list of backends that serve this BackendService.
getter/setter pair
cdnPolicy ↔ BackendServiceCdnPolicy?
Cloud CDN configuration for this BackendService.
getter/setter pair
circuitBreakers ↔ CircuitBreakers?
getter/setter pair
compressionMode ↔ String?
Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Possible string values are:
getter/setter pair
connectionDraining ↔ ConnectionDraining?
connectionDraining cannot be specified with haPolicy.
getter/setter pair
connectionTrackingPolicy ↔ BackendServiceConnectionTrackingPolicy?
Connection Tracking configuration for this BackendService.
getter/setter pair
consistentHash ↔ ConsistentHashLoadBalancerSettings?
Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties.
getter/setter pair
creationTimestamp ↔ String?
Creation timestamp inRFC3339 text format.
getter/setter pair
customMetrics ↔ List<BackendServiceCustomMetric>?
List of custom metrics that are used for theWEIGHTED_ROUND_ROBIN locality_lb_policy.
getter/setter pair
customRequestHeaders ↔ List<String>?
Headers that the load balancer adds to proxied requests.
getter/setter pair
customResponseHeaders ↔ List<String>?
Headers that the load balancer adds to proxied responses.
getter/setter pair
description ↔ String?
An optional description of this resource.
getter/setter pair
edgeSecurityPolicy ↔ String?
The resource URL for the edge security policy associated with this backend service.
getter/setter pair
enableCDN ↔ bool?
If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.
getter/setter pair
externalManagedMigrationState ↔ String?
Specifies the canary migration state.
getter/setter pair
externalManagedMigrationTestingPercentage ↔ double?
Determines the fraction of requests that should be processed by the Global external Application Load Balancer.
getter/setter pair
failoverPolicy ↔ BackendServiceFailoverPolicy?
Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). failoverPolicy cannot be specified with haPolicy.failoverPolicy cannot be used by global external Passthrough Network Load Balancers.
getter/setter pair
fingerprint ↔ String?
Fingerprint of this resource.
getter/setter pair
fingerprintAsBytes ↔ List<int>
getter/setter pair
haPolicy ↔ BackendServiceHAPolicy?
Configures self-managed High Availability (HA) for External and Internal Protocol Forwarding.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
healthChecks ↔ List<String>?
The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service.
getter/setter pair
iap ↔ BackendServiceIAP?
The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.
getter/setter pair
id ↔ String?
The unique identifier for the resource.
getter/setter pair
ipAddressSelectionPolicy ↔ String?
Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are:
getter/setter pair
kind ↔ String?
Type of resource.
getter/setter pair
loadBalancingScheme ↔ String?
Specifies the load balancer type.
getter/setter pair
localityLbPolicies ↔ List<BackendServiceLocalityLoadBalancingPolicyConfig>?
A list of locality load-balancing policies to be used in order of preference.
getter/setter pair
localityLbPolicy ↔ String?
The load balancing algorithm used within the scope of the locality.
getter/setter pair
logConfig ↔ BackendServiceLogConfig?
This field denotes the logging options for the load balancer traffic served by this backend service.
getter/setter pair
maxStreamDuration ↔ Duration?
Specifies the default maximum duration (timeout) for streams to this service.
getter/setter pair
metadatas ↔ Map<String, String>?
Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH
getter/setter pair
name ↔ String?
Name of the resource.
getter/setter pair
network ↔ String?
The URL of the network to which this backend service belongs.
getter/setter pair
networkPassThroughLbTrafficPolicy ↔ BackendServiceNetworkPassThroughLbTrafficPolicy?
Configures traffic steering properties of internal passthrough Network Load Balancers.
getter/setter pair
orchestrationInfo ↔ BackendServiceOrchestrationInfo?
Information about the resource or system that manages the backend service.
getter/setter pair
outlierDetection ↔ OutlierDetection?
Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service.
getter/setter pair
params ↔ BackendBucketParams?
Input only.
getter/setter pair
port ↔ int?
Deprecated in favor of portName.
getter/setter pair
portName ↔ String?
A named port on a backend instance group representing the port for communication to the backend VMs in that group.
getter/setter pair
protocol ↔ String?
The protocol this BackendService uses to communicate with backends.
getter/setter pair
region ↔ String?
URL of the region where the regional backend service resides.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityPolicy ↔ String?
The resource URL for the security policy associated with this backend service.
getter/setter pair
securitySettings ↔ SecuritySettings?
This field specifies the security settings that apply to this backend service.
getter/setter pair
Server-defined URL for the resource.
getter/setter pair
serviceBindings ↔ List<String>?
URLs of networkservices.ServiceBinding resources.
getter/setter pair
serviceLbPolicy ↔ String?
URL to networkservices.ServiceLbPolicy resource.
getter/setter pair
sessionAffinity ↔ String?
Type of session affinity to use.
getter/setter pair
strongSessionAffinityCookie ↔ BackendServiceHttpCookie?
Describes the HTTP cookie used for stateful session affinity.
getter/setter pair
subsetting ↔ Subsetting?
subsetting cannot be specified with haPolicy.
getter/setter pair
timeoutSec ↔ int?
The backend service timeout has a different meaning depending on the type of load balancer.
getter/setter pair
tlsSettings ↔ BackendServiceTlsSettings?
Configuration for Backend Authenticated TLS and mTLS.
getter/setter pair
usedBy ↔ List<BackendServiceUsedBy>?
List of resources referencing given backend service.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited