ApplyNodesRequest.cc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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/ehpc/model/ApplyNodesRequest.h>
  17. using AlibabaCloud::EHPC::Model::ApplyNodesRequest;
  18. ApplyNodesRequest::ApplyNodesRequest() :
  19. RpcServiceRequest("ehpc", "2018-04-12", "ApplyNodes")
  20. {
  21. setMethod(HttpRequest::Method::Get);
  22. }
  23. ApplyNodesRequest::~ApplyNodesRequest()
  24. {}
  25. std::string ApplyNodesRequest::getImageId()const
  26. {
  27. return imageId_;
  28. }
  29. void ApplyNodesRequest::setImageId(const std::string& imageId)
  30. {
  31. imageId_ = imageId;
  32. setParameter("ImageId", imageId);
  33. }
  34. int ApplyNodesRequest::getMemory()const
  35. {
  36. return memory_;
  37. }
  38. void ApplyNodesRequest::setMemory(int memory)
  39. {
  40. memory_ = memory;
  41. setParameter("Memory", std::to_string(memory));
  42. }
  43. std::string ApplyNodesRequest::getSystemDiskLevel()const
  44. {
  45. return systemDiskLevel_;
  46. }
  47. void ApplyNodesRequest::setSystemDiskLevel(const std::string& systemDiskLevel)
  48. {
  49. systemDiskLevel_ = systemDiskLevel;
  50. setParameter("SystemDiskLevel", systemDiskLevel);
  51. }
  52. bool ApplyNodesRequest::getAllocatePublicAddress()const
  53. {
  54. return allocatePublicAddress_;
  55. }
  56. void ApplyNodesRequest::setAllocatePublicAddress(bool allocatePublicAddress)
  57. {
  58. allocatePublicAddress_ = allocatePublicAddress;
  59. setParameter("AllocatePublicAddress", allocatePublicAddress ? "true" : "false");
  60. }
  61. int ApplyNodesRequest::getInternetMaxBandWidthOut()const
  62. {
  63. return internetMaxBandWidthOut_;
  64. }
  65. void ApplyNodesRequest::setInternetMaxBandWidthOut(int internetMaxBandWidthOut)
  66. {
  67. internetMaxBandWidthOut_ = internetMaxBandWidthOut;
  68. setParameter("InternetMaxBandWidthOut", std::to_string(internetMaxBandWidthOut));
  69. }
  70. std::string ApplyNodesRequest::getResourceAmountType()const
  71. {
  72. return resourceAmountType_;
  73. }
  74. void ApplyNodesRequest::setResourceAmountType(const std::string& resourceAmountType)
  75. {
  76. resourceAmountType_ = resourceAmountType;
  77. setParameter("ResourceAmountType", resourceAmountType);
  78. }
  79. std::string ApplyNodesRequest::getAccessKeyId()const
  80. {
  81. return accessKeyId_;
  82. }
  83. void ApplyNodesRequest::setAccessKeyId(const std::string& accessKeyId)
  84. {
  85. accessKeyId_ = accessKeyId;
  86. setParameter("AccessKeyId", accessKeyId);
  87. }
  88. std::string ApplyNodesRequest::getSystemDiskType()const
  89. {
  90. return systemDiskType_;
  91. }
  92. void ApplyNodesRequest::setSystemDiskType(const std::string& systemDiskType)
  93. {
  94. systemDiskType_ = systemDiskType;
  95. setParameter("SystemDiskType", systemDiskType);
  96. }
  97. int ApplyNodesRequest::getCores()const
  98. {
  99. return cores_;
  100. }
  101. void ApplyNodesRequest::setCores(int cores)
  102. {
  103. cores_ = cores;
  104. setParameter("Cores", std::to_string(cores));
  105. }
  106. int ApplyNodesRequest::getSystemDiskSize()const
  107. {
  108. return systemDiskSize_;
  109. }
  110. void ApplyNodesRequest::setSystemDiskSize(int systemDiskSize)
  111. {
  112. systemDiskSize_ = systemDiskSize;
  113. setParameter("SystemDiskSize", std::to_string(systemDiskSize));
  114. }
  115. std::vector<ApplyNodesRequest::ZoneInfos> ApplyNodesRequest::getZoneInfos()const
  116. {
  117. return zoneInfos_;
  118. }
  119. void ApplyNodesRequest::setZoneInfos(const std::vector<ZoneInfos>& zoneInfos)
  120. {
  121. zoneInfos_ = zoneInfos;
  122. for(int dep1 = 0; dep1!= zoneInfos.size(); dep1++) {
  123. auto zoneInfosObj = zoneInfos.at(dep1);
  124. std::string zoneInfosObjStr = "ZoneInfos." + std::to_string(dep1 + 1);
  125. setParameter(zoneInfosObjStr + ".VSwitchId", zoneInfosObj.vSwitchId);
  126. setParameter(zoneInfosObjStr + ".ZoneId", zoneInfosObj.zoneId);
  127. }
  128. }
  129. std::string ApplyNodesRequest::getHostNamePrefix()const
  130. {
  131. return hostNamePrefix_;
  132. }
  133. void ApplyNodesRequest::setHostNamePrefix(const std::string& hostNamePrefix)
  134. {
  135. hostNamePrefix_ = hostNamePrefix;
  136. setParameter("HostNamePrefix", hostNamePrefix);
  137. }
  138. float ApplyNodesRequest::getComputeSpotPriceLimit()const
  139. {
  140. return computeSpotPriceLimit_;
  141. }
  142. void ApplyNodesRequest::setComputeSpotPriceLimit(float computeSpotPriceLimit)
  143. {
  144. computeSpotPriceLimit_ = computeSpotPriceLimit;
  145. setParameter("ComputeSpotPriceLimit", std::to_string(computeSpotPriceLimit));
  146. }
  147. std::string ApplyNodesRequest::getClusterId()const
  148. {
  149. return clusterId_;
  150. }
  151. void ApplyNodesRequest::setClusterId(const std::string& clusterId)
  152. {
  153. clusterId_ = clusterId;
  154. setParameter("ClusterId", clusterId);
  155. }
  156. std::string ApplyNodesRequest::getComputeSpotStrategy()const
  157. {
  158. return computeSpotStrategy_;
  159. }
  160. void ApplyNodesRequest::setComputeSpotStrategy(const std::string& computeSpotStrategy)
  161. {
  162. computeSpotStrategy_ = computeSpotStrategy;
  163. setParameter("ComputeSpotStrategy", computeSpotStrategy);
  164. }
  165. std::string ApplyNodesRequest::getHostNameSuffix()const
  166. {
  167. return hostNameSuffix_;
  168. }
  169. void ApplyNodesRequest::setHostNameSuffix(const std::string& hostNameSuffix)
  170. {
  171. hostNameSuffix_ = hostNameSuffix;
  172. setParameter("HostNameSuffix", hostNameSuffix);
  173. }
  174. std::string ApplyNodesRequest::getPriorityStrategy()const
  175. {
  176. return priorityStrategy_;
  177. }
  178. void ApplyNodesRequest::setPriorityStrategy(const std::string& priorityStrategy)
  179. {
  180. priorityStrategy_ = priorityStrategy;
  181. setParameter("PriorityStrategy", priorityStrategy);
  182. }
  183. std::string ApplyNodesRequest::getInstanceFamilyLevel()const
  184. {
  185. return instanceFamilyLevel_;
  186. }
  187. void ApplyNodesRequest::setInstanceFamilyLevel(const std::string& instanceFamilyLevel)
  188. {
  189. instanceFamilyLevel_ = instanceFamilyLevel;
  190. setParameter("InstanceFamilyLevel", instanceFamilyLevel);
  191. }
  192. std::string ApplyNodesRequest::getInternetChargeType()const
  193. {
  194. return internetChargeType_;
  195. }
  196. void ApplyNodesRequest::setInternetChargeType(const std::string& internetChargeType)
  197. {
  198. internetChargeType_ = internetChargeType;
  199. setParameter("InternetChargeType", internetChargeType);
  200. }
  201. std::vector<ApplyNodesRequest::InstanceTypeModel> ApplyNodesRequest::getInstanceTypeModel()const
  202. {
  203. return instanceTypeModel_;
  204. }
  205. void ApplyNodesRequest::setInstanceTypeModel(const std::vector<InstanceTypeModel>& instanceTypeModel)
  206. {
  207. instanceTypeModel_ = instanceTypeModel;
  208. for(int dep1 = 0; dep1!= instanceTypeModel.size(); dep1++) {
  209. auto instanceTypeModelObj = instanceTypeModel.at(dep1);
  210. std::string instanceTypeModelObjStr = "InstanceTypeModel." + std::to_string(dep1 + 1);
  211. setParameter(instanceTypeModelObjStr + ".MaxPrice", std::to_string(instanceTypeModelObj.maxPrice));
  212. setParameter(instanceTypeModelObjStr + ".TargetImageId", instanceTypeModelObj.targetImageId);
  213. setParameter(instanceTypeModelObjStr + ".InstanceType", instanceTypeModelObj.instanceType);
  214. }
  215. }
  216. int ApplyNodesRequest::getInternetMaxBandWidthIn()const
  217. {
  218. return internetMaxBandWidthIn_;
  219. }
  220. void ApplyNodesRequest::setInternetMaxBandWidthIn(int internetMaxBandWidthIn)
  221. {
  222. internetMaxBandWidthIn_ = internetMaxBandWidthIn;
  223. setParameter("InternetMaxBandWidthIn", std::to_string(internetMaxBandWidthIn));
  224. }
  225. int ApplyNodesRequest::getTargetCapacity()const
  226. {
  227. return targetCapacity_;
  228. }
  229. void ApplyNodesRequest::setTargetCapacity(int targetCapacity)
  230. {
  231. targetCapacity_ = targetCapacity;
  232. setParameter("TargetCapacity", std::to_string(targetCapacity));
  233. }
  234. bool ApplyNodesRequest::getStrictSatisfiedTargetCapacity()const
  235. {
  236. return strictSatisfiedTargetCapacity_;
  237. }
  238. void ApplyNodesRequest::setStrictSatisfiedTargetCapacity(bool strictSatisfiedTargetCapacity)
  239. {
  240. strictSatisfiedTargetCapacity_ = strictSatisfiedTargetCapacity;
  241. setParameter("StrictSatisfiedTargetCapacity", strictSatisfiedTargetCapacity ? "true" : "false");
  242. }