HTTP2HealthCheck.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 HTTP2HealthCheck extends \Google\Model
  19. {
  20. /**
  21. * The port number in the health check's port is used for health checking.
  22. * Applies to network endpoint group and instance group backends.
  23. */
  24. public const PORT_SPECIFICATION_USE_FIXED_PORT = 'USE_FIXED_PORT';
  25. /**
  26. * Not supported.
  27. */
  28. public const PORT_SPECIFICATION_USE_NAMED_PORT = 'USE_NAMED_PORT';
  29. /**
  30. * For network endpoint group backends, the health check uses the port number
  31. * specified on each endpoint in the network endpoint group. For instance
  32. * group backends, the health check uses the port number specified for the
  33. * backend service's named port defined in the instance group's named ports.
  34. */
  35. public const PORT_SPECIFICATION_USE_SERVING_PORT = 'USE_SERVING_PORT';
  36. public const PROXY_HEADER_NONE = 'NONE';
  37. public const PROXY_HEADER_PROXY_V1 = 'PROXY_V1';
  38. /**
  39. * The value of the host header in the HTTP/2 health check request. If left
  40. * empty (default value), the host header is set to the destination IP address
  41. * to which health check packets are sent. The destination IP address depends
  42. * on the type of load balancer. For details, see:
  43. * https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-
  44. * packet-dest
  45. *
  46. * @var string
  47. */
  48. public $host;
  49. /**
  50. * The TCP port number to which the health check prober sends packets. The
  51. * default value is 443. Valid values are 1 through65535.
  52. *
  53. * @var int
  54. */
  55. public $port;
  56. /**
  57. * Not supported.
  58. *
  59. * @var string
  60. */
  61. public $portName;
  62. /**
  63. * Specifies how a port is selected for health checking. Can be one of the
  64. * following values: USE_FIXED_PORT: Specifies a port number explicitly using
  65. * theport field in the health check. Supported by backend services for
  66. * passthrough load balancers and backend services for proxy load balancers.
  67. * Not supported by target pools. The health check supports all backends
  68. * supported by the backend service provided the backend can be health
  69. * checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
  70. * network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
  71. * supported. USE_SERVING_PORT: Provides an indirect method of specifying the
  72. * health check port by referring to the backend service. Only supported by
  73. * backend services for proxy load balancers. Not supported by target pools.
  74. * Not supported by backend services for passthrough load balancers. Supports
  75. * all backends that can be health checked; for example,GCE_VM_IP_PORT network
  76. * endpoint groups and instance group backends.
  77. *
  78. * For GCE_VM_IP_PORT network endpoint group backends, the health check uses
  79. * the port number specified for each endpoint in the network endpoint group.
  80. * For instance group backends, the health check uses the port number
  81. * determined by looking up the backend service's named port in the instance
  82. * group's list of named ports.
  83. *
  84. * @var string
  85. */
  86. public $portSpecification;
  87. /**
  88. * Specifies the type of proxy header to append before sending data to the
  89. * backend, either NONE or PROXY_V1. The default is NONE.
  90. *
  91. * @var string
  92. */
  93. public $proxyHeader;
  94. /**
  95. * The request path of the HTTP/2 health check request. The default value is/.
  96. * Must comply withRFC3986.
  97. *
  98. * @var string
  99. */
  100. public $requestPath;
  101. /**
  102. * Creates a content-based HTTP/2 health check. In addition to the required
  103. * HTTP 200 (OK) status code, you can configure the health check to pass only
  104. * when the backend sends this specific ASCII response string within the first
  105. * 1024 bytes of the HTTP response body. For details, see:
  106. * https://cloud.google.com/load-balancing/docs/health-check-
  107. * concepts#criteria-protocol-http
  108. *
  109. * @var string
  110. */
  111. public $response;
  112. /**
  113. * The value of the host header in the HTTP/2 health check request. If left
  114. * empty (default value), the host header is set to the destination IP address
  115. * to which health check packets are sent. The destination IP address depends
  116. * on the type of load balancer. For details, see:
  117. * https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-
  118. * packet-dest
  119. *
  120. * @param string $host
  121. */
  122. public function setHost($host)
  123. {
  124. $this->host = $host;
  125. }
  126. /**
  127. * @return string
  128. */
  129. public function getHost()
  130. {
  131. return $this->host;
  132. }
  133. /**
  134. * The TCP port number to which the health check prober sends packets. The
  135. * default value is 443. Valid values are 1 through65535.
  136. *
  137. * @param int $port
  138. */
  139. public function setPort($port)
  140. {
  141. $this->port = $port;
  142. }
  143. /**
  144. * @return int
  145. */
  146. public function getPort()
  147. {
  148. return $this->port;
  149. }
  150. /**
  151. * Not supported.
  152. *
  153. * @param string $portName
  154. */
  155. public function setPortName($portName)
  156. {
  157. $this->portName = $portName;
  158. }
  159. /**
  160. * @return string
  161. */
  162. public function getPortName()
  163. {
  164. return $this->portName;
  165. }
  166. /**
  167. * Specifies how a port is selected for health checking. Can be one of the
  168. * following values: USE_FIXED_PORT: Specifies a port number explicitly using
  169. * theport field in the health check. Supported by backend services for
  170. * passthrough load balancers and backend services for proxy load balancers.
  171. * Not supported by target pools. The health check supports all backends
  172. * supported by the backend service provided the backend can be health
  173. * checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
  174. * network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
  175. * supported. USE_SERVING_PORT: Provides an indirect method of specifying the
  176. * health check port by referring to the backend service. Only supported by
  177. * backend services for proxy load balancers. Not supported by target pools.
  178. * Not supported by backend services for passthrough load balancers. Supports
  179. * all backends that can be health checked; for example,GCE_VM_IP_PORT network
  180. * endpoint groups and instance group backends.
  181. *
  182. * For GCE_VM_IP_PORT network endpoint group backends, the health check uses
  183. * the port number specified for each endpoint in the network endpoint group.
  184. * For instance group backends, the health check uses the port number
  185. * determined by looking up the backend service's named port in the instance
  186. * group's list of named ports.
  187. *
  188. * Accepted values: USE_FIXED_PORT, USE_NAMED_PORT, USE_SERVING_PORT
  189. *
  190. * @param self::PORT_SPECIFICATION_* $portSpecification
  191. */
  192. public function setPortSpecification($portSpecification)
  193. {
  194. $this->portSpecification = $portSpecification;
  195. }
  196. /**
  197. * @return self::PORT_SPECIFICATION_*
  198. */
  199. public function getPortSpecification()
  200. {
  201. return $this->portSpecification;
  202. }
  203. /**
  204. * Specifies the type of proxy header to append before sending data to the
  205. * backend, either NONE or PROXY_V1. The default is NONE.
  206. *
  207. * Accepted values: NONE, PROXY_V1
  208. *
  209. * @param self::PROXY_HEADER_* $proxyHeader
  210. */
  211. public function setProxyHeader($proxyHeader)
  212. {
  213. $this->proxyHeader = $proxyHeader;
  214. }
  215. /**
  216. * @return self::PROXY_HEADER_*
  217. */
  218. public function getProxyHeader()
  219. {
  220. return $this->proxyHeader;
  221. }
  222. /**
  223. * The request path of the HTTP/2 health check request. The default value is/.
  224. * Must comply withRFC3986.
  225. *
  226. * @param string $requestPath
  227. */
  228. public function setRequestPath($requestPath)
  229. {
  230. $this->requestPath = $requestPath;
  231. }
  232. /**
  233. * @return string
  234. */
  235. public function getRequestPath()
  236. {
  237. return $this->requestPath;
  238. }
  239. /**
  240. * Creates a content-based HTTP/2 health check. In addition to the required
  241. * HTTP 200 (OK) status code, you can configure the health check to pass only
  242. * when the backend sends this specific ASCII response string within the first
  243. * 1024 bytes of the HTTP response body. For details, see:
  244. * https://cloud.google.com/load-balancing/docs/health-check-
  245. * concepts#criteria-protocol-http
  246. *
  247. * @param string $response
  248. */
  249. public function setResponse($response)
  250. {
  251. $this->response = $response;
  252. }
  253. /**
  254. * @return string
  255. */
  256. public function getResponse()
  257. {
  258. return $this->response;
  259. }
  260. }
  261. // Adding a class alias for backwards compatibility with the previous class name.
  262. class_alias(HTTP2HealthCheck::class, 'Google_Service_Compute_HTTP2HealthCheck');