HealthStatus.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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 HealthStatus extends \Google\Model
  19. {
  20. public const HEALTH_STATE_HEALTHY = 'HEALTHY';
  21. public const HEALTH_STATE_UNHEALTHY = 'UNHEALTHY';
  22. public const IPV6_HEALTH_STATE_HEALTHY = 'HEALTHY';
  23. public const IPV6_HEALTH_STATE_UNHEALTHY = 'UNHEALTHY';
  24. /**
  25. * The response to a Health Check probe had the HTTP response header field
  26. * X-Load-Balancing-Endpoint-Weight, but its content was invalid (i.e., not a
  27. * non-negative single-precision floating-point number in decimal string
  28. * representation).
  29. */
  30. public const WEIGHT_ERROR_INVALID_WEIGHT = 'INVALID_WEIGHT';
  31. /**
  32. * The response to a Health Check probe did not have the HTTP response header
  33. * field X-Load-Balancing-Endpoint-Weight.
  34. */
  35. public const WEIGHT_ERROR_MISSING_WEIGHT = 'MISSING_WEIGHT';
  36. /**
  37. * This is the value when the accompanied health status is either TIMEOUT
  38. * (i.e.,the Health Check probe was not able to get a response in time) or
  39. * UNKNOWN. For the latter, it should be typically because there has not been
  40. * sufficient time to parse and report the weight for a new backend (which is
  41. * with 0.0.0.0 ip address). However, it can be also due to an outage case for
  42. * which the health status is explicitly reset to UNKNOWN.
  43. */
  44. public const WEIGHT_ERROR_UNAVAILABLE_WEIGHT = 'UNAVAILABLE_WEIGHT';
  45. /**
  46. * This is the default value when WeightReportMode is DISABLE, and is also the
  47. * initial value when WeightReportMode has just updated to ENABLE or DRY_RUN
  48. * and there has not been sufficient time to parse and report the backend
  49. * weight.
  50. */
  51. public const WEIGHT_ERROR_WEIGHT_NONE = 'WEIGHT_NONE';
  52. /**
  53. * Metadata defined as annotations for network endpoint.
  54. *
  55. * @var string[]
  56. */
  57. public $annotations;
  58. /**
  59. * URL of the forwarding rule associated with the health status of the
  60. * instance.
  61. *
  62. * @var string
  63. */
  64. public $forwardingRule;
  65. /**
  66. * A forwarding rule IP address assigned to this instance.
  67. *
  68. * @var string
  69. */
  70. public $forwardingRuleIp;
  71. /**
  72. * Health state of the IPv4 address of the instance.
  73. *
  74. * @var string
  75. */
  76. public $healthState;
  77. /**
  78. * URL of the instance resource.
  79. *
  80. * @var string
  81. */
  82. public $instance;
  83. /**
  84. * For target pool based Network Load Balancing, it indicates the forwarding
  85. * rule's IP address assigned to this instance. For other types of load
  86. * balancing, the field indicates VM internal ip.
  87. *
  88. * @var string
  89. */
  90. public $ipAddress;
  91. /**
  92. * @var string
  93. */
  94. public $ipv6Address;
  95. /**
  96. * Health state of the IPv6 address of the instance.
  97. *
  98. * @var string
  99. */
  100. public $ipv6HealthState;
  101. /**
  102. * The named port of the instance group, not necessarily the port that is
  103. * health-checked.
  104. *
  105. * @var int
  106. */
  107. public $port;
  108. /**
  109. * @var string
  110. */
  111. public $weight;
  112. /**
  113. * @var string
  114. */
  115. public $weightError;
  116. /**
  117. * Metadata defined as annotations for network endpoint.
  118. *
  119. * @param string[] $annotations
  120. */
  121. public function setAnnotations($annotations)
  122. {
  123. $this->annotations = $annotations;
  124. }
  125. /**
  126. * @return string[]
  127. */
  128. public function getAnnotations()
  129. {
  130. return $this->annotations;
  131. }
  132. /**
  133. * URL of the forwarding rule associated with the health status of the
  134. * instance.
  135. *
  136. * @param string $forwardingRule
  137. */
  138. public function setForwardingRule($forwardingRule)
  139. {
  140. $this->forwardingRule = $forwardingRule;
  141. }
  142. /**
  143. * @return string
  144. */
  145. public function getForwardingRule()
  146. {
  147. return $this->forwardingRule;
  148. }
  149. /**
  150. * A forwarding rule IP address assigned to this instance.
  151. *
  152. * @param string $forwardingRuleIp
  153. */
  154. public function setForwardingRuleIp($forwardingRuleIp)
  155. {
  156. $this->forwardingRuleIp = $forwardingRuleIp;
  157. }
  158. /**
  159. * @return string
  160. */
  161. public function getForwardingRuleIp()
  162. {
  163. return $this->forwardingRuleIp;
  164. }
  165. /**
  166. * Health state of the IPv4 address of the instance.
  167. *
  168. * Accepted values: HEALTHY, UNHEALTHY
  169. *
  170. * @param self::HEALTH_STATE_* $healthState
  171. */
  172. public function setHealthState($healthState)
  173. {
  174. $this->healthState = $healthState;
  175. }
  176. /**
  177. * @return self::HEALTH_STATE_*
  178. */
  179. public function getHealthState()
  180. {
  181. return $this->healthState;
  182. }
  183. /**
  184. * URL of the instance resource.
  185. *
  186. * @param string $instance
  187. */
  188. public function setInstance($instance)
  189. {
  190. $this->instance = $instance;
  191. }
  192. /**
  193. * @return string
  194. */
  195. public function getInstance()
  196. {
  197. return $this->instance;
  198. }
  199. /**
  200. * For target pool based Network Load Balancing, it indicates the forwarding
  201. * rule's IP address assigned to this instance. For other types of load
  202. * balancing, the field indicates VM internal ip.
  203. *
  204. * @param string $ipAddress
  205. */
  206. public function setIpAddress($ipAddress)
  207. {
  208. $this->ipAddress = $ipAddress;
  209. }
  210. /**
  211. * @return string
  212. */
  213. public function getIpAddress()
  214. {
  215. return $this->ipAddress;
  216. }
  217. /**
  218. * @param string $ipv6Address
  219. */
  220. public function setIpv6Address($ipv6Address)
  221. {
  222. $this->ipv6Address = $ipv6Address;
  223. }
  224. /**
  225. * @return string
  226. */
  227. public function getIpv6Address()
  228. {
  229. return $this->ipv6Address;
  230. }
  231. /**
  232. * Health state of the IPv6 address of the instance.
  233. *
  234. * Accepted values: HEALTHY, UNHEALTHY
  235. *
  236. * @param self::IPV6_HEALTH_STATE_* $ipv6HealthState
  237. */
  238. public function setIpv6HealthState($ipv6HealthState)
  239. {
  240. $this->ipv6HealthState = $ipv6HealthState;
  241. }
  242. /**
  243. * @return self::IPV6_HEALTH_STATE_*
  244. */
  245. public function getIpv6HealthState()
  246. {
  247. return $this->ipv6HealthState;
  248. }
  249. /**
  250. * The named port of the instance group, not necessarily the port that is
  251. * health-checked.
  252. *
  253. * @param int $port
  254. */
  255. public function setPort($port)
  256. {
  257. $this->port = $port;
  258. }
  259. /**
  260. * @return int
  261. */
  262. public function getPort()
  263. {
  264. return $this->port;
  265. }
  266. /**
  267. * @param string $weight
  268. */
  269. public function setWeight($weight)
  270. {
  271. $this->weight = $weight;
  272. }
  273. /**
  274. * @return string
  275. */
  276. public function getWeight()
  277. {
  278. return $this->weight;
  279. }
  280. /**
  281. * @param self::WEIGHT_ERROR_* $weightError
  282. */
  283. public function setWeightError($weightError)
  284. {
  285. $this->weightError = $weightError;
  286. }
  287. /**
  288. * @return self::WEIGHT_ERROR_*
  289. */
  290. public function getWeightError()
  291. {
  292. return $this->weightError;
  293. }
  294. }
  295. // Adding a class alias for backwards compatibility with the previous class name.
  296. class_alias(HealthStatus::class, 'Google_Service_Compute_HealthStatus');