SchedulingNodeAffinity.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 SchedulingNodeAffinity extends \Google\Collection
  19. {
  20. /**
  21. * Requires Compute Engine to seek for matched nodes.
  22. */
  23. public const OPERATOR_IN = 'IN';
  24. /**
  25. * Requires Compute Engine to avoid certain nodes.
  26. */
  27. public const OPERATOR_NOT_IN = 'NOT_IN';
  28. public const OPERATOR_OPERATOR_UNSPECIFIED = 'OPERATOR_UNSPECIFIED';
  29. protected $collection_key = 'values';
  30. /**
  31. * Corresponds to the label key of Node resource.
  32. *
  33. * @var string
  34. */
  35. public $key;
  36. /**
  37. * Defines the operation of node selection. Valid operators areIN for affinity
  38. * and NOT_IN for anti-affinity.
  39. *
  40. * @var string
  41. */
  42. public $operator;
  43. /**
  44. * Corresponds to the label values of Node resource.
  45. *
  46. * @var string[]
  47. */
  48. public $values;
  49. /**
  50. * Corresponds to the label key of Node resource.
  51. *
  52. * @param string $key
  53. */
  54. public function setKey($key)
  55. {
  56. $this->key = $key;
  57. }
  58. /**
  59. * @return string
  60. */
  61. public function getKey()
  62. {
  63. return $this->key;
  64. }
  65. /**
  66. * Defines the operation of node selection. Valid operators areIN for affinity
  67. * and NOT_IN for anti-affinity.
  68. *
  69. * Accepted values: IN, NOT_IN, OPERATOR_UNSPECIFIED
  70. *
  71. * @param self::OPERATOR_* $operator
  72. */
  73. public function setOperator($operator)
  74. {
  75. $this->operator = $operator;
  76. }
  77. /**
  78. * @return self::OPERATOR_*
  79. */
  80. public function getOperator()
  81. {
  82. return $this->operator;
  83. }
  84. /**
  85. * Corresponds to the label values of Node resource.
  86. *
  87. * @param string[] $values
  88. */
  89. public function setValues($values)
  90. {
  91. $this->values = $values;
  92. }
  93. /**
  94. * @return string[]
  95. */
  96. public function getValues()
  97. {
  98. return $this->values;
  99. }
  100. }
  101. // Adding a class alias for backwards compatibility with the previous class name.
  102. class_alias(SchedulingNodeAffinity::class, 'Google_Service_Compute_SchedulingNodeAffinity');