balancingMode = $balancingMode; } /** * @return self::BALANCING_MODE_* */ public function getBalancingMode() { return $this->balancingMode; } /** * A multiplier applied to the backend's target capacity of its balancing * mode. The default value is 1, which means the group serves up to 100% of * its configured capacity (depending onbalancingMode). A setting of 0 means * the group is completely drained, offering 0% of its available capacity. The * valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger * than 0 and smaller than0.1. You cannot configure a setting of 0 when there * is only one backend attached to the backend service. * * Not available with backends that don't support using abalancingMode. This * includes backends such as global internet NEGs, regional serverless NEGs, * and PSC NEGs. * * @param float $capacityScaler */ public function setCapacityScaler($capacityScaler) { $this->capacityScaler = $capacityScaler; } /** * @return float */ public function getCapacityScaler() { return $this->capacityScaler; } /** * List of custom metrics that are used for CUSTOM_METRICS BalancingMode. * * @param BackendCustomMetric[] $customMetrics */ public function setCustomMetrics($customMetrics) { $this->customMetrics = $customMetrics; } /** * @return BackendCustomMetric[] */ public function getCustomMetrics() { return $this->customMetrics; } /** * An optional description of this resource. Provide this property when you * create the resource. * * @param string $description */ public function setDescription($description) { $this->description = $description; } /** * @return string */ public function getDescription() { return $this->description; } /** * This field designates whether this is a failover backend. More than one * failover backend can be configured for a given BackendService. * * @param bool $failover */ public function setFailover($failover) { $this->failover = $failover; } /** * @return bool */ public function getFailover() { return $this->failover; } /** * The fully-qualified URL of aninstance group or network endpoint group (NEG) * resource. To determine what types of backends a load balancer supports, see * the [Backend services overview](https://cloud.google.com/load- * balancing/docs/backend-service#backends). * * You must use the *fully-qualified* URL (starting * withhttps://www.googleapis.com/) to specify the instance group or NEG. * Partial URLs are not supported. * * If haPolicy is specified, backends must refer to NEG resources of type * GCE_VM_IP. * * @param string $group */ public function setGroup($group) { $this->group = $group; } /** * @return string */ public function getGroup() { return $this->group; } /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, seeConnection balancing mode and Utilization balancing mode. * Not available if the backend'sbalancingMode is RATE. * * @param int $maxConnections */ public function setMaxConnections($maxConnections) { $this->maxConnections = $maxConnections; } /** * @return int */ public function getMaxConnections() { return $this->maxConnections; } /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, seeConnection balancing mode and Utilization balancing mode. * * Not available if the backend's balancingMode isRATE. * * @param int $maxConnectionsPerEndpoint */ public function setMaxConnectionsPerEndpoint($maxConnectionsPerEndpoint) { $this->maxConnectionsPerEndpoint = $maxConnectionsPerEndpoint; } /** * @return int */ public function getMaxConnectionsPerEndpoint() { return $this->maxConnectionsPerEndpoint; } /** * Defines a target maximum number of simultaneous connections. For usage * guidelines, seeConnection balancing mode and Utilization balancing mode. * * Not available if the backend's balancingMode isRATE. * * @param int $maxConnectionsPerInstance */ public function setMaxConnectionsPerInstance($maxConnectionsPerInstance) { $this->maxConnectionsPerInstance = $maxConnectionsPerInstance; } /** * @return int */ public function getMaxConnectionsPerInstance() { return $this->maxConnectionsPerInstance; } /** * Defines a maximum number of in-flight requests for the whole NEG or * instance group. Not available if backend's balancingMode isRATE or * CONNECTION. * * @param int $maxInFlightRequests */ public function setMaxInFlightRequests($maxInFlightRequests) { $this->maxInFlightRequests = $maxInFlightRequests; } /** * @return int */ public function getMaxInFlightRequests() { return $this->maxInFlightRequests; } /** * Defines a maximum number of in-flight requests for a single endpoint. Not * available if backend's balancingMode is RATE or CONNECTION. * * @param int $maxInFlightRequestsPerEndpoint */ public function setMaxInFlightRequestsPerEndpoint($maxInFlightRequestsPerEndpoint) { $this->maxInFlightRequestsPerEndpoint = $maxInFlightRequestsPerEndpoint; } /** * @return int */ public function getMaxInFlightRequestsPerEndpoint() { return $this->maxInFlightRequestsPerEndpoint; } /** * Defines a maximum number of in-flight requests for a single VM. Not * available if backend's balancingMode is RATE or CONNECTION. * * @param int $maxInFlightRequestsPerInstance */ public function setMaxInFlightRequestsPerInstance($maxInFlightRequestsPerInstance) { $this->maxInFlightRequestsPerInstance = $maxInFlightRequestsPerInstance; } /** * @return int */ public function getMaxInFlightRequestsPerInstance() { return $this->maxInFlightRequestsPerInstance; } /** * Defines a maximum number of HTTP requests per second (RPS). For usage * guidelines, seeRate balancing mode and Utilization balancing mode. * * Not available if the backend's balancingMode isCONNECTION. * * @param int $maxRate */ public function setMaxRate($maxRate) { $this->maxRate = $maxRate; } /** * @return int */ public function getMaxRate() { return $this->maxRate; } /** * Defines a maximum target for requests per second (RPS). For usage * guidelines, seeRate balancing mode and Utilization balancing mode. * * Not available if the backend's balancingMode isCONNECTION. * * @param float $maxRatePerEndpoint */ public function setMaxRatePerEndpoint($maxRatePerEndpoint) { $this->maxRatePerEndpoint = $maxRatePerEndpoint; } /** * @return float */ public function getMaxRatePerEndpoint() { return $this->maxRatePerEndpoint; } /** * Defines a maximum target for requests per second (RPS). For usage * guidelines, seeRate balancing mode and Utilization balancing mode. * * Not available if the backend's balancingMode isCONNECTION. * * @param float $maxRatePerInstance */ public function setMaxRatePerInstance($maxRatePerInstance) { $this->maxRatePerInstance = $maxRatePerInstance; } /** * @return float */ public function getMaxRatePerInstance() { return $this->maxRatePerInstance; } /** * Optional parameter to define a target capacity for theUTILIZATION balancing * mode. The valid range is[0.0, 1.0]. * * For usage guidelines, seeUtilization balancing mode. * * @param float $maxUtilization */ public function setMaxUtilization($maxUtilization) { $this->maxUtilization = $maxUtilization; } /** * @return float */ public function getMaxUtilization() { return $this->maxUtilization; } /** * Information about the resource or system that manages the backend. * * @param BackendBackendOrchestrationInfo $orchestrationInfo */ public function setOrchestrationInfo(BackendBackendOrchestrationInfo $orchestrationInfo) { $this->orchestrationInfo = $orchestrationInfo; } /** * @return BackendBackendOrchestrationInfo */ public function getOrchestrationInfo() { return $this->orchestrationInfo; } /** * This field indicates whether this backend should be fully utilized before * sending traffic to backends with default preference. The possible values * are: - PREFERRED: Backends with this preference level will be * filled up to their capacity limits first, based on RTT. - DEFAULT: If * preferred backends don't have enough capacity, backends in this layer * would be used and traffic would be assigned based on the load balancing * algorithm you use. This is the default * * Accepted values: DEFAULT, PREFERENCE_UNSPECIFIED, PREFERRED * * @param self::PREFERENCE_* $preference */ public function setPreference($preference) { $this->preference = $preference; } /** * @return self::PREFERENCE_* */ public function getPreference() { return $this->preference; } /** * @param self::TRAFFIC_DURATION_* $trafficDuration */ public function setTrafficDuration($trafficDuration) { $this->trafficDuration = $trafficDuration; } /** * @return self::TRAFFIC_DURATION_* */ public function getTrafficDuration() { return $this->trafficDuration; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(Backend::class, 'Google_Service_Compute_Backend');