BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 BackendServiceLocalityLoadBalancingPolicyConfigPolicy extends \Google\Model
  19. {
  20. public const NAME_INVALID_LB_POLICY = 'INVALID_LB_POLICY';
  21. /**
  22. * An O(1) algorithm which selects two random healthy hosts and picks the host
  23. * which has fewer active requests.
  24. */
  25. public const NAME_LEAST_REQUEST = 'LEAST_REQUEST';
  26. /**
  27. * This algorithm implements consistent hashing to backends. Maglev can be
  28. * used as a drop in replacement for the ring hash load balancer. Maglev is
  29. * not as stable as ring hash but has faster table lookup build times and host
  30. * selection times. For more information about Maglev, seeMaglev: A Fast and
  31. * Reliable Software Network Load Balancer.
  32. */
  33. public const NAME_MAGLEV = 'MAGLEV';
  34. /**
  35. * Backend host is selected based on the client connection metadata, i.e.,
  36. * connections are opened to the same address as the destination address of
  37. * the incoming connection before the connection was redirected to the load
  38. * balancer.
  39. */
  40. public const NAME_ORIGINAL_DESTINATION = 'ORIGINAL_DESTINATION';
  41. /**
  42. * The load balancer selects a random healthy host.
  43. */
  44. public const NAME_RANDOM = 'RANDOM';
  45. /**
  46. * The ring/modulo hash load balancer implements consistent hashing to
  47. * backends. The algorithm has the property that the addition/removal of a
  48. * host from a set of N hosts only affects 1/N of the requests.
  49. */
  50. public const NAME_RING_HASH = 'RING_HASH';
  51. /**
  52. * This is a simple policy in which each healthy backend is selected in round
  53. * robin order. This is the default.
  54. */
  55. public const NAME_ROUND_ROBIN = 'ROUND_ROBIN';
  56. /**
  57. * Per-instance weighted Load Balancing via health check reported weights. In
  58. * internal passthrough network load balancing, it is weighted rendezvous
  59. * hashing. This option is only supported in internal passthrough network load
  60. * balancing.
  61. */
  62. public const NAME_WEIGHTED_GCP_RENDEZVOUS = 'WEIGHTED_GCP_RENDEZVOUS';
  63. /**
  64. * Per-instance weighted Load Balancing via health check reported weights. If
  65. * set, the Backend Service must configure a non legacy HTTP-based Health
  66. * Check, and health check replies are expected to contain non-standard HTTP
  67. * response header field X-Load-Balancing-Endpoint-Weight to specify the per-
  68. * instance weights. If set, Load Balancing is weighted based on the per-
  69. * instance weights reported in the last processed health check replies, as
  70. * long as every instance either reported a valid weight or had
  71. * UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This
  72. * option is only supported in Network Load Balancing.
  73. */
  74. public const NAME_WEIGHTED_MAGLEV = 'WEIGHTED_MAGLEV';
  75. /**
  76. * Per-endpoint weighted round-robin Load Balancing using weights computed
  77. * from Backend reported Custom Metrics. If set, the Backend Service responses
  78. * are expected to contain non-standard HTTP response header field Endpoint-
  79. * Load-Metrics. The reported metrics to use for computing the weights are
  80. * specified via the customMetrics fields.
  81. */
  82. public const NAME_WEIGHTED_ROUND_ROBIN = 'WEIGHTED_ROUND_ROBIN';
  83. /**
  84. * The name of a locality load-balancing policy. Valid values include
  85. * ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about
  86. * these values, see the description of localityLbPolicy.
  87. *
  88. * Do not specify the same policy more than once for a backend. If you do, the
  89. * configuration is rejected.
  90. *
  91. * @var string
  92. */
  93. public $name;
  94. /**
  95. * The name of a locality load-balancing policy. Valid values include
  96. * ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about
  97. * these values, see the description of localityLbPolicy.
  98. *
  99. * Do not specify the same policy more than once for a backend. If you do, the
  100. * configuration is rejected.
  101. *
  102. * Accepted values: INVALID_LB_POLICY, LEAST_REQUEST, MAGLEV,
  103. * ORIGINAL_DESTINATION, RANDOM, RING_HASH, ROUND_ROBIN,
  104. * WEIGHTED_GCP_RENDEZVOUS, WEIGHTED_MAGLEV, WEIGHTED_ROUND_ROBIN
  105. *
  106. * @param self::NAME_* $name
  107. */
  108. public function setName($name)
  109. {
  110. $this->name = $name;
  111. }
  112. /**
  113. * @return self::NAME_*
  114. */
  115. public function getName()
  116. {
  117. return $this->name;
  118. }
  119. }
  120. // Adding a class alias for backwards compatibility with the previous class name.
  121. class_alias(BackendServiceLocalityLoadBalancingPolicyConfigPolicy::class, 'Google_Service_Compute_BackendServiceLocalityLoadBalancingPolicyConfigPolicy');