BackendCustomMetric.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 BackendCustomMetric extends \Google\Model
  19. {
  20. /**
  21. * If true, the metric data is collected and reported to Cloud Monitoring, but
  22. * is not used for load balancing.
  23. *
  24. * @var bool
  25. */
  26. public $dryRun;
  27. /**
  28. * Optional parameter to define a target utilization for the Custom Metrics
  29. * balancing mode. The valid range is [0.0, 1.0].
  30. *
  31. * @var float
  32. */
  33. public $maxUtilization;
  34. /**
  35. * Name of a custom utilization signal. The name must be 1-64 characters long
  36. * and match the regular expression `[a-z]([-_.a-z0-9]*[a-z0-9])?` which means
  37. * that the first character must be a lowercase letter, and all following
  38. * characters must be a dash, period, underscore, lowercase letter, or digit,
  39. * except the last character, which cannot be a dash, period, or underscore.
  40. * For usage guidelines, see Custom Metrics balancing mode. This field can
  41. * only be used for a global or regional backend service with the
  42. * loadBalancingScheme set to EXTERNAL_MANAGED,INTERNAL_MANAGED
  43. * INTERNAL_SELF_MANAGED.
  44. *
  45. * @var string
  46. */
  47. public $name;
  48. /**
  49. * If true, the metric data is collected and reported to Cloud Monitoring, but
  50. * is not used for load balancing.
  51. *
  52. * @param bool $dryRun
  53. */
  54. public function setDryRun($dryRun)
  55. {
  56. $this->dryRun = $dryRun;
  57. }
  58. /**
  59. * @return bool
  60. */
  61. public function getDryRun()
  62. {
  63. return $this->dryRun;
  64. }
  65. /**
  66. * Optional parameter to define a target utilization for the Custom Metrics
  67. * balancing mode. The valid range is [0.0, 1.0].
  68. *
  69. * @param float $maxUtilization
  70. */
  71. public function setMaxUtilization($maxUtilization)
  72. {
  73. $this->maxUtilization = $maxUtilization;
  74. }
  75. /**
  76. * @return float
  77. */
  78. public function getMaxUtilization()
  79. {
  80. return $this->maxUtilization;
  81. }
  82. /**
  83. * Name of a custom utilization signal. The name must be 1-64 characters long
  84. * and match the regular expression `[a-z]([-_.a-z0-9]*[a-z0-9])?` which means
  85. * that the first character must be a lowercase letter, and all following
  86. * characters must be a dash, period, underscore, lowercase letter, or digit,
  87. * except the last character, which cannot be a dash, period, or underscore.
  88. * For usage guidelines, see Custom Metrics balancing mode. This field can
  89. * only be used for a global or regional backend service with the
  90. * loadBalancingScheme set to EXTERNAL_MANAGED,INTERNAL_MANAGED
  91. * INTERNAL_SELF_MANAGED.
  92. *
  93. * @param string $name
  94. */
  95. public function setName($name)
  96. {
  97. $this->name = $name;
  98. }
  99. /**
  100. * @return string
  101. */
  102. public function getName()
  103. {
  104. return $this->name;
  105. }
  106. }
  107. // Adding a class alias for backwards compatibility with the previous class name.
  108. class_alias(BackendCustomMetric::class, 'Google_Service_Compute_BackendCustomMetric');