CreateScalingRuleRequest.cc 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/ess/model/CreateScalingRuleRequest.h>
  17. using AlibabaCloud::Ess::Model::CreateScalingRuleRequest;
  18. CreateScalingRuleRequest::CreateScalingRuleRequest() :
  19. RpcServiceRequest("ess", "2014-08-28", "CreateScalingRule")
  20. {}
  21. CreateScalingRuleRequest::~CreateScalingRuleRequest()
  22. {}
  23. std::vector<CreateScalingRuleRequest::StepAdjustment> CreateScalingRuleRequest::getStepAdjustment()const
  24. {
  25. return stepAdjustment_;
  26. }
  27. void CreateScalingRuleRequest::setStepAdjustment(const std::vector<StepAdjustment>& stepAdjustment)
  28. {
  29. stepAdjustment_ = stepAdjustment;
  30. int i = 0;
  31. for(int i = 0; i!= stepAdjustment.size(); i++) {
  32. auto obj = stepAdjustment.at(i);
  33. std::string str ="StepAdjustment."+ std::to_string(i);
  34. setCoreParameter(str + ".MetricIntervalLowerBound", std::to_string(obj.metricIntervalLowerBound));
  35. setCoreParameter(str + ".MetricIntervalUpperBound", std::to_string(obj.metricIntervalUpperBound));
  36. setCoreParameter(str + ".ScalingAdjustment", std::to_string(obj.scalingAdjustment));
  37. }
  38. }
  39. std::string CreateScalingRuleRequest::getScalingGroupId()const
  40. {
  41. return scalingGroupId_;
  42. }
  43. void CreateScalingRuleRequest::setScalingGroupId(const std::string& scalingGroupId)
  44. {
  45. scalingGroupId_ = scalingGroupId;
  46. setCoreParameter("ScalingGroupId", scalingGroupId);
  47. }
  48. bool CreateScalingRuleRequest::getDisableScaleIn()const
  49. {
  50. return disableScaleIn_;
  51. }
  52. void CreateScalingRuleRequest::setDisableScaleIn(bool disableScaleIn)
  53. {
  54. disableScaleIn_ = disableScaleIn;
  55. setCoreParameter("DisableScaleIn", disableScaleIn ? "true" : "false");
  56. }
  57. int CreateScalingRuleRequest::getInitialMaxSize()const
  58. {
  59. return initialMaxSize_;
  60. }
  61. void CreateScalingRuleRequest::setInitialMaxSize(int initialMaxSize)
  62. {
  63. initialMaxSize_ = initialMaxSize;
  64. setCoreParameter("InitialMaxSize", std::to_string(initialMaxSize));
  65. }
  66. std::string CreateScalingRuleRequest::getAccessKeyId()const
  67. {
  68. return accessKeyId_;
  69. }
  70. void CreateScalingRuleRequest::setAccessKeyId(const std::string& accessKeyId)
  71. {
  72. accessKeyId_ = accessKeyId;
  73. setCoreParameter("AccessKeyId", accessKeyId);
  74. }
  75. std::string CreateScalingRuleRequest::getScalingRuleName()const
  76. {
  77. return scalingRuleName_;
  78. }
  79. void CreateScalingRuleRequest::setScalingRuleName(const std::string& scalingRuleName)
  80. {
  81. scalingRuleName_ = scalingRuleName;
  82. setCoreParameter("ScalingRuleName", scalingRuleName);
  83. }
  84. int CreateScalingRuleRequest::getCooldown()const
  85. {
  86. return cooldown_;
  87. }
  88. void CreateScalingRuleRequest::setCooldown(int cooldown)
  89. {
  90. cooldown_ = cooldown;
  91. setCoreParameter("Cooldown", std::to_string(cooldown));
  92. }
  93. std::string CreateScalingRuleRequest::getPredictiveValueBehavior()const
  94. {
  95. return predictiveValueBehavior_;
  96. }
  97. void CreateScalingRuleRequest::setPredictiveValueBehavior(const std::string& predictiveValueBehavior)
  98. {
  99. predictiveValueBehavior_ = predictiveValueBehavior;
  100. setCoreParameter("PredictiveValueBehavior", predictiveValueBehavior);
  101. }
  102. std::string CreateScalingRuleRequest::getScalingRuleType()const
  103. {
  104. return scalingRuleType_;
  105. }
  106. void CreateScalingRuleRequest::setScalingRuleType(const std::string& scalingRuleType)
  107. {
  108. scalingRuleType_ = scalingRuleType;
  109. setCoreParameter("ScalingRuleType", scalingRuleType);
  110. }
  111. std::string CreateScalingRuleRequest::getMetricName()const
  112. {
  113. return metricName_;
  114. }
  115. void CreateScalingRuleRequest::setMetricName(const std::string& metricName)
  116. {
  117. metricName_ = metricName;
  118. setCoreParameter("MetricName", metricName);
  119. }
  120. std::string CreateScalingRuleRequest::getPredictiveScalingMode()const
  121. {
  122. return predictiveScalingMode_;
  123. }
  124. void CreateScalingRuleRequest::setPredictiveScalingMode(const std::string& predictiveScalingMode)
  125. {
  126. predictiveScalingMode_ = predictiveScalingMode;
  127. setCoreParameter("PredictiveScalingMode", predictiveScalingMode);
  128. }
  129. std::string CreateScalingRuleRequest::getResourceOwnerAccount()const
  130. {
  131. return resourceOwnerAccount_;
  132. }
  133. void CreateScalingRuleRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
  134. {
  135. resourceOwnerAccount_ = resourceOwnerAccount;
  136. setCoreParameter("ResourceOwnerAccount", resourceOwnerAccount);
  137. }
  138. int CreateScalingRuleRequest::getAdjustmentValue()const
  139. {
  140. return adjustmentValue_;
  141. }
  142. void CreateScalingRuleRequest::setAdjustmentValue(int adjustmentValue)
  143. {
  144. adjustmentValue_ = adjustmentValue;
  145. setCoreParameter("AdjustmentValue", std::to_string(adjustmentValue));
  146. }
  147. int CreateScalingRuleRequest::getEstimatedInstanceWarmup()const
  148. {
  149. return estimatedInstanceWarmup_;
  150. }
  151. void CreateScalingRuleRequest::setEstimatedInstanceWarmup(int estimatedInstanceWarmup)
  152. {
  153. estimatedInstanceWarmup_ = estimatedInstanceWarmup;
  154. setCoreParameter("EstimatedInstanceWarmup", std::to_string(estimatedInstanceWarmup));
  155. }
  156. std::string CreateScalingRuleRequest::getOwnerAccount()const
  157. {
  158. return ownerAccount_;
  159. }
  160. void CreateScalingRuleRequest::setOwnerAccount(const std::string& ownerAccount)
  161. {
  162. ownerAccount_ = ownerAccount;
  163. setCoreParameter("OwnerAccount", ownerAccount);
  164. }
  165. int CreateScalingRuleRequest::getPredictiveTaskBufferTime()const
  166. {
  167. return predictiveTaskBufferTime_;
  168. }
  169. void CreateScalingRuleRequest::setPredictiveTaskBufferTime(int predictiveTaskBufferTime)
  170. {
  171. predictiveTaskBufferTime_ = predictiveTaskBufferTime;
  172. setCoreParameter("PredictiveTaskBufferTime", std::to_string(predictiveTaskBufferTime));
  173. }
  174. std::string CreateScalingRuleRequest::getAdjustmentType()const
  175. {
  176. return adjustmentType_;
  177. }
  178. void CreateScalingRuleRequest::setAdjustmentType(const std::string& adjustmentType)
  179. {
  180. adjustmentType_ = adjustmentType;
  181. setCoreParameter("AdjustmentType", adjustmentType);
  182. }
  183. long CreateScalingRuleRequest::getOwnerId()const
  184. {
  185. return ownerId_;
  186. }
  187. void CreateScalingRuleRequest::setOwnerId(long ownerId)
  188. {
  189. ownerId_ = ownerId;
  190. setCoreParameter("OwnerId", std::to_string(ownerId));
  191. }
  192. int CreateScalingRuleRequest::getPredictiveValueBuffer()const
  193. {
  194. return predictiveValueBuffer_;
  195. }
  196. void CreateScalingRuleRequest::setPredictiveValueBuffer(int predictiveValueBuffer)
  197. {
  198. predictiveValueBuffer_ = predictiveValueBuffer;
  199. setCoreParameter("PredictiveValueBuffer", std::to_string(predictiveValueBuffer));
  200. }
  201. int CreateScalingRuleRequest::getMinAdjustmentMagnitude()const
  202. {
  203. return minAdjustmentMagnitude_;
  204. }
  205. void CreateScalingRuleRequest::setMinAdjustmentMagnitude(int minAdjustmentMagnitude)
  206. {
  207. minAdjustmentMagnitude_ = minAdjustmentMagnitude;
  208. setCoreParameter("MinAdjustmentMagnitude", std::to_string(minAdjustmentMagnitude));
  209. }
  210. float CreateScalingRuleRequest::getTargetValue()const
  211. {
  212. return targetValue_;
  213. }
  214. void CreateScalingRuleRequest::setTargetValue(float targetValue)
  215. {
  216. targetValue_ = targetValue;
  217. setCoreParameter("TargetValue", std::to_string(targetValue));
  218. }