AutoscalerStatusDetails.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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 AutoscalerStatusDetails extends \Google\Model
  19. {
  20. /**
  21. * All instances in the instance group are unhealthy (not in RUNNING state).
  22. */
  23. public const TYPE_ALL_INSTANCES_UNHEALTHY = 'ALL_INSTANCES_UNHEALTHY';
  24. /**
  25. * There is no backend service attached to the instance group.
  26. */
  27. public const TYPE_BACKEND_SERVICE_DOES_NOT_EXIST = 'BACKEND_SERVICE_DOES_NOT_EXIST';
  28. /**
  29. * Autoscaler recommends a size greater than maxNumReplicas.
  30. */
  31. public const TYPE_CAPPED_AT_MAX_NUM_REPLICAS = 'CAPPED_AT_MAX_NUM_REPLICAS';
  32. /**
  33. * The custom metric samples are not exported often enough to be a credible
  34. * base for autoscaling.
  35. */
  36. public const TYPE_CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE = 'CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE';
  37. /**
  38. * The custom metric that was specified does not exist or does not have the
  39. * necessary labels.
  40. */
  41. public const TYPE_CUSTOM_METRIC_INVALID = 'CUSTOM_METRIC_INVALID';
  42. /**
  43. * The minNumReplicas is equal to maxNumReplicas. This means the autoscaler
  44. * cannot add or remove instances from the instance group.
  45. */
  46. public const TYPE_MIN_EQUALS_MAX = 'MIN_EQUALS_MAX';
  47. /**
  48. * The autoscaler did not receive any data from the custom metric configured
  49. * for autoscaling.
  50. */
  51. public const TYPE_MISSING_CUSTOM_METRIC_DATA_POINTS = 'MISSING_CUSTOM_METRIC_DATA_POINTS';
  52. /**
  53. * The autoscaler is configured to scale based on a load balancing signal but
  54. * the instance group has not received any requests from the load balancer.
  55. */
  56. public const TYPE_MISSING_LOAD_BALANCING_DATA_POINTS = 'MISSING_LOAD_BALANCING_DATA_POINTS';
  57. /**
  58. * Autoscaling is turned off. The number of instances in the group won't
  59. * change automatically. The autoscaling configuration is preserved.
  60. */
  61. public const TYPE_MODE_OFF = 'MODE_OFF';
  62. /**
  63. * Autoscaling is in the "Autoscale only scale out" mode. Instances in the
  64. * group will be only added.
  65. */
  66. public const TYPE_MODE_ONLY_SCALE_OUT = 'MODE_ONLY_SCALE_OUT';
  67. /**
  68. * Autoscaling is in the "Autoscale only out" mode. Instances in the group
  69. * will be only added.
  70. */
  71. public const TYPE_MODE_ONLY_UP = 'MODE_ONLY_UP';
  72. /**
  73. * The instance group cannot be autoscaled because it has more than one
  74. * backend service attached to it.
  75. */
  76. public const TYPE_MORE_THAN_ONE_BACKEND_SERVICE = 'MORE_THAN_ONE_BACKEND_SERVICE';
  77. /**
  78. * There is insufficient quota for the necessary resources, such as CPU or
  79. * number of instances.
  80. */
  81. public const TYPE_NOT_ENOUGH_QUOTA_AVAILABLE = 'NOT_ENOUGH_QUOTA_AVAILABLE';
  82. /**
  83. * Showed only for regional autoscalers: there is a resource stockout in the
  84. * chosen region.
  85. */
  86. public const TYPE_REGION_RESOURCE_STOCKOUT = 'REGION_RESOURCE_STOCKOUT';
  87. /**
  88. * The target to be scaled does not exist.
  89. */
  90. public const TYPE_SCALING_TARGET_DOES_NOT_EXIST = 'SCALING_TARGET_DOES_NOT_EXIST';
  91. /**
  92. * For some scaling schedules minRequiredReplicas is greater than
  93. * maxNumReplicas. Autoscaler always recommends at most maxNumReplicas
  94. * instances.
  95. */
  96. public const TYPE_SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX = 'SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX';
  97. /**
  98. * For some scaling schedules minRequiredReplicas is less than minNumReplicas.
  99. * Autoscaler always recommends at least minNumReplicas instances.
  100. */
  101. public const TYPE_SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN = 'SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN';
  102. public const TYPE_UNKNOWN = 'UNKNOWN';
  103. /**
  104. * Autoscaling does not work with an HTTP/S load balancer that has been
  105. * configured for maxRate.
  106. */
  107. public const TYPE_UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION = 'UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION';
  108. /**
  109. * For zonal autoscalers: there is a resource stockout in the chosen zone. For
  110. * regional autoscalers: in at least one of the zones you're using there is a
  111. * resource stockout.
  112. */
  113. public const TYPE_ZONE_RESOURCE_STOCKOUT = 'ZONE_RESOURCE_STOCKOUT';
  114. /**
  115. * The status message.
  116. *
  117. * @var string
  118. */
  119. public $message;
  120. /**
  121. * The type of error, warning, or notice returned. Current set of possible
  122. * values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in
  123. * the instance group are unhealthy (not in RUNNING state). -
  124. * BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service
  125. * attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING):
  126. * Autoscaler recommends a size greater than maxNumReplicas. -
  127. * CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric
  128. * samples are not exported often enough to be a credible base for
  129. * autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric
  130. * that was specified does not exist or does not have the necessary
  131. * labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to
  132. * maxNumReplicas. This means the autoscaler cannot add or remove
  133. * instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS
  134. * (WARNING): The autoscaler did not receive any data from the custom
  135. * metric configured for autoscaling. -
  136. * MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is
  137. * configured to scale based on a load balancing signal but the instance
  138. * group has not received any requests from the load balancer. -
  139. * MODE_OFF (WARNING): Autoscaling is turned off. The number of instances
  140. * in the group won't change automatically. The autoscaling configuration
  141. * is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the
  142. * "Autoscale only out" mode. The autoscaler can add instances but not
  143. * remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance
  144. * group cannot be autoscaled because it has more than one backend
  145. * service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There
  146. * is insufficient quota for the necessary resources, such as CPU or
  147. * number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only
  148. * for regional autoscalers: there is a resource stockout in the chosen
  149. * region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be
  150. * scaled does not exist. -
  151. * UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling
  152. * does not work with an HTTP/S load balancer that has been configured
  153. * for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal
  154. * autoscalers: there is a resource stockout in the chosen zone. For
  155. * regional autoscalers: in at least one of the zones you're using there
  156. * is a resource stockout.
  157. *
  158. * New values might be added in the future. Some of the values might not be
  159. * available in all API versions.
  160. *
  161. * @var string
  162. */
  163. public $type;
  164. /**
  165. * The status message.
  166. *
  167. * @param string $message
  168. */
  169. public function setMessage($message)
  170. {
  171. $this->message = $message;
  172. }
  173. /**
  174. * @return string
  175. */
  176. public function getMessage()
  177. {
  178. return $this->message;
  179. }
  180. /**
  181. * The type of error, warning, or notice returned. Current set of possible
  182. * values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in
  183. * the instance group are unhealthy (not in RUNNING state). -
  184. * BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service
  185. * attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING):
  186. * Autoscaler recommends a size greater than maxNumReplicas. -
  187. * CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric
  188. * samples are not exported often enough to be a credible base for
  189. * autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric
  190. * that was specified does not exist or does not have the necessary
  191. * labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to
  192. * maxNumReplicas. This means the autoscaler cannot add or remove
  193. * instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS
  194. * (WARNING): The autoscaler did not receive any data from the custom
  195. * metric configured for autoscaling. -
  196. * MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is
  197. * configured to scale based on a load balancing signal but the instance
  198. * group has not received any requests from the load balancer. -
  199. * MODE_OFF (WARNING): Autoscaling is turned off. The number of instances
  200. * in the group won't change automatically. The autoscaling configuration
  201. * is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the
  202. * "Autoscale only out" mode. The autoscaler can add instances but not
  203. * remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance
  204. * group cannot be autoscaled because it has more than one backend
  205. * service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There
  206. * is insufficient quota for the necessary resources, such as CPU or
  207. * number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only
  208. * for regional autoscalers: there is a resource stockout in the chosen
  209. * region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be
  210. * scaled does not exist. -
  211. * UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling
  212. * does not work with an HTTP/S load balancer that has been configured
  213. * for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal
  214. * autoscalers: there is a resource stockout in the chosen zone. For
  215. * regional autoscalers: in at least one of the zones you're using there
  216. * is a resource stockout.
  217. *
  218. * New values might be added in the future. Some of the values might not be
  219. * available in all API versions.
  220. *
  221. * Accepted values: ALL_INSTANCES_UNHEALTHY, BACKEND_SERVICE_DOES_NOT_EXIST,
  222. * CAPPED_AT_MAX_NUM_REPLICAS, CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE,
  223. * CUSTOM_METRIC_INVALID, MIN_EQUALS_MAX, MISSING_CUSTOM_METRIC_DATA_POINTS,
  224. * MISSING_LOAD_BALANCING_DATA_POINTS, MODE_OFF, MODE_ONLY_SCALE_OUT,
  225. * MODE_ONLY_UP, MORE_THAN_ONE_BACKEND_SERVICE, NOT_ENOUGH_QUOTA_AVAILABLE,
  226. * REGION_RESOURCE_STOCKOUT, SCALING_TARGET_DOES_NOT_EXIST,
  227. * SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX,
  228. * SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN, UNKNOWN,
  229. * UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION, ZONE_RESOURCE_STOCKOUT
  230. *
  231. * @param self::TYPE_* $type
  232. */
  233. public function setType($type)
  234. {
  235. $this->type = $type;
  236. }
  237. /**
  238. * @return self::TYPE_*
  239. */
  240. public function getType()
  241. {
  242. return $this->type;
  243. }
  244. }
  245. // Adding a class alias for backwards compatibility with the previous class name.
  246. class_alias(AutoscalerStatusDetails::class, 'Google_Service_Compute_AutoscalerStatusDetails');