BackendService.php 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Compute;
  18. class BackendService extends \Google\Collection
  19. {
  20. /**
  21. * Automatically uses the best compression based on the Accept-Encoding header
  22. * sent by the client.
  23. */
  24. public const COMPRESSION_MODE_AUTOMATIC = 'AUTOMATIC';
  25. /**
  26. * Disables compression. Existing compressed responses cached by Cloud CDN
  27. * will not be served to clients.
  28. */
  29. public const COMPRESSION_MODE_DISABLED = 'DISABLED';
  30. public const EXTERNAL_MANAGED_MIGRATION_STATE_PREPARE = 'PREPARE';
  31. public const EXTERNAL_MANAGED_MIGRATION_STATE_TEST_ALL_TRAFFIC = 'TEST_ALL_TRAFFIC';
  32. public const EXTERNAL_MANAGED_MIGRATION_STATE_TEST_BY_PERCENTAGE = 'TEST_BY_PERCENTAGE';
  33. /**
  34. * Only send IPv4 traffic to the backends of the Backend Service (Instance
  35. * Group, Managed Instance Group, Network Endpoint Group) regardless of
  36. * traffic from the client to the proxy. Only IPv4 health-checks are used to
  37. * check the health of the backends. This is the default setting.
  38. */
  39. public const IP_ADDRESS_SELECTION_POLICY_IPV4_ONLY = 'IPV4_ONLY';
  40. /**
  41. * Only send IPv6 traffic to the backends of the Backend Service (Instance
  42. * Group, Managed Instance Group, Network Endpoint Group) regardless of
  43. * traffic from the client to the proxy. Only IPv6 health-checks are used to
  44. * check the health of the backends.
  45. */
  46. public const IP_ADDRESS_SELECTION_POLICY_IPV6_ONLY = 'IPV6_ONLY';
  47. /**
  48. * Unspecified IP address selection policy.
  49. */
  50. public const IP_ADDRESS_SELECTION_POLICY_IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED = 'IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED';
  51. /**
  52. * Prioritize the connection to the endpoints IPv6 address over its IPv4
  53. * address (provided there is a healthy IPv6 address).
  54. */
  55. public const IP_ADDRESS_SELECTION_POLICY_PREFER_IPV6 = 'PREFER_IPV6';
  56. /**
  57. * Signifies that this will be used for classic Application Load Balancers,
  58. * global external proxy Network Load Balancers, or external passthrough
  59. * Network Load Balancers.
  60. */
  61. public const LOAD_BALANCING_SCHEME_EXTERNAL = 'EXTERNAL';
  62. /**
  63. * Signifies that this will be used for global external Application Load
  64. * Balancers, regional external Application Load Balancers, or regional
  65. * external proxy Network Load Balancers.
  66. */
  67. public const LOAD_BALANCING_SCHEME_EXTERNAL_MANAGED = 'EXTERNAL_MANAGED';
  68. /**
  69. * Signifies that this will be used for internal passthrough Network Load
  70. * Balancers.
  71. */
  72. public const LOAD_BALANCING_SCHEME_INTERNAL = 'INTERNAL';
  73. /**
  74. * Signifies that this will be used for internal Application Load Balancers.
  75. */
  76. public const LOAD_BALANCING_SCHEME_INTERNAL_MANAGED = 'INTERNAL_MANAGED';
  77. /**
  78. * Signifies that this will be used by Traffic Director.
  79. */
  80. public const LOAD_BALANCING_SCHEME_INTERNAL_SELF_MANAGED = 'INTERNAL_SELF_MANAGED';
  81. public const LOAD_BALANCING_SCHEME_INVALID_LOAD_BALANCING_SCHEME = 'INVALID_LOAD_BALANCING_SCHEME';
  82. public const LOCALITY_LB_POLICY_INVALID_LB_POLICY = 'INVALID_LB_POLICY';
  83. /**
  84. * An O(1) algorithm which selects two random healthy hosts and picks the host
  85. * which has fewer active requests.
  86. */
  87. public const LOCALITY_LB_POLICY_LEAST_REQUEST = 'LEAST_REQUEST';
  88. /**
  89. * This algorithm implements consistent hashing to backends. Maglev can be
  90. * used as a drop in replacement for the ring hash load balancer. Maglev is
  91. * not as stable as ring hash but has faster table lookup build times and host
  92. * selection times. For more information about Maglev, seeMaglev: A Fast and
  93. * Reliable Software Network Load Balancer.
  94. */
  95. public const LOCALITY_LB_POLICY_MAGLEV = 'MAGLEV';
  96. /**
  97. * Backend host is selected based on the client connection metadata, i.e.,
  98. * connections are opened to the same address as the destination address of
  99. * the incoming connection before the connection was redirected to the load
  100. * balancer.
  101. */
  102. public const LOCALITY_LB_POLICY_ORIGINAL_DESTINATION = 'ORIGINAL_DESTINATION';
  103. /**
  104. * The load balancer selects a random healthy host.
  105. */
  106. public const LOCALITY_LB_POLICY_RANDOM = 'RANDOM';
  107. /**
  108. * The ring/modulo hash load balancer implements consistent hashing to
  109. * backends. The algorithm has the property that the addition/removal of a
  110. * host from a set of N hosts only affects 1/N of the requests.
  111. */
  112. public const LOCALITY_LB_POLICY_RING_HASH = 'RING_HASH';
  113. /**
  114. * This is a simple policy in which each healthy backend is selected in round
  115. * robin order. This is the default.
  116. */
  117. public const LOCALITY_LB_POLICY_ROUND_ROBIN = 'ROUND_ROBIN';
  118. /**
  119. * Per-instance weighted Load Balancing via health check reported weights. In
  120. * internal passthrough network load balancing, it is weighted rendezvous
  121. * hashing. This option is only supported in internal passthrough network load
  122. * balancing.
  123. */
  124. public const LOCALITY_LB_POLICY_WEIGHTED_GCP_RENDEZVOUS = 'WEIGHTED_GCP_RENDEZVOUS';
  125. /**
  126. * Per-instance weighted Load Balancing via health check reported weights. If
  127. * set, the Backend Service must configure a non legacy HTTP-based Health
  128. * Check, and health check replies are expected to contain non-standard HTTP
  129. * response header field X-Load-Balancing-Endpoint-Weight to specify the per-
  130. * instance weights. If set, Load Balancing is weighted based on the per-
  131. * instance weights reported in the last processed health check replies, as
  132. * long as every instance either reported a valid weight or had
  133. * UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This
  134. * option is only supported in Network Load Balancing.
  135. */
  136. public const LOCALITY_LB_POLICY_WEIGHTED_MAGLEV = 'WEIGHTED_MAGLEV';
  137. /**
  138. * Per-endpoint weighted round-robin Load Balancing using weights computed
  139. * from Backend reported Custom Metrics. If set, the Backend Service responses
  140. * are expected to contain non-standard HTTP response header field Endpoint-
  141. * Load-Metrics. The reported metrics to use for computing the weights are
  142. * specified via the customMetrics fields.
  143. */
  144. public const LOCALITY_LB_POLICY_WEIGHTED_ROUND_ROBIN = 'WEIGHTED_ROUND_ROBIN';
  145. /**
  146. * gRPC (available for Traffic Director).
  147. */
  148. public const PROTOCOL_GRPC = 'GRPC';
  149. /**
  150. * HTTP2 over cleartext
  151. */
  152. public const PROTOCOL_H2C = 'H2C';
  153. public const PROTOCOL_HTTP = 'HTTP';
  154. /**
  155. * HTTP/2 with SSL.
  156. */
  157. public const PROTOCOL_HTTP2 = 'HTTP2';
  158. public const PROTOCOL_HTTPS = 'HTTPS';
  159. /**
  160. * TCP proxying with SSL.
  161. */
  162. public const PROTOCOL_SSL = 'SSL';
  163. /**
  164. * TCP proxying or TCP pass-through.
  165. */
  166. public const PROTOCOL_TCP = 'TCP';
  167. /**
  168. * UDP.
  169. */
  170. public const PROTOCOL_UDP = 'UDP';
  171. /**
  172. * If a Backend Service has UNSPECIFIED as its protocol, it can be used with
  173. * any L3/L4 Forwarding Rules.
  174. */
  175. public const PROTOCOL_UNSPECIFIED = 'UNSPECIFIED';
  176. /**
  177. * 2-tuple hash on packet's source and destination IP addresses. Connections
  178. * from the same source IP address to the same destination IP address will be
  179. * served by the same backend VM while that VM remains healthy.
  180. */
  181. public const SESSION_AFFINITY_CLIENT_IP = 'CLIENT_IP';
  182. /**
  183. * 1-tuple hash only on packet's source IP address. Connections from the same
  184. * source IP address will be served by the same backend VM while that VM
  185. * remains healthy. This option can only be used for Internal TCP/UDP Load
  186. * Balancing.
  187. */
  188. public const SESSION_AFFINITY_CLIENT_IP_NO_DESTINATION = 'CLIENT_IP_NO_DESTINATION';
  189. /**
  190. * 5-tuple hash on packet's source and destination IP addresses, IP protocol,
  191. * and source and destination ports. Connections for the same IP protocol from
  192. * the same source IP address and port to the same destination IP address and
  193. * port will be served by the same backend VM while that VM remains healthy.
  194. * This option cannot be used for HTTP(S) load balancing.
  195. */
  196. public const SESSION_AFFINITY_CLIENT_IP_PORT_PROTO = 'CLIENT_IP_PORT_PROTO';
  197. /**
  198. * 3-tuple hash on packet's source and destination IP addresses, and IP
  199. * protocol. Connections for the same IP protocol from the same source IP
  200. * address to the same destination IP address will be served by the same
  201. * backend VM while that VM remains healthy. This option cannot be used for
  202. * HTTP(S) load balancing.
  203. */
  204. public const SESSION_AFFINITY_CLIENT_IP_PROTO = 'CLIENT_IP_PROTO';
  205. /**
  206. * Hash based on a cookie generated by the L7 loadbalancer. Only valid for
  207. * HTTP(S) load balancing.
  208. */
  209. public const SESSION_AFFINITY_GENERATED_COOKIE = 'GENERATED_COOKIE';
  210. /**
  211. * The hash is based on a user specified header field.
  212. */
  213. public const SESSION_AFFINITY_HEADER_FIELD = 'HEADER_FIELD';
  214. /**
  215. * The hash is based on a user provided cookie.
  216. */
  217. public const SESSION_AFFINITY_HTTP_COOKIE = 'HTTP_COOKIE';
  218. /**
  219. * No session affinity. Connections from the same client IP may go to any
  220. * instance in the pool.
  221. */
  222. public const SESSION_AFFINITY_NONE = 'NONE';
  223. /**
  224. * Strong cookie-based affinity. Connections bearing the same cookie will be
  225. * served by the same backend VM while that VM remains healthy, as long as the
  226. * cookie has not expired.
  227. */
  228. public const SESSION_AFFINITY_STRONG_COOKIE_AFFINITY = 'STRONG_COOKIE_AFFINITY';
  229. protected $collection_key = 'usedBy';
  230. /**
  231. * Lifetime of cookies in seconds. This setting is applicable to Application
  232. * Load Balancers and Traffic Director and requires GENERATED_COOKIE or
  233. * HTTP_COOKIE session affinity.
  234. *
  235. * If set to 0, the cookie is non-persistent and lasts only until the end of
  236. * the browser session (or equivalent). The maximum allowed value is two weeks
  237. * (1,209,600).
  238. *
  239. * Not supported when the backend service is referenced by a URL map that is
  240. * bound to target gRPC proxy that has validateForProxyless field set to true.
  241. *
  242. * @var int
  243. */
  244. public $affinityCookieTtlSec;
  245. protected $backendsType = Backend::class;
  246. protected $backendsDataType = 'array';
  247. protected $cdnPolicyType = BackendServiceCdnPolicy::class;
  248. protected $cdnPolicyDataType = '';
  249. protected $circuitBreakersType = CircuitBreakers::class;
  250. protected $circuitBreakersDataType = '';
  251. /**
  252. * Compress text responses using Brotli or gzip compression, based on the
  253. * client's Accept-Encoding header.
  254. *
  255. * @var string
  256. */
  257. public $compressionMode;
  258. protected $connectionDrainingType = ConnectionDraining::class;
  259. protected $connectionDrainingDataType = '';
  260. protected $connectionTrackingPolicyType = BackendServiceConnectionTrackingPolicy::class;
  261. protected $connectionTrackingPolicyDataType = '';
  262. protected $consistentHashType = ConsistentHashLoadBalancerSettings::class;
  263. protected $consistentHashDataType = '';
  264. /**
  265. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  266. *
  267. * @var string
  268. */
  269. public $creationTimestamp;
  270. protected $customMetricsType = BackendServiceCustomMetric::class;
  271. protected $customMetricsDataType = 'array';
  272. /**
  273. * Headers that the load balancer adds to proxied requests. See [Creating
  274. * custom headers](https://cloud.google.com/load-balancing/docs/custom-
  275. * headers).
  276. *
  277. * @var string[]
  278. */
  279. public $customRequestHeaders;
  280. /**
  281. * Headers that the load balancer adds to proxied responses. See [Creating
  282. * custom headers](https://cloud.google.com/load-balancing/docs/custom-
  283. * headers).
  284. *
  285. * @var string[]
  286. */
  287. public $customResponseHeaders;
  288. /**
  289. * An optional description of this resource. Provide this property when you
  290. * create the resource.
  291. *
  292. * @var string
  293. */
  294. public $description;
  295. /**
  296. * [Output Only] The resource URL for the edge security policy associated with
  297. * this backend service.
  298. *
  299. * @var string
  300. */
  301. public $edgeSecurityPolicy;
  302. /**
  303. * If true, enables Cloud CDN for the backend service of a global external
  304. * Application Load Balancer.
  305. *
  306. * @var bool
  307. */
  308. public $enableCDN;
  309. /**
  310. * Specifies the canary migration state. Possible values are PREPARE,
  311. * TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC.
  312. *
  313. * To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be
  314. * changed to PREPARE. The state must be changed to TEST_ALL_TRAFFIC before
  315. * the loadBalancingScheme can be changed to EXTERNAL_MANAGED. Optionally, the
  316. * TEST_BY_PERCENTAGE state can be used to migrate traffic by percentage using
  317. * externalManagedMigrationTestingPercentage.
  318. *
  319. * Rolling back a migration requires the states to be set in reverse order. So
  320. * changing the scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to
  321. * be set to TEST_ALL_TRAFFIC at the same time. Optionally, the
  322. * TEST_BY_PERCENTAGE state can be used to migrate some traffic back to
  323. * EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL.
  324. *
  325. * @var string
  326. */
  327. public $externalManagedMigrationState;
  328. /**
  329. * Determines the fraction of requests that should be processed by the Global
  330. * external Application Load Balancer.
  331. *
  332. * The value of this field must be in the range [0, 100].
  333. *
  334. * Session affinity options will slightly affect this routing behavior, for
  335. * more details, see:Session Affinity.
  336. *
  337. * This value can only be set if the loadBalancingScheme in the BackendService
  338. * is set to EXTERNAL (when using the classic Application Load Balancer) and
  339. * the migration state is TEST_BY_PERCENTAGE.
  340. *
  341. * @var float
  342. */
  343. public $externalManagedMigrationTestingPercentage;
  344. protected $failoverPolicyType = BackendServiceFailoverPolicy::class;
  345. protected $failoverPolicyDataType = '';
  346. /**
  347. * Fingerprint of this resource. A hash of the contents stored in this object.
  348. * This field is used in optimistic locking. This field will be ignored when
  349. * inserting a BackendService. An up-to-date fingerprint must be provided in
  350. * order to update the BackendService, otherwise the request will fail with
  351. * error 412 conditionNotMet.
  352. *
  353. * To see the latest fingerprint, make a get() request to retrieve a
  354. * BackendService.
  355. *
  356. * @var string
  357. */
  358. public $fingerprint;
  359. protected $haPolicyType = BackendServiceHAPolicy::class;
  360. protected $haPolicyDataType = '';
  361. /**
  362. * The list of URLs to the healthChecks, httpHealthChecks (legacy), or
  363. * httpsHealthChecks (legacy) resource for health checking this backend
  364. * service. Not all backend services support legacy health checks. See Load
  365. * balancer guide. Currently, at most one health check can be specified for
  366. * each backend service. Backend services with instance group or zonal NEG
  367. * backends must have a health check unless haPolicy is specified. Backend
  368. * services with internet or serverless NEG backends must not have a health
  369. * check.
  370. *
  371. * healthChecks[] cannot be specified with haPolicy.
  372. *
  373. * @var string[]
  374. */
  375. public $healthChecks;
  376. protected $iapType = BackendServiceIAP::class;
  377. protected $iapDataType = '';
  378. /**
  379. * [Output Only] The unique identifier for the resource. This identifier is
  380. * defined by the server.
  381. *
  382. * @var string
  383. */
  384. public $id;
  385. /**
  386. * Specifies a preference for traffic sent from the proxy to the backend (or
  387. * from the client to the backend for proxyless gRPC). The possible values
  388. * are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the
  389. * backend service (Instance Group, Managed Instance Group, Network Endpoint
  390. * Group), regardless of traffic from the client to the proxy. Only IPv4
  391. * health checks are used to check the health of the backends. This is the
  392. * default setting. - PREFER_IPV6: Prioritize the connection to the
  393. * endpoint's IPv6 address over its IPv4 address (provided there is a
  394. * healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the
  395. * backends of the backend service (Instance Group, Managed Instance Group,
  396. * Network Endpoint Group), regardless of traffic from the client to the
  397. * proxy. Only IPv6 health checks are used to check the health of the
  398. * backends.
  399. *
  400. * This field is applicable to either: - Advanced global external
  401. * Application Load Balancer (load balancing scheme EXTERNAL_MANAGED),
  402. * - Regional external Application Load Balancer, - Internal proxy
  403. * Network Load Balancer (load balancing scheme INTERNAL_MANAGED), -
  404. * Regional internal Application Load Balancer (load balancing scheme
  405. * INTERNAL_MANAGED), - Traffic Director with Envoy proxies and
  406. * proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED).
  407. *
  408. * @var string
  409. */
  410. public $ipAddressSelectionPolicy;
  411. /**
  412. * Output only. [Output Only] Type of resource. Always compute#backendService
  413. * for backend services.
  414. *
  415. * @var string
  416. */
  417. public $kind;
  418. /**
  419. * Specifies the load balancer type. A backend service created for one type of
  420. * load balancer cannot be used with another. For more information, refer
  421. * toChoosing a load balancer.
  422. *
  423. * @var string
  424. */
  425. public $loadBalancingScheme;
  426. protected $localityLbPoliciesType = BackendServiceLocalityLoadBalancingPolicyConfig::class;
  427. protected $localityLbPoliciesDataType = 'array';
  428. /**
  429. * The load balancing algorithm used within the scope of the locality. The
  430. * possible values are: - ROUND_ROBIN: This is a simple policy in which
  431. * each healthy backend is selected in round robin order. This is the
  432. * default. - LEAST_REQUEST: An O(1) algorithm which selects two random
  433. * healthy hosts and picks the host which has fewer active requests. -
  434. * RING_HASH: The ring/modulo hash load balancer implements consistent
  435. * hashing to backends. The algorithm has the property that the
  436. * addition/removal of a host from a set of N hosts only affects 1/N of the
  437. * requests. - RANDOM: The load balancer selects a random healthy host.
  438. * - ORIGINAL_DESTINATION: Backend host is selected based on the client
  439. * connection metadata, i.e., connections are opened to the same address as
  440. * the destination address of the incoming connection before the connection
  441. * was redirected to the load balancer. - MAGLEV: used as a drop in
  442. * replacement for the ring hash load balancer. Maglev is not as stable as
  443. * ring hash but has faster table lookup build times and host selection
  444. * times. For more information about Maglev, see Maglev: A Fast and
  445. * Reliable Software Network Load Balancer. - WEIGHTED_ROUND_ROBIN: Per-
  446. * endpoint Weighted Round Robin Load Balancing using weights computed from
  447. * Backend reported Custom Metrics. If set, the Backend Service responses
  448. * are expected to contain non-standard HTTP response header field
  449. * Endpoint-Load-Metrics. The reported metrics to use for computing the
  450. * weights are specified via thecustomMetrics field. This field is
  451. * applicable to either: - A regional backend service with the
  452. * service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and
  453. * load_balancing_scheme set to INTERNAL_MANAGED. - A global
  454. * backend service with the load_balancing_scheme set to
  455. * INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED.
  456. * If sessionAffinity is not configured—that is, if session affinity
  457. * remains at the default value of NONE—then the default value for
  458. * localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value
  459. * other than NONE, then the default value for localityLbPolicy
  460. * isMAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the
  461. * backend service is referenced by a URL map that is bound to target gRPC
  462. * proxy that has validateForProxyless field set to true.
  463. * localityLbPolicy cannot be specified with haPolicy.
  464. *
  465. * @var string
  466. */
  467. public $localityLbPolicy;
  468. protected $logConfigType = BackendServiceLogConfig::class;
  469. protected $logConfigDataType = '';
  470. protected $maxStreamDurationType = Duration::class;
  471. protected $maxStreamDurationDataType = '';
  472. /**
  473. * Deployment metadata associated with the resource to be set by a GKE hub
  474. * controller and read by the backend RCTH
  475. *
  476. * @var string[]
  477. */
  478. public $metadatas;
  479. /**
  480. * Name of the resource. Provided by the client when the resource is created.
  481. * The name must be 1-63 characters long, and comply withRFC1035.
  482. * Specifically, the name must be 1-63 characters long and match the regular
  483. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  484. * must be a lowercase letter, and all following characters must be a dash,
  485. * lowercase letter, or digit, except the last character, which cannot be a
  486. * dash.
  487. *
  488. * @var string
  489. */
  490. public $name;
  491. /**
  492. * The URL of the network to which this backend service belongs.
  493. *
  494. * This field must be set for Internal Passthrough Network Load Balancers when
  495. * the haPolicy is enabled, and for External Passthrough Network Load
  496. * Balancers when the haPolicy fastIpMove is enabled.
  497. *
  498. * This field can only be specified when the load balancing scheme is set
  499. * toINTERNAL, or when the load balancing scheme is set toEXTERNAL and
  500. * haPolicy fastIpMove is enabled.
  501. *
  502. * @var string
  503. */
  504. public $network;
  505. protected $networkPassThroughLbTrafficPolicyType = BackendServiceNetworkPassThroughLbTrafficPolicy::class;
  506. protected $networkPassThroughLbTrafficPolicyDataType = '';
  507. protected $orchestrationInfoType = BackendServiceOrchestrationInfo::class;
  508. protected $orchestrationInfoDataType = '';
  509. protected $outlierDetectionType = OutlierDetection::class;
  510. protected $outlierDetectionDataType = '';
  511. protected $paramsType = BackendServiceParams::class;
  512. protected $paramsDataType = '';
  513. /**
  514. * Deprecated in favor of portName. The TCP port to connect on the backend.
  515. * The default value is 80. For internal passthrough Network Load Balancers
  516. * and external passthrough Network Load Balancers, omit port.
  517. *
  518. * @deprecated
  519. * @var int
  520. */
  521. public $port;
  522. /**
  523. * A named port on a backend instance group representing the port for
  524. * communication to the backend VMs in that group. The named port must be
  525. * [defined on each backend instance group](https://cloud.google.com/load-
  526. * balancing/docs/backend-service#named_ports). This parameter has no meaning
  527. * if the backends are NEGs. For internal passthrough Network Load Balancers
  528. * and external passthrough Network Load Balancers, omit port_name.
  529. *
  530. * @var string
  531. */
  532. public $portName;
  533. /**
  534. * The protocol this BackendService uses to communicate with backends.
  535. *
  536. * Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP or GRPC.
  537. * depending on the chosen load balancer or Traffic Director configuration.
  538. * Refer to the documentation for the load balancers or for Traffic Director
  539. * for more information.
  540. *
  541. * Must be set to GRPC when the backend service is referenced by a URL map
  542. * that is bound to target gRPC proxy.
  543. *
  544. * @var string
  545. */
  546. public $protocol;
  547. /**
  548. * Output only. [Output Only] URL of the region where the regional backend
  549. * service resides. This field is not applicable to global backend services.
  550. * You must specify this field as part of the HTTP request URL. It is not
  551. * settable as a field in the request body.
  552. *
  553. * @var string
  554. */
  555. public $region;
  556. /**
  557. * [Output Only] The resource URL for the security policy associated with this
  558. * backend service.
  559. *
  560. * @var string
  561. */
  562. public $securityPolicy;
  563. protected $securitySettingsType = SecuritySettings::class;
  564. protected $securitySettingsDataType = '';
  565. /**
  566. * [Output Only] Server-defined URL for the resource.
  567. *
  568. * @var string
  569. */
  570. public $selfLink;
  571. /**
  572. * URLs of networkservices.ServiceBinding resources.
  573. *
  574. * Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set,
  575. * lists of backends and health checks must be both empty.
  576. *
  577. * @var string[]
  578. */
  579. public $serviceBindings;
  580. /**
  581. * URL to networkservices.ServiceLbPolicy resource.
  582. *
  583. * Can only be set if load balancing scheme is EXTERNAL_MANAGED,
  584. * INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.
  585. *
  586. * @var string
  587. */
  588. public $serviceLbPolicy;
  589. /**
  590. * Type of session affinity to use. The default is NONE.
  591. *
  592. * Only NONE and HEADER_FIELD are supported when the backend service is
  593. * referenced by a URL map that is bound to target gRPC proxy that has
  594. * validateForProxyless field set to true.
  595. *
  596. * For more details, see: [Session Affinity](https://cloud.google.com/load-
  597. * balancing/docs/backend-service#session_affinity).
  598. *
  599. * sessionAffinity cannot be specified with haPolicy.
  600. *
  601. * @var string
  602. */
  603. public $sessionAffinity;
  604. protected $strongSessionAffinityCookieType = BackendServiceHttpCookie::class;
  605. protected $strongSessionAffinityCookieDataType = '';
  606. protected $subsettingType = Subsetting::class;
  607. protected $subsettingDataType = '';
  608. /**
  609. * The backend service timeout has a different meaning depending on the type
  610. * of load balancer. For more information see, Backend service settings. The
  611. * default is 30 seconds. The full range of timeout values allowed goes from 1
  612. * through 2,147,483,647 seconds.
  613. *
  614. * This value can be overridden in the PathMatcher configuration of the UrlMap
  615. * that references this backend service.
  616. *
  617. * Not supported when the backend service is referenced by a URL map that is
  618. * bound to target gRPC proxy that has validateForProxyless field set to true.
  619. * Instead, use maxStreamDuration.
  620. *
  621. * @var int
  622. */
  623. public $timeoutSec;
  624. protected $tlsSettingsType = BackendServiceTlsSettings::class;
  625. protected $tlsSettingsDataType = '';
  626. protected $usedByType = BackendServiceUsedBy::class;
  627. protected $usedByDataType = 'array';
  628. /**
  629. * Lifetime of cookies in seconds. This setting is applicable to Application
  630. * Load Balancers and Traffic Director and requires GENERATED_COOKIE or
  631. * HTTP_COOKIE session affinity.
  632. *
  633. * If set to 0, the cookie is non-persistent and lasts only until the end of
  634. * the browser session (or equivalent). The maximum allowed value is two weeks
  635. * (1,209,600).
  636. *
  637. * Not supported when the backend service is referenced by a URL map that is
  638. * bound to target gRPC proxy that has validateForProxyless field set to true.
  639. *
  640. * @param int $affinityCookieTtlSec
  641. */
  642. public function setAffinityCookieTtlSec($affinityCookieTtlSec)
  643. {
  644. $this->affinityCookieTtlSec = $affinityCookieTtlSec;
  645. }
  646. /**
  647. * @return int
  648. */
  649. public function getAffinityCookieTtlSec()
  650. {
  651. return $this->affinityCookieTtlSec;
  652. }
  653. /**
  654. * The list of backends that serve this BackendService.
  655. *
  656. * @param Backend[] $backends
  657. */
  658. public function setBackends($backends)
  659. {
  660. $this->backends = $backends;
  661. }
  662. /**
  663. * @return Backend[]
  664. */
  665. public function getBackends()
  666. {
  667. return $this->backends;
  668. }
  669. /**
  670. * Cloud CDN configuration for this BackendService. Only available for
  671. * specified load balancer types.
  672. *
  673. * @param BackendServiceCdnPolicy $cdnPolicy
  674. */
  675. public function setCdnPolicy(BackendServiceCdnPolicy $cdnPolicy)
  676. {
  677. $this->cdnPolicy = $cdnPolicy;
  678. }
  679. /**
  680. * @return BackendServiceCdnPolicy
  681. */
  682. public function getCdnPolicy()
  683. {
  684. return $this->cdnPolicy;
  685. }
  686. /**
  687. * @param CircuitBreakers $circuitBreakers
  688. */
  689. public function setCircuitBreakers(CircuitBreakers $circuitBreakers)
  690. {
  691. $this->circuitBreakers = $circuitBreakers;
  692. }
  693. /**
  694. * @return CircuitBreakers
  695. */
  696. public function getCircuitBreakers()
  697. {
  698. return $this->circuitBreakers;
  699. }
  700. /**
  701. * Compress text responses using Brotli or gzip compression, based on the
  702. * client's Accept-Encoding header.
  703. *
  704. * Accepted values: AUTOMATIC, DISABLED
  705. *
  706. * @param self::COMPRESSION_MODE_* $compressionMode
  707. */
  708. public function setCompressionMode($compressionMode)
  709. {
  710. $this->compressionMode = $compressionMode;
  711. }
  712. /**
  713. * @return self::COMPRESSION_MODE_*
  714. */
  715. public function getCompressionMode()
  716. {
  717. return $this->compressionMode;
  718. }
  719. /**
  720. * connectionDraining cannot be specified with haPolicy.
  721. *
  722. * @param ConnectionDraining $connectionDraining
  723. */
  724. public function setConnectionDraining(ConnectionDraining $connectionDraining)
  725. {
  726. $this->connectionDraining = $connectionDraining;
  727. }
  728. /**
  729. * @return ConnectionDraining
  730. */
  731. public function getConnectionDraining()
  732. {
  733. return $this->connectionDraining;
  734. }
  735. /**
  736. * Connection Tracking configuration for this BackendService. Connection
  737. * tracking policy settings are only available for external passthrough
  738. * Network Load Balancers and internal passthrough Network Load Balancers.
  739. *
  740. * connectionTrackingPolicy cannot be specified with haPolicy.
  741. *
  742. * @param BackendServiceConnectionTrackingPolicy $connectionTrackingPolicy
  743. */
  744. public function setConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy $connectionTrackingPolicy)
  745. {
  746. $this->connectionTrackingPolicy = $connectionTrackingPolicy;
  747. }
  748. /**
  749. * @return BackendServiceConnectionTrackingPolicy
  750. */
  751. public function getConnectionTrackingPolicy()
  752. {
  753. return $this->connectionTrackingPolicy;
  754. }
  755. /**
  756. * Consistent Hash-based load balancing can be used to provide soft session
  757. * affinity based on HTTP headers, cookies or other properties. This load
  758. * balancing policy is applicable only for HTTP connections. The affinity to a
  759. * particular destination host will be lost when one or more hosts are
  760. * added/removed from the destination service. This field specifies parameters
  761. * that control consistent hashing. This field is only applicable
  762. * whenlocalityLbPolicy is set to MAGLEV orRING_HASH.
  763. *
  764. * This field is applicable to either: - A regional backend service
  765. * with the service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and
  766. * load_balancing_scheme set to INTERNAL_MANAGED. - A global backend
  767. * service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.
  768. *
  769. * @param ConsistentHashLoadBalancerSettings $consistentHash
  770. */
  771. public function setConsistentHash(ConsistentHashLoadBalancerSettings $consistentHash)
  772. {
  773. $this->consistentHash = $consistentHash;
  774. }
  775. /**
  776. * @return ConsistentHashLoadBalancerSettings
  777. */
  778. public function getConsistentHash()
  779. {
  780. return $this->consistentHash;
  781. }
  782. /**
  783. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  784. *
  785. * @param string $creationTimestamp
  786. */
  787. public function setCreationTimestamp($creationTimestamp)
  788. {
  789. $this->creationTimestamp = $creationTimestamp;
  790. }
  791. /**
  792. * @return string
  793. */
  794. public function getCreationTimestamp()
  795. {
  796. return $this->creationTimestamp;
  797. }
  798. /**
  799. * List of custom metrics that are used for theWEIGHTED_ROUND_ROBIN
  800. * locality_lb_policy.
  801. *
  802. * @param BackendServiceCustomMetric[] $customMetrics
  803. */
  804. public function setCustomMetrics($customMetrics)
  805. {
  806. $this->customMetrics = $customMetrics;
  807. }
  808. /**
  809. * @return BackendServiceCustomMetric[]
  810. */
  811. public function getCustomMetrics()
  812. {
  813. return $this->customMetrics;
  814. }
  815. /**
  816. * Headers that the load balancer adds to proxied requests. See [Creating
  817. * custom headers](https://cloud.google.com/load-balancing/docs/custom-
  818. * headers).
  819. *
  820. * @param string[] $customRequestHeaders
  821. */
  822. public function setCustomRequestHeaders($customRequestHeaders)
  823. {
  824. $this->customRequestHeaders = $customRequestHeaders;
  825. }
  826. /**
  827. * @return string[]
  828. */
  829. public function getCustomRequestHeaders()
  830. {
  831. return $this->customRequestHeaders;
  832. }
  833. /**
  834. * Headers that the load balancer adds to proxied responses. See [Creating
  835. * custom headers](https://cloud.google.com/load-balancing/docs/custom-
  836. * headers).
  837. *
  838. * @param string[] $customResponseHeaders
  839. */
  840. public function setCustomResponseHeaders($customResponseHeaders)
  841. {
  842. $this->customResponseHeaders = $customResponseHeaders;
  843. }
  844. /**
  845. * @return string[]
  846. */
  847. public function getCustomResponseHeaders()
  848. {
  849. return $this->customResponseHeaders;
  850. }
  851. /**
  852. * An optional description of this resource. Provide this property when you
  853. * create the resource.
  854. *
  855. * @param string $description
  856. */
  857. public function setDescription($description)
  858. {
  859. $this->description = $description;
  860. }
  861. /**
  862. * @return string
  863. */
  864. public function getDescription()
  865. {
  866. return $this->description;
  867. }
  868. /**
  869. * [Output Only] The resource URL for the edge security policy associated with
  870. * this backend service.
  871. *
  872. * @param string $edgeSecurityPolicy
  873. */
  874. public function setEdgeSecurityPolicy($edgeSecurityPolicy)
  875. {
  876. $this->edgeSecurityPolicy = $edgeSecurityPolicy;
  877. }
  878. /**
  879. * @return string
  880. */
  881. public function getEdgeSecurityPolicy()
  882. {
  883. return $this->edgeSecurityPolicy;
  884. }
  885. /**
  886. * If true, enables Cloud CDN for the backend service of a global external
  887. * Application Load Balancer.
  888. *
  889. * @param bool $enableCDN
  890. */
  891. public function setEnableCDN($enableCDN)
  892. {
  893. $this->enableCDN = $enableCDN;
  894. }
  895. /**
  896. * @return bool
  897. */
  898. public function getEnableCDN()
  899. {
  900. return $this->enableCDN;
  901. }
  902. /**
  903. * Specifies the canary migration state. Possible values are PREPARE,
  904. * TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC.
  905. *
  906. * To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must be
  907. * changed to PREPARE. The state must be changed to TEST_ALL_TRAFFIC before
  908. * the loadBalancingScheme can be changed to EXTERNAL_MANAGED. Optionally, the
  909. * TEST_BY_PERCENTAGE state can be used to migrate traffic by percentage using
  910. * externalManagedMigrationTestingPercentage.
  911. *
  912. * Rolling back a migration requires the states to be set in reverse order. So
  913. * changing the scheme from EXTERNAL_MANAGED to EXTERNAL requires the state to
  914. * be set to TEST_ALL_TRAFFIC at the same time. Optionally, the
  915. * TEST_BY_PERCENTAGE state can be used to migrate some traffic back to
  916. * EXTERNAL or PREPARE can be used to migrate all traffic back to EXTERNAL.
  917. *
  918. * Accepted values: PREPARE, TEST_ALL_TRAFFIC, TEST_BY_PERCENTAGE
  919. *
  920. * @param self::EXTERNAL_MANAGED_MIGRATION_STATE_* $externalManagedMigrationState
  921. */
  922. public function setExternalManagedMigrationState($externalManagedMigrationState)
  923. {
  924. $this->externalManagedMigrationState = $externalManagedMigrationState;
  925. }
  926. /**
  927. * @return self::EXTERNAL_MANAGED_MIGRATION_STATE_*
  928. */
  929. public function getExternalManagedMigrationState()
  930. {
  931. return $this->externalManagedMigrationState;
  932. }
  933. /**
  934. * Determines the fraction of requests that should be processed by the Global
  935. * external Application Load Balancer.
  936. *
  937. * The value of this field must be in the range [0, 100].
  938. *
  939. * Session affinity options will slightly affect this routing behavior, for
  940. * more details, see:Session Affinity.
  941. *
  942. * This value can only be set if the loadBalancingScheme in the BackendService
  943. * is set to EXTERNAL (when using the classic Application Load Balancer) and
  944. * the migration state is TEST_BY_PERCENTAGE.
  945. *
  946. * @param float $externalManagedMigrationTestingPercentage
  947. */
  948. public function setExternalManagedMigrationTestingPercentage($externalManagedMigrationTestingPercentage)
  949. {
  950. $this->externalManagedMigrationTestingPercentage = $externalManagedMigrationTestingPercentage;
  951. }
  952. /**
  953. * @return float
  954. */
  955. public function getExternalManagedMigrationTestingPercentage()
  956. {
  957. return $this->externalManagedMigrationTestingPercentage;
  958. }
  959. /**
  960. * Requires at least one backend instance group to be defined as a backup
  961. * (failover) backend. For load balancers that have configurable failover:
  962. * [Internal passthrough Network Load
  963. * Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-
  964. * overview) and [external passthrough Network Load
  965. * Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-
  966. * failover-overview).
  967. *
  968. * failoverPolicy cannot be specified with haPolicy.
  969. *
  970. * @param BackendServiceFailoverPolicy $failoverPolicy
  971. */
  972. public function setFailoverPolicy(BackendServiceFailoverPolicy $failoverPolicy)
  973. {
  974. $this->failoverPolicy = $failoverPolicy;
  975. }
  976. /**
  977. * @return BackendServiceFailoverPolicy
  978. */
  979. public function getFailoverPolicy()
  980. {
  981. return $this->failoverPolicy;
  982. }
  983. /**
  984. * Fingerprint of this resource. A hash of the contents stored in this object.
  985. * This field is used in optimistic locking. This field will be ignored when
  986. * inserting a BackendService. An up-to-date fingerprint must be provided in
  987. * order to update the BackendService, otherwise the request will fail with
  988. * error 412 conditionNotMet.
  989. *
  990. * To see the latest fingerprint, make a get() request to retrieve a
  991. * BackendService.
  992. *
  993. * @param string $fingerprint
  994. */
  995. public function setFingerprint($fingerprint)
  996. {
  997. $this->fingerprint = $fingerprint;
  998. }
  999. /**
  1000. * @return string
  1001. */
  1002. public function getFingerprint()
  1003. {
  1004. return $this->fingerprint;
  1005. }
  1006. /**
  1007. * Configures self-managed High Availability (HA) for External and Internal
  1008. * Protocol Forwarding.
  1009. *
  1010. * The backends of this regional backend service must only specify zonal
  1011. * network endpoint groups (NEGs) of type GCE_VM_IP.
  1012. *
  1013. * When haPolicy is set for an Internal Passthrough Network Load Balancer, the
  1014. * regional backend service must set the network field. All zonal NEGs must
  1015. * belong to the same network. However, individual NEGs can belong to
  1016. * different subnetworks of that network.
  1017. *
  1018. * When haPolicy is specified, the set of attached network endpoints across
  1019. * all backends comprise an High Availability domain from which one endpoint
  1020. * is selected as the active endpoint (the leader) that receives all traffic.
  1021. *
  1022. * haPolicy can be added only at backend service creation time. Once set up,
  1023. * it cannot be deleted.
  1024. *
  1025. * Note that haPolicy is not for load balancing, and therefore cannot be
  1026. * specified with sessionAffinity, connectionTrackingPolicy, and
  1027. * failoverPolicy.
  1028. *
  1029. * haPolicy requires customers to be responsible for tracking backend endpoint
  1030. * health and electing a leader among the healthy endpoints. Therefore,
  1031. * haPolicy cannot be specified with healthChecks.
  1032. *
  1033. * haPolicy can only be specified for External Passthrough Network Load
  1034. * Balancers and Internal Passthrough Network Load Balancers.
  1035. *
  1036. * @param BackendServiceHAPolicy $haPolicy
  1037. */
  1038. public function setHaPolicy(BackendServiceHAPolicy $haPolicy)
  1039. {
  1040. $this->haPolicy = $haPolicy;
  1041. }
  1042. /**
  1043. * @return BackendServiceHAPolicy
  1044. */
  1045. public function getHaPolicy()
  1046. {
  1047. return $this->haPolicy;
  1048. }
  1049. /**
  1050. * The list of URLs to the healthChecks, httpHealthChecks (legacy), or
  1051. * httpsHealthChecks (legacy) resource for health checking this backend
  1052. * service. Not all backend services support legacy health checks. See Load
  1053. * balancer guide. Currently, at most one health check can be specified for
  1054. * each backend service. Backend services with instance group or zonal NEG
  1055. * backends must have a health check unless haPolicy is specified. Backend
  1056. * services with internet or serverless NEG backends must not have a health
  1057. * check.
  1058. *
  1059. * healthChecks[] cannot be specified with haPolicy.
  1060. *
  1061. * @param string[] $healthChecks
  1062. */
  1063. public function setHealthChecks($healthChecks)
  1064. {
  1065. $this->healthChecks = $healthChecks;
  1066. }
  1067. /**
  1068. * @return string[]
  1069. */
  1070. public function getHealthChecks()
  1071. {
  1072. return $this->healthChecks;
  1073. }
  1074. /**
  1075. * The configurations for Identity-Aware Proxy on this resource. Not available
  1076. * for internal passthrough Network Load Balancers and external passthrough
  1077. * Network Load Balancers.
  1078. *
  1079. * @param BackendServiceIAP $iap
  1080. */
  1081. public function setIap(BackendServiceIAP $iap)
  1082. {
  1083. $this->iap = $iap;
  1084. }
  1085. /**
  1086. * @return BackendServiceIAP
  1087. */
  1088. public function getIap()
  1089. {
  1090. return $this->iap;
  1091. }
  1092. /**
  1093. * [Output Only] The unique identifier for the resource. This identifier is
  1094. * defined by the server.
  1095. *
  1096. * @param string $id
  1097. */
  1098. public function setId($id)
  1099. {
  1100. $this->id = $id;
  1101. }
  1102. /**
  1103. * @return string
  1104. */
  1105. public function getId()
  1106. {
  1107. return $this->id;
  1108. }
  1109. /**
  1110. * Specifies a preference for traffic sent from the proxy to the backend (or
  1111. * from the client to the backend for proxyless gRPC). The possible values
  1112. * are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the
  1113. * backend service (Instance Group, Managed Instance Group, Network Endpoint
  1114. * Group), regardless of traffic from the client to the proxy. Only IPv4
  1115. * health checks are used to check the health of the backends. This is the
  1116. * default setting. - PREFER_IPV6: Prioritize the connection to the
  1117. * endpoint's IPv6 address over its IPv4 address (provided there is a
  1118. * healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the
  1119. * backends of the backend service (Instance Group, Managed Instance Group,
  1120. * Network Endpoint Group), regardless of traffic from the client to the
  1121. * proxy. Only IPv6 health checks are used to check the health of the
  1122. * backends.
  1123. *
  1124. * This field is applicable to either: - Advanced global external
  1125. * Application Load Balancer (load balancing scheme EXTERNAL_MANAGED),
  1126. * - Regional external Application Load Balancer, - Internal proxy
  1127. * Network Load Balancer (load balancing scheme INTERNAL_MANAGED), -
  1128. * Regional internal Application Load Balancer (load balancing scheme
  1129. * INTERNAL_MANAGED), - Traffic Director with Envoy proxies and
  1130. * proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED).
  1131. *
  1132. * Accepted values: IPV4_ONLY, IPV6_ONLY,
  1133. * IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED, PREFER_IPV6
  1134. *
  1135. * @param self::IP_ADDRESS_SELECTION_POLICY_* $ipAddressSelectionPolicy
  1136. */
  1137. public function setIpAddressSelectionPolicy($ipAddressSelectionPolicy)
  1138. {
  1139. $this->ipAddressSelectionPolicy = $ipAddressSelectionPolicy;
  1140. }
  1141. /**
  1142. * @return self::IP_ADDRESS_SELECTION_POLICY_*
  1143. */
  1144. public function getIpAddressSelectionPolicy()
  1145. {
  1146. return $this->ipAddressSelectionPolicy;
  1147. }
  1148. /**
  1149. * Output only. [Output Only] Type of resource. Always compute#backendService
  1150. * for backend services.
  1151. *
  1152. * @param string $kind
  1153. */
  1154. public function setKind($kind)
  1155. {
  1156. $this->kind = $kind;
  1157. }
  1158. /**
  1159. * @return string
  1160. */
  1161. public function getKind()
  1162. {
  1163. return $this->kind;
  1164. }
  1165. /**
  1166. * Specifies the load balancer type. A backend service created for one type of
  1167. * load balancer cannot be used with another. For more information, refer
  1168. * toChoosing a load balancer.
  1169. *
  1170. * Accepted values: EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_MANAGED,
  1171. * INTERNAL_SELF_MANAGED, INVALID_LOAD_BALANCING_SCHEME
  1172. *
  1173. * @param self::LOAD_BALANCING_SCHEME_* $loadBalancingScheme
  1174. */
  1175. public function setLoadBalancingScheme($loadBalancingScheme)
  1176. {
  1177. $this->loadBalancingScheme = $loadBalancingScheme;
  1178. }
  1179. /**
  1180. * @return self::LOAD_BALANCING_SCHEME_*
  1181. */
  1182. public function getLoadBalancingScheme()
  1183. {
  1184. return $this->loadBalancingScheme;
  1185. }
  1186. /**
  1187. * A list of locality load-balancing policies to be used in order of
  1188. * preference. When you use localityLbPolicies, you must set at least one
  1189. * value for either the localityLbPolicies[].policy or the
  1190. * localityLbPolicies[].customPolicy field. localityLbPolicies overrides any
  1191. * value set in the localityLbPolicy field.
  1192. *
  1193. * For an example of how to use this field, seeDefine a list of preferred
  1194. * policies.
  1195. *
  1196. * Caution: This field and its children are intended for use in a service mesh
  1197. * that includes gRPC clients only. Envoy proxies can't use backend services
  1198. * that have this configuration.
  1199. *
  1200. * @param BackendServiceLocalityLoadBalancingPolicyConfig[] $localityLbPolicies
  1201. */
  1202. public function setLocalityLbPolicies($localityLbPolicies)
  1203. {
  1204. $this->localityLbPolicies = $localityLbPolicies;
  1205. }
  1206. /**
  1207. * @return BackendServiceLocalityLoadBalancingPolicyConfig[]
  1208. */
  1209. public function getLocalityLbPolicies()
  1210. {
  1211. return $this->localityLbPolicies;
  1212. }
  1213. /**
  1214. * The load balancing algorithm used within the scope of the locality. The
  1215. * possible values are: - ROUND_ROBIN: This is a simple policy in which
  1216. * each healthy backend is selected in round robin order. This is the
  1217. * default. - LEAST_REQUEST: An O(1) algorithm which selects two random
  1218. * healthy hosts and picks the host which has fewer active requests. -
  1219. * RING_HASH: The ring/modulo hash load balancer implements consistent
  1220. * hashing to backends. The algorithm has the property that the
  1221. * addition/removal of a host from a set of N hosts only affects 1/N of the
  1222. * requests. - RANDOM: The load balancer selects a random healthy host.
  1223. * - ORIGINAL_DESTINATION: Backend host is selected based on the client
  1224. * connection metadata, i.e., connections are opened to the same address as
  1225. * the destination address of the incoming connection before the connection
  1226. * was redirected to the load balancer. - MAGLEV: used as a drop in
  1227. * replacement for the ring hash load balancer. Maglev is not as stable as
  1228. * ring hash but has faster table lookup build times and host selection
  1229. * times. For more information about Maglev, see Maglev: A Fast and
  1230. * Reliable Software Network Load Balancer. - WEIGHTED_ROUND_ROBIN: Per-
  1231. * endpoint Weighted Round Robin Load Balancing using weights computed from
  1232. * Backend reported Custom Metrics. If set, the Backend Service responses
  1233. * are expected to contain non-standard HTTP response header field
  1234. * Endpoint-Load-Metrics. The reported metrics to use for computing the
  1235. * weights are specified via thecustomMetrics field. This field is
  1236. * applicable to either: - A regional backend service with the
  1237. * service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and
  1238. * load_balancing_scheme set to INTERNAL_MANAGED. - A global
  1239. * backend service with the load_balancing_scheme set to
  1240. * INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED.
  1241. * If sessionAffinity is not configured—that is, if session affinity
  1242. * remains at the default value of NONE—then the default value for
  1243. * localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value
  1244. * other than NONE, then the default value for localityLbPolicy
  1245. * isMAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the
  1246. * backend service is referenced by a URL map that is bound to target gRPC
  1247. * proxy that has validateForProxyless field set to true.
  1248. * localityLbPolicy cannot be specified with haPolicy.
  1249. *
  1250. * Accepted values: INVALID_LB_POLICY, LEAST_REQUEST, MAGLEV,
  1251. * ORIGINAL_DESTINATION, RANDOM, RING_HASH, ROUND_ROBIN,
  1252. * WEIGHTED_GCP_RENDEZVOUS, WEIGHTED_MAGLEV, WEIGHTED_ROUND_ROBIN
  1253. *
  1254. * @param self::LOCALITY_LB_POLICY_* $localityLbPolicy
  1255. */
  1256. public function setLocalityLbPolicy($localityLbPolicy)
  1257. {
  1258. $this->localityLbPolicy = $localityLbPolicy;
  1259. }
  1260. /**
  1261. * @return self::LOCALITY_LB_POLICY_*
  1262. */
  1263. public function getLocalityLbPolicy()
  1264. {
  1265. return $this->localityLbPolicy;
  1266. }
  1267. /**
  1268. * This field denotes the logging options for the load balancer traffic served
  1269. * by this backend service. If logging is enabled, logs will be exported to
  1270. * Stackdriver.
  1271. *
  1272. * @param BackendServiceLogConfig $logConfig
  1273. */
  1274. public function setLogConfig(BackendServiceLogConfig $logConfig)
  1275. {
  1276. $this->logConfig = $logConfig;
  1277. }
  1278. /**
  1279. * @return BackendServiceLogConfig
  1280. */
  1281. public function getLogConfig()
  1282. {
  1283. return $this->logConfig;
  1284. }
  1285. /**
  1286. * Specifies the default maximum duration (timeout) for streams to this
  1287. * service. Duration is computed from the beginning of the stream until the
  1288. * response has been completely processed, including all retries. A stream
  1289. * that does not complete in this duration is closed.
  1290. *
  1291. * If not specified, there will be no timeout limit, i.e. the maximum duration
  1292. * is infinite.
  1293. *
  1294. * This value can be overridden in the PathMatcher configuration of the UrlMap
  1295. * that references this backend service.
  1296. *
  1297. * This field is only allowed when the loadBalancingScheme of the backend
  1298. * service is INTERNAL_SELF_MANAGED.
  1299. *
  1300. * @param Duration $maxStreamDuration
  1301. */
  1302. public function setMaxStreamDuration(Duration $maxStreamDuration)
  1303. {
  1304. $this->maxStreamDuration = $maxStreamDuration;
  1305. }
  1306. /**
  1307. * @return Duration
  1308. */
  1309. public function getMaxStreamDuration()
  1310. {
  1311. return $this->maxStreamDuration;
  1312. }
  1313. /**
  1314. * Deployment metadata associated with the resource to be set by a GKE hub
  1315. * controller and read by the backend RCTH
  1316. *
  1317. * @param string[] $metadatas
  1318. */
  1319. public function setMetadatas($metadatas)
  1320. {
  1321. $this->metadatas = $metadatas;
  1322. }
  1323. /**
  1324. * @return string[]
  1325. */
  1326. public function getMetadatas()
  1327. {
  1328. return $this->metadatas;
  1329. }
  1330. /**
  1331. * Name of the resource. Provided by the client when the resource is created.
  1332. * The name must be 1-63 characters long, and comply withRFC1035.
  1333. * Specifically, the name must be 1-63 characters long and match the regular
  1334. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  1335. * must be a lowercase letter, and all following characters must be a dash,
  1336. * lowercase letter, or digit, except the last character, which cannot be a
  1337. * dash.
  1338. *
  1339. * @param string $name
  1340. */
  1341. public function setName($name)
  1342. {
  1343. $this->name = $name;
  1344. }
  1345. /**
  1346. * @return string
  1347. */
  1348. public function getName()
  1349. {
  1350. return $this->name;
  1351. }
  1352. /**
  1353. * The URL of the network to which this backend service belongs.
  1354. *
  1355. * This field must be set for Internal Passthrough Network Load Balancers when
  1356. * the haPolicy is enabled, and for External Passthrough Network Load
  1357. * Balancers when the haPolicy fastIpMove is enabled.
  1358. *
  1359. * This field can only be specified when the load balancing scheme is set
  1360. * toINTERNAL, or when the load balancing scheme is set toEXTERNAL and
  1361. * haPolicy fastIpMove is enabled.
  1362. *
  1363. * @param string $network
  1364. */
  1365. public function setNetwork($network)
  1366. {
  1367. $this->network = $network;
  1368. }
  1369. /**
  1370. * @return string
  1371. */
  1372. public function getNetwork()
  1373. {
  1374. return $this->network;
  1375. }
  1376. /**
  1377. * Configures traffic steering properties of internal passthrough Network Load
  1378. * Balancers.
  1379. *
  1380. * networkPassThroughLbTrafficPolicy cannot be specified with haPolicy.
  1381. *
  1382. * @param BackendServiceNetworkPassThroughLbTrafficPolicy $networkPassThroughLbTrafficPolicy
  1383. */
  1384. public function setNetworkPassThroughLbTrafficPolicy(BackendServiceNetworkPassThroughLbTrafficPolicy $networkPassThroughLbTrafficPolicy)
  1385. {
  1386. $this->networkPassThroughLbTrafficPolicy = $networkPassThroughLbTrafficPolicy;
  1387. }
  1388. /**
  1389. * @return BackendServiceNetworkPassThroughLbTrafficPolicy
  1390. */
  1391. public function getNetworkPassThroughLbTrafficPolicy()
  1392. {
  1393. return $this->networkPassThroughLbTrafficPolicy;
  1394. }
  1395. /**
  1396. * Information about the resource or system that manages the backend service.
  1397. *
  1398. * @param BackendServiceOrchestrationInfo $orchestrationInfo
  1399. */
  1400. public function setOrchestrationInfo(BackendServiceOrchestrationInfo $orchestrationInfo)
  1401. {
  1402. $this->orchestrationInfo = $orchestrationInfo;
  1403. }
  1404. /**
  1405. * @return BackendServiceOrchestrationInfo
  1406. */
  1407. public function getOrchestrationInfo()
  1408. {
  1409. return $this->orchestrationInfo;
  1410. }
  1411. /**
  1412. * Settings controlling the ejection of unhealthy backend endpoints from the
  1413. * load balancing pool of each individual proxy instance that processes the
  1414. * traffic for the given backend service. If not set, this feature is
  1415. * considered disabled.
  1416. *
  1417. * Results of the outlier detection algorithm (ejection of endpoints from the
  1418. * load balancing pool and returning them back to the pool) are executed
  1419. * independently by each proxy instance of the load balancer. In most cases,
  1420. * more than one proxy instance handles the traffic received by a backend
  1421. * service. Thus, it is possible that an unhealthy endpoint is detected and
  1422. * ejected by only some of the proxies, and while this happens, other proxies
  1423. * may continue to send requests to the same unhealthy endpoint until they
  1424. * detect and eject the unhealthy endpoint.
  1425. *
  1426. * Applicable backend endpoints can be: - VM instances in an Instance
  1427. * Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) -
  1428. * Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) -
  1429. * Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud
  1430. * Functions Services - Private Service Connect NEGs, that resolve to
  1431. * Google-managed regional API endpoints or managed services published using
  1432. * Private Service Connect
  1433. *
  1434. * Applicable backend service types can be: - A global backend service
  1435. * with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or
  1436. * EXTERNAL_MANAGED. - A regional backend service with the
  1437. * serviceProtocol set to HTTP, HTTPS, HTTP2 or H2C, and
  1438. * loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not
  1439. * supported for Serverless NEGs.
  1440. *
  1441. * Not supported when the backend service is referenced by a URL map that is
  1442. * bound to target gRPC proxy that has validateForProxyless field set to true.
  1443. *
  1444. * @param OutlierDetection $outlierDetection
  1445. */
  1446. public function setOutlierDetection(OutlierDetection $outlierDetection)
  1447. {
  1448. $this->outlierDetection = $outlierDetection;
  1449. }
  1450. /**
  1451. * @return OutlierDetection
  1452. */
  1453. public function getOutlierDetection()
  1454. {
  1455. return $this->outlierDetection;
  1456. }
  1457. /**
  1458. * Input only. [Input Only] Additional params passed with the request, but not
  1459. * persisted as part of resource payload.
  1460. *
  1461. * @param BackendServiceParams $params
  1462. */
  1463. public function setParams(BackendServiceParams $params)
  1464. {
  1465. $this->params = $params;
  1466. }
  1467. /**
  1468. * @return BackendServiceParams
  1469. */
  1470. public function getParams()
  1471. {
  1472. return $this->params;
  1473. }
  1474. /**
  1475. * Deprecated in favor of portName. The TCP port to connect on the backend.
  1476. * The default value is 80. For internal passthrough Network Load Balancers
  1477. * and external passthrough Network Load Balancers, omit port.
  1478. *
  1479. * @deprecated
  1480. * @param int $port
  1481. */
  1482. public function setPort($port)
  1483. {
  1484. $this->port = $port;
  1485. }
  1486. /**
  1487. * @deprecated
  1488. * @return int
  1489. */
  1490. public function getPort()
  1491. {
  1492. return $this->port;
  1493. }
  1494. /**
  1495. * A named port on a backend instance group representing the port for
  1496. * communication to the backend VMs in that group. The named port must be
  1497. * [defined on each backend instance group](https://cloud.google.com/load-
  1498. * balancing/docs/backend-service#named_ports). This parameter has no meaning
  1499. * if the backends are NEGs. For internal passthrough Network Load Balancers
  1500. * and external passthrough Network Load Balancers, omit port_name.
  1501. *
  1502. * @param string $portName
  1503. */
  1504. public function setPortName($portName)
  1505. {
  1506. $this->portName = $portName;
  1507. }
  1508. /**
  1509. * @return string
  1510. */
  1511. public function getPortName()
  1512. {
  1513. return $this->portName;
  1514. }
  1515. /**
  1516. * The protocol this BackendService uses to communicate with backends.
  1517. *
  1518. * Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP or GRPC.
  1519. * depending on the chosen load balancer or Traffic Director configuration.
  1520. * Refer to the documentation for the load balancers or for Traffic Director
  1521. * for more information.
  1522. *
  1523. * Must be set to GRPC when the backend service is referenced by a URL map
  1524. * that is bound to target gRPC proxy.
  1525. *
  1526. * Accepted values: GRPC, H2C, HTTP, HTTP2, HTTPS, SSL, TCP, UDP, UNSPECIFIED
  1527. *
  1528. * @param self::PROTOCOL_* $protocol
  1529. */
  1530. public function setProtocol($protocol)
  1531. {
  1532. $this->protocol = $protocol;
  1533. }
  1534. /**
  1535. * @return self::PROTOCOL_*
  1536. */
  1537. public function getProtocol()
  1538. {
  1539. return $this->protocol;
  1540. }
  1541. /**
  1542. * Output only. [Output Only] URL of the region where the regional backend
  1543. * service resides. This field is not applicable to global backend services.
  1544. * You must specify this field as part of the HTTP request URL. It is not
  1545. * settable as a field in the request body.
  1546. *
  1547. * @param string $region
  1548. */
  1549. public function setRegion($region)
  1550. {
  1551. $this->region = $region;
  1552. }
  1553. /**
  1554. * @return string
  1555. */
  1556. public function getRegion()
  1557. {
  1558. return $this->region;
  1559. }
  1560. /**
  1561. * [Output Only] The resource URL for the security policy associated with this
  1562. * backend service.
  1563. *
  1564. * @param string $securityPolicy
  1565. */
  1566. public function setSecurityPolicy($securityPolicy)
  1567. {
  1568. $this->securityPolicy = $securityPolicy;
  1569. }
  1570. /**
  1571. * @return string
  1572. */
  1573. public function getSecurityPolicy()
  1574. {
  1575. return $this->securityPolicy;
  1576. }
  1577. /**
  1578. * This field specifies the security settings that apply to this backend
  1579. * service. This field is applicable to a global backend service with the
  1580. * load_balancing_scheme set to INTERNAL_SELF_MANAGED.
  1581. *
  1582. * @param SecuritySettings $securitySettings
  1583. */
  1584. public function setSecuritySettings(SecuritySettings $securitySettings)
  1585. {
  1586. $this->securitySettings = $securitySettings;
  1587. }
  1588. /**
  1589. * @return SecuritySettings
  1590. */
  1591. public function getSecuritySettings()
  1592. {
  1593. return $this->securitySettings;
  1594. }
  1595. /**
  1596. * [Output Only] Server-defined URL for the resource.
  1597. *
  1598. * @param string $selfLink
  1599. */
  1600. public function setSelfLink($selfLink)
  1601. {
  1602. $this->selfLink = $selfLink;
  1603. }
  1604. /**
  1605. * @return string
  1606. */
  1607. public function getSelfLink()
  1608. {
  1609. return $this->selfLink;
  1610. }
  1611. /**
  1612. * URLs of networkservices.ServiceBinding resources.
  1613. *
  1614. * Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set,
  1615. * lists of backends and health checks must be both empty.
  1616. *
  1617. * @param string[] $serviceBindings
  1618. */
  1619. public function setServiceBindings($serviceBindings)
  1620. {
  1621. $this->serviceBindings = $serviceBindings;
  1622. }
  1623. /**
  1624. * @return string[]
  1625. */
  1626. public function getServiceBindings()
  1627. {
  1628. return $this->serviceBindings;
  1629. }
  1630. /**
  1631. * URL to networkservices.ServiceLbPolicy resource.
  1632. *
  1633. * Can only be set if load balancing scheme is EXTERNAL_MANAGED,
  1634. * INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.
  1635. *
  1636. * @param string $serviceLbPolicy
  1637. */
  1638. public function setServiceLbPolicy($serviceLbPolicy)
  1639. {
  1640. $this->serviceLbPolicy = $serviceLbPolicy;
  1641. }
  1642. /**
  1643. * @return string
  1644. */
  1645. public function getServiceLbPolicy()
  1646. {
  1647. return $this->serviceLbPolicy;
  1648. }
  1649. /**
  1650. * Type of session affinity to use. The default is NONE.
  1651. *
  1652. * Only NONE and HEADER_FIELD are supported when the backend service is
  1653. * referenced by a URL map that is bound to target gRPC proxy that has
  1654. * validateForProxyless field set to true.
  1655. *
  1656. * For more details, see: [Session Affinity](https://cloud.google.com/load-
  1657. * balancing/docs/backend-service#session_affinity).
  1658. *
  1659. * sessionAffinity cannot be specified with haPolicy.
  1660. *
  1661. * Accepted values: CLIENT_IP, CLIENT_IP_NO_DESTINATION, CLIENT_IP_PORT_PROTO,
  1662. * CLIENT_IP_PROTO, GENERATED_COOKIE, HEADER_FIELD, HTTP_COOKIE, NONE,
  1663. * STRONG_COOKIE_AFFINITY
  1664. *
  1665. * @param self::SESSION_AFFINITY_* $sessionAffinity
  1666. */
  1667. public function setSessionAffinity($sessionAffinity)
  1668. {
  1669. $this->sessionAffinity = $sessionAffinity;
  1670. }
  1671. /**
  1672. * @return self::SESSION_AFFINITY_*
  1673. */
  1674. public function getSessionAffinity()
  1675. {
  1676. return $this->sessionAffinity;
  1677. }
  1678. /**
  1679. * Describes the HTTP cookie used for stateful session affinity. This field is
  1680. * applicable and required if the sessionAffinity is set
  1681. * toSTRONG_COOKIE_AFFINITY.
  1682. *
  1683. * @param BackendServiceHttpCookie $strongSessionAffinityCookie
  1684. */
  1685. public function setStrongSessionAffinityCookie(BackendServiceHttpCookie $strongSessionAffinityCookie)
  1686. {
  1687. $this->strongSessionAffinityCookie = $strongSessionAffinityCookie;
  1688. }
  1689. /**
  1690. * @return BackendServiceHttpCookie
  1691. */
  1692. public function getStrongSessionAffinityCookie()
  1693. {
  1694. return $this->strongSessionAffinityCookie;
  1695. }
  1696. /**
  1697. * subsetting cannot be specified with haPolicy.
  1698. *
  1699. * @param Subsetting $subsetting
  1700. */
  1701. public function setSubsetting(Subsetting $subsetting)
  1702. {
  1703. $this->subsetting = $subsetting;
  1704. }
  1705. /**
  1706. * @return Subsetting
  1707. */
  1708. public function getSubsetting()
  1709. {
  1710. return $this->subsetting;
  1711. }
  1712. /**
  1713. * The backend service timeout has a different meaning depending on the type
  1714. * of load balancer. For more information see, Backend service settings. The
  1715. * default is 30 seconds. The full range of timeout values allowed goes from 1
  1716. * through 2,147,483,647 seconds.
  1717. *
  1718. * This value can be overridden in the PathMatcher configuration of the UrlMap
  1719. * that references this backend service.
  1720. *
  1721. * Not supported when the backend service is referenced by a URL map that is
  1722. * bound to target gRPC proxy that has validateForProxyless field set to true.
  1723. * Instead, use maxStreamDuration.
  1724. *
  1725. * @param int $timeoutSec
  1726. */
  1727. public function setTimeoutSec($timeoutSec)
  1728. {
  1729. $this->timeoutSec = $timeoutSec;
  1730. }
  1731. /**
  1732. * @return int
  1733. */
  1734. public function getTimeoutSec()
  1735. {
  1736. return $this->timeoutSec;
  1737. }
  1738. /**
  1739. * Configuration for Backend Authenticated TLS and mTLS. May only be specified
  1740. * when the backend protocol is SSL, HTTPS or HTTP2.
  1741. *
  1742. * @param BackendServiceTlsSettings $tlsSettings
  1743. */
  1744. public function setTlsSettings(BackendServiceTlsSettings $tlsSettings)
  1745. {
  1746. $this->tlsSettings = $tlsSettings;
  1747. }
  1748. /**
  1749. * @return BackendServiceTlsSettings
  1750. */
  1751. public function getTlsSettings()
  1752. {
  1753. return $this->tlsSettings;
  1754. }
  1755. /**
  1756. * Output only. [Output Only] List of resources referencing given backend
  1757. * service.
  1758. *
  1759. * @param BackendServiceUsedBy[] $usedBy
  1760. */
  1761. public function setUsedBy($usedBy)
  1762. {
  1763. $this->usedBy = $usedBy;
  1764. }
  1765. /**
  1766. * @return BackendServiceUsedBy[]
  1767. */
  1768. public function getUsedBy()
  1769. {
  1770. return $this->usedBy;
  1771. }
  1772. }
  1773. // Adding a class alias for backwards compatibility with the previous class name.
  1774. class_alias(BackendService::class, 'Google_Service_Compute_BackendService');