AutoscalingPolicy.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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\Dataproc;
  18. class AutoscalingPolicy extends \Google\Model
  19. {
  20. /**
  21. * Not set.
  22. */
  23. public const CLUSTER_TYPE_CLUSTER_TYPE_UNSPECIFIED = 'CLUSTER_TYPE_UNSPECIFIED';
  24. /**
  25. * Standard dataproc cluster with a minimum of two primary workers.
  26. */
  27. public const CLUSTER_TYPE_STANDARD = 'STANDARD';
  28. /**
  29. * Clusters that can use only secondary workers and be scaled down to zero
  30. * secondary worker nodes.
  31. */
  32. public const CLUSTER_TYPE_ZERO_SCALE = 'ZERO_SCALE';
  33. protected $basicAlgorithmType = BasicAutoscalingAlgorithm::class;
  34. protected $basicAlgorithmDataType = '';
  35. /**
  36. * Optional. The type of the clusters for which this autoscaling policy is to
  37. * be configured.
  38. *
  39. * @var string
  40. */
  41. public $clusterType;
  42. /**
  43. * Required. The policy id.The id must contain only letters (a-z, A-Z),
  44. * numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with
  45. * underscore or hyphen. Must consist of between 3 and 50 characters.
  46. *
  47. * @var string
  48. */
  49. public $id;
  50. /**
  51. * Optional. The labels to associate with this autoscaling policy. Label keys
  52. * must contain 1 to 63 characters, and must conform to RFC 1035
  53. * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if
  54. * present, must contain 1 to 63 characters, and must conform to RFC 1035
  55. * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
  56. * associated with an autoscaling policy.
  57. *
  58. * @var string[]
  59. */
  60. public $labels;
  61. /**
  62. * Output only. The "resource name" of the autoscaling policy, as described in
  63. * https://cloud.google.com/apis/design/resource_names. For
  64. * projects.regions.autoscalingPolicies, the resource name of the policy has
  65. * the following format:
  66. * projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For
  67. * projects.locations.autoscalingPolicies, the resource name of the policy has
  68. * the following format:
  69. * projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
  70. *
  71. * @var string
  72. */
  73. public $name;
  74. protected $secondaryWorkerConfigType = InstanceGroupAutoscalingPolicyConfig::class;
  75. protected $secondaryWorkerConfigDataType = '';
  76. protected $workerConfigType = InstanceGroupAutoscalingPolicyConfig::class;
  77. protected $workerConfigDataType = '';
  78. /**
  79. * @param BasicAutoscalingAlgorithm $basicAlgorithm
  80. */
  81. public function setBasicAlgorithm(BasicAutoscalingAlgorithm $basicAlgorithm)
  82. {
  83. $this->basicAlgorithm = $basicAlgorithm;
  84. }
  85. /**
  86. * @return BasicAutoscalingAlgorithm
  87. */
  88. public function getBasicAlgorithm()
  89. {
  90. return $this->basicAlgorithm;
  91. }
  92. /**
  93. * Optional. The type of the clusters for which this autoscaling policy is to
  94. * be configured.
  95. *
  96. * Accepted values: CLUSTER_TYPE_UNSPECIFIED, STANDARD, ZERO_SCALE
  97. *
  98. * @param self::CLUSTER_TYPE_* $clusterType
  99. */
  100. public function setClusterType($clusterType)
  101. {
  102. $this->clusterType = $clusterType;
  103. }
  104. /**
  105. * @return self::CLUSTER_TYPE_*
  106. */
  107. public function getClusterType()
  108. {
  109. return $this->clusterType;
  110. }
  111. /**
  112. * Required. The policy id.The id must contain only letters (a-z, A-Z),
  113. * numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with
  114. * underscore or hyphen. Must consist of between 3 and 50 characters.
  115. *
  116. * @param string $id
  117. */
  118. public function setId($id)
  119. {
  120. $this->id = $id;
  121. }
  122. /**
  123. * @return string
  124. */
  125. public function getId()
  126. {
  127. return $this->id;
  128. }
  129. /**
  130. * Optional. The labels to associate with this autoscaling policy. Label keys
  131. * must contain 1 to 63 characters, and must conform to RFC 1035
  132. * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if
  133. * present, must contain 1 to 63 characters, and must conform to RFC 1035
  134. * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
  135. * associated with an autoscaling policy.
  136. *
  137. * @param string[] $labels
  138. */
  139. public function setLabels($labels)
  140. {
  141. $this->labels = $labels;
  142. }
  143. /**
  144. * @return string[]
  145. */
  146. public function getLabels()
  147. {
  148. return $this->labels;
  149. }
  150. /**
  151. * Output only. The "resource name" of the autoscaling policy, as described in
  152. * https://cloud.google.com/apis/design/resource_names. For
  153. * projects.regions.autoscalingPolicies, the resource name of the policy has
  154. * the following format:
  155. * projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For
  156. * projects.locations.autoscalingPolicies, the resource name of the policy has
  157. * the following format:
  158. * projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
  159. *
  160. * @param string $name
  161. */
  162. public function setName($name)
  163. {
  164. $this->name = $name;
  165. }
  166. /**
  167. * @return string
  168. */
  169. public function getName()
  170. {
  171. return $this->name;
  172. }
  173. /**
  174. * Optional. Describes how the autoscaler will operate for secondary workers.
  175. *
  176. * @param InstanceGroupAutoscalingPolicyConfig $secondaryWorkerConfig
  177. */
  178. public function setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig $secondaryWorkerConfig)
  179. {
  180. $this->secondaryWorkerConfig = $secondaryWorkerConfig;
  181. }
  182. /**
  183. * @return InstanceGroupAutoscalingPolicyConfig
  184. */
  185. public function getSecondaryWorkerConfig()
  186. {
  187. return $this->secondaryWorkerConfig;
  188. }
  189. /**
  190. * Required. Describes how the autoscaler will operate for primary workers.
  191. *
  192. * @param InstanceGroupAutoscalingPolicyConfig $workerConfig
  193. */
  194. public function setWorkerConfig(InstanceGroupAutoscalingPolicyConfig $workerConfig)
  195. {
  196. $this->workerConfig = $workerConfig;
  197. }
  198. /**
  199. * @return InstanceGroupAutoscalingPolicyConfig
  200. */
  201. public function getWorkerConfig()
  202. {
  203. return $this->workerConfig;
  204. }
  205. }
  206. // Adding a class alias for backwards compatibility with the previous class name.
  207. class_alias(AutoscalingPolicy::class, 'Google_Service_Dataproc_AutoscalingPolicy');