CreateClusterTemplateRequest.cc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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/emr/model/CreateClusterTemplateRequest.h>
  17. using AlibabaCloud::Emr::Model::CreateClusterTemplateRequest;
  18. CreateClusterTemplateRequest::CreateClusterTemplateRequest() :
  19. RpcServiceRequest("emr", "2016-04-08", "CreateClusterTemplate")
  20. {}
  21. CreateClusterTemplateRequest::~CreateClusterTemplateRequest()
  22. {}
  23. long CreateClusterTemplateRequest::getResourceOwnerId()const
  24. {
  25. return resourceOwnerId_;
  26. }
  27. void CreateClusterTemplateRequest::setResourceOwnerId(long resourceOwnerId)
  28. {
  29. resourceOwnerId_ = resourceOwnerId;
  30. setCoreParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
  31. }
  32. std::string CreateClusterTemplateRequest::getLogPath()const
  33. {
  34. return logPath_;
  35. }
  36. void CreateClusterTemplateRequest::setLogPath(const std::string& logPath)
  37. {
  38. logPath_ = logPath;
  39. setCoreParameter("LogPath", logPath);
  40. }
  41. std::string CreateClusterTemplateRequest::getMasterPwd()const
  42. {
  43. return masterPwd_;
  44. }
  45. void CreateClusterTemplateRequest::setMasterPwd(const std::string& masterPwd)
  46. {
  47. masterPwd_ = masterPwd;
  48. setCoreParameter("MasterPwd", masterPwd);
  49. }
  50. std::string CreateClusterTemplateRequest::getConfigurations()const
  51. {
  52. return configurations_;
  53. }
  54. void CreateClusterTemplateRequest::setConfigurations(const std::string& configurations)
  55. {
  56. configurations_ = configurations;
  57. setCoreParameter("Configurations", configurations);
  58. }
  59. bool CreateClusterTemplateRequest::getIoOptimized()const
  60. {
  61. return ioOptimized_;
  62. }
  63. void CreateClusterTemplateRequest::setIoOptimized(bool ioOptimized)
  64. {
  65. ioOptimized_ = ioOptimized;
  66. setCoreParameter("IoOptimized", ioOptimized ? "true" : "false");
  67. }
  68. std::string CreateClusterTemplateRequest::getSecurityGroupId()const
  69. {
  70. return securityGroupId_;
  71. }
  72. void CreateClusterTemplateRequest::setSecurityGroupId(const std::string& securityGroupId)
  73. {
  74. securityGroupId_ = securityGroupId;
  75. setCoreParameter("SecurityGroupId", securityGroupId);
  76. }
  77. bool CreateClusterTemplateRequest::getSshEnable()const
  78. {
  79. return sshEnable_;
  80. }
  81. void CreateClusterTemplateRequest::setSshEnable(bool sshEnable)
  82. {
  83. sshEnable_ = sshEnable;
  84. setCoreParameter("SshEnable", sshEnable ? "true" : "false");
  85. }
  86. bool CreateClusterTemplateRequest::getEasEnable()const
  87. {
  88. return easEnable_;
  89. }
  90. void CreateClusterTemplateRequest::setEasEnable(bool easEnable)
  91. {
  92. easEnable_ = easEnable;
  93. setCoreParameter("EasEnable", easEnable ? "true" : "false");
  94. }
  95. std::string CreateClusterTemplateRequest::getKeyPairName()const
  96. {
  97. return keyPairName_;
  98. }
  99. void CreateClusterTemplateRequest::setKeyPairName(const std::string& keyPairName)
  100. {
  101. keyPairName_ = keyPairName;
  102. setCoreParameter("KeyPairName", keyPairName);
  103. }
  104. std::string CreateClusterTemplateRequest::getMetaStoreType()const
  105. {
  106. return metaStoreType_;
  107. }
  108. void CreateClusterTemplateRequest::setMetaStoreType(const std::string& metaStoreType)
  109. {
  110. metaStoreType_ = metaStoreType;
  111. setCoreParameter("MetaStoreType", metaStoreType);
  112. }
  113. std::string CreateClusterTemplateRequest::getSecurityGroupName()const
  114. {
  115. return securityGroupName_;
  116. }
  117. void CreateClusterTemplateRequest::setSecurityGroupName(const std::string& securityGroupName)
  118. {
  119. securityGroupName_ = securityGroupName;
  120. setCoreParameter("SecurityGroupName", securityGroupName);
  121. }
  122. std::string CreateClusterTemplateRequest::getDepositType()const
  123. {
  124. return depositType_;
  125. }
  126. void CreateClusterTemplateRequest::setDepositType(const std::string& depositType)
  127. {
  128. depositType_ = depositType;
  129. setCoreParameter("DepositType", depositType);
  130. }
  131. std::string CreateClusterTemplateRequest::getAccessKeyId()const
  132. {
  133. return accessKeyId_;
  134. }
  135. void CreateClusterTemplateRequest::setAccessKeyId(const std::string& accessKeyId)
  136. {
  137. accessKeyId_ = accessKeyId;
  138. setCoreParameter("AccessKeyId", accessKeyId);
  139. }
  140. std::string CreateClusterTemplateRequest::getMachineType()const
  141. {
  142. return machineType_;
  143. }
  144. void CreateClusterTemplateRequest::setMachineType(const std::string& machineType)
  145. {
  146. machineType_ = machineType;
  147. setCoreParameter("MachineType", machineType);
  148. }
  149. std::vector<CreateClusterTemplateRequest::BootstrapAction> CreateClusterTemplateRequest::getBootstrapAction()const
  150. {
  151. return bootstrapAction_;
  152. }
  153. void CreateClusterTemplateRequest::setBootstrapAction(const std::vector<BootstrapAction>& bootstrapAction)
  154. {
  155. bootstrapAction_ = bootstrapAction;
  156. int i = 0;
  157. for(int i = 0; i!= bootstrapAction.size(); i++) {
  158. auto obj = bootstrapAction.at(i);
  159. std::string str ="BootstrapAction."+ std::to_string(i);
  160. setCoreParameter(str + ".Path", obj.path);
  161. setCoreParameter(str + ".Arg", obj.arg);
  162. setCoreParameter(str + ".Name", obj.name);
  163. }
  164. }
  165. std::string CreateClusterTemplateRequest::getRegionId()const
  166. {
  167. return regionId_;
  168. }
  169. void CreateClusterTemplateRequest::setRegionId(const std::string& regionId)
  170. {
  171. regionId_ = regionId;
  172. setCoreParameter("RegionId", regionId);
  173. }
  174. bool CreateClusterTemplateRequest::getUseLocalMetaDb()const
  175. {
  176. return useLocalMetaDb_;
  177. }
  178. void CreateClusterTemplateRequest::setUseLocalMetaDb(bool useLocalMetaDb)
  179. {
  180. useLocalMetaDb_ = useLocalMetaDb;
  181. setCoreParameter("UseLocalMetaDb", useLocalMetaDb ? "true" : "false");
  182. }
  183. std::string CreateClusterTemplateRequest::getMetaStoreConf()const
  184. {
  185. return metaStoreConf_;
  186. }
  187. void CreateClusterTemplateRequest::setMetaStoreConf(const std::string& metaStoreConf)
  188. {
  189. metaStoreConf_ = metaStoreConf;
  190. setCoreParameter("MetaStoreConf", metaStoreConf);
  191. }
  192. std::string CreateClusterTemplateRequest::getEmrVer()const
  193. {
  194. return emrVer_;
  195. }
  196. void CreateClusterTemplateRequest::setEmrVer(const std::string& emrVer)
  197. {
  198. emrVer_ = emrVer;
  199. setCoreParameter("EmrVer", emrVer);
  200. }
  201. std::string CreateClusterTemplateRequest::getTemplateName()const
  202. {
  203. return templateName_;
  204. }
  205. void CreateClusterTemplateRequest::setTemplateName(const std::string& templateName)
  206. {
  207. templateName_ = templateName;
  208. setCoreParameter("TemplateName", templateName);
  209. }
  210. std::string CreateClusterTemplateRequest::getUserDefinedEmrEcsRole()const
  211. {
  212. return userDefinedEmrEcsRole_;
  213. }
  214. void CreateClusterTemplateRequest::setUserDefinedEmrEcsRole(const std::string& userDefinedEmrEcsRole)
  215. {
  216. userDefinedEmrEcsRole_ = userDefinedEmrEcsRole;
  217. setCoreParameter("UserDefinedEmrEcsRole", userDefinedEmrEcsRole);
  218. }
  219. bool CreateClusterTemplateRequest::getIsOpenPublicIp()const
  220. {
  221. return isOpenPublicIp_;
  222. }
  223. void CreateClusterTemplateRequest::setIsOpenPublicIp(bool isOpenPublicIp)
  224. {
  225. isOpenPublicIp_ = isOpenPublicIp;
  226. setCoreParameter("IsOpenPublicIp", isOpenPublicIp ? "true" : "false");
  227. }
  228. int CreateClusterTemplateRequest::getPeriod()const
  229. {
  230. return period_;
  231. }
  232. void CreateClusterTemplateRequest::setPeriod(int period)
  233. {
  234. period_ = period;
  235. setCoreParameter("Period", std::to_string(period));
  236. }
  237. std::string CreateClusterTemplateRequest::getInstanceGeneration()const
  238. {
  239. return instanceGeneration_;
  240. }
  241. void CreateClusterTemplateRequest::setInstanceGeneration(const std::string& instanceGeneration)
  242. {
  243. instanceGeneration_ = instanceGeneration;
  244. setCoreParameter("InstanceGeneration", instanceGeneration);
  245. }
  246. std::string CreateClusterTemplateRequest::getVSwitchId()const
  247. {
  248. return vSwitchId_;
  249. }
  250. void CreateClusterTemplateRequest::setVSwitchId(const std::string& vSwitchId)
  251. {
  252. vSwitchId_ = vSwitchId;
  253. setCoreParameter("VSwitchId", vSwitchId);
  254. }
  255. std::string CreateClusterTemplateRequest::getClusterType()const
  256. {
  257. return clusterType_;
  258. }
  259. void CreateClusterTemplateRequest::setClusterType(const std::string& clusterType)
  260. {
  261. clusterType_ = clusterType;
  262. setCoreParameter("ClusterType", clusterType);
  263. }
  264. bool CreateClusterTemplateRequest::getAutoRenew()const
  265. {
  266. return autoRenew_;
  267. }
  268. void CreateClusterTemplateRequest::setAutoRenew(bool autoRenew)
  269. {
  270. autoRenew_ = autoRenew;
  271. setCoreParameter("AutoRenew", autoRenew ? "true" : "false");
  272. }
  273. std::vector<std::string> CreateClusterTemplateRequest::getOptionSoftWareList()const
  274. {
  275. return optionSoftWareList_;
  276. }
  277. void CreateClusterTemplateRequest::setOptionSoftWareList(const std::vector<std::string>& optionSoftWareList)
  278. {
  279. optionSoftWareList_ = optionSoftWareList;
  280. for(int i = 0; i!= optionSoftWareList.size(); i++)
  281. setCoreParameter("OptionSoftWareList."+ std::to_string(i), optionSoftWareList.at(i));
  282. }
  283. std::string CreateClusterTemplateRequest::getVpcId()const
  284. {
  285. return vpcId_;
  286. }
  287. void CreateClusterTemplateRequest::setVpcId(const std::string& vpcId)
  288. {
  289. vpcId_ = vpcId;
  290. setCoreParameter("VpcId", vpcId);
  291. }
  292. std::string CreateClusterTemplateRequest::getNetType()const
  293. {
  294. return netType_;
  295. }
  296. void CreateClusterTemplateRequest::setNetType(const std::string& netType)
  297. {
  298. netType_ = netType;
  299. setCoreParameter("NetType", netType);
  300. }
  301. std::vector<CreateClusterTemplateRequest::HostGroup> CreateClusterTemplateRequest::getHostGroup()const
  302. {
  303. return hostGroup_;
  304. }
  305. void CreateClusterTemplateRequest::setHostGroup(const std::vector<HostGroup>& hostGroup)
  306. {
  307. hostGroup_ = hostGroup;
  308. int i = 0;
  309. for(int i = 0; i!= hostGroup.size(); i++) {
  310. auto obj = hostGroup.at(i);
  311. std::string str ="HostGroup."+ std::to_string(i);
  312. setCoreParameter(str + ".Period", std::to_string(obj.period));
  313. setCoreParameter(str + ".SysDiskCapacity", std::to_string(obj.sysDiskCapacity));
  314. setCoreParameter(str + ".DiskCapacity", std::to_string(obj.diskCapacity));
  315. setCoreParameter(str + ".SysDiskType", obj.sysDiskType);
  316. setCoreParameter(str + ".ClusterId", obj.clusterId);
  317. setCoreParameter(str + ".DiskType", obj.diskType);
  318. setCoreParameter(str + ".HostGroupName", obj.hostGroupName);
  319. setCoreParameter(str + ".VSwitchId", obj.vSwitchId);
  320. setCoreParameter(str + ".DiskCount", std::to_string(obj.diskCount));
  321. setCoreParameter(str + ".AutoRenew", obj.autoRenew ? "true" : "false");
  322. setCoreParameter(str + ".HostGroupId", obj.hostGroupId);
  323. setCoreParameter(str + ".NodeCount", std::to_string(obj.nodeCount));
  324. setCoreParameter(str + ".InstanceType", obj.instanceType);
  325. setCoreParameter(str + ".Comment", obj.comment);
  326. setCoreParameter(str + ".ChargeType", obj.chargeType);
  327. setCoreParameter(str + ".MultiInstanceTypes", obj.multiInstanceTypes);
  328. setCoreParameter(str + ".CreateType", obj.createType);
  329. setCoreParameter(str + ".HostGroupType", obj.hostGroupType);
  330. }
  331. }
  332. std::string CreateClusterTemplateRequest::getZoneId()const
  333. {
  334. return zoneId_;
  335. }
  336. void CreateClusterTemplateRequest::setZoneId(const std::string& zoneId)
  337. {
  338. zoneId_ = zoneId;
  339. setCoreParameter("ZoneId", zoneId);
  340. }
  341. bool CreateClusterTemplateRequest::getUseCustomHiveMetaDb()const
  342. {
  343. return useCustomHiveMetaDb_;
  344. }
  345. void CreateClusterTemplateRequest::setUseCustomHiveMetaDb(bool useCustomHiveMetaDb)
  346. {
  347. useCustomHiveMetaDb_ = useCustomHiveMetaDb;
  348. setCoreParameter("UseCustomHiveMetaDb", useCustomHiveMetaDb ? "true" : "false");
  349. }
  350. std::vector<CreateClusterTemplateRequest::Config> CreateClusterTemplateRequest::getConfig()const
  351. {
  352. return config_;
  353. }
  354. void CreateClusterTemplateRequest::setConfig(const std::vector<Config>& config)
  355. {
  356. config_ = config;
  357. int i = 0;
  358. for(int i = 0; i!= config.size(); i++) {
  359. auto obj = config.at(i);
  360. std::string str ="Config."+ std::to_string(i);
  361. setCoreParameter(str + ".ConfigKey", obj.configKey);
  362. setCoreParameter(str + ".FileName", obj.fileName);
  363. setCoreParameter(str + ".Encrypt", obj.encrypt);
  364. setCoreParameter(str + ".Replace", obj.replace);
  365. setCoreParameter(str + ".ConfigValue", obj.configValue);
  366. setCoreParameter(str + ".ServiceName", obj.serviceName);
  367. }
  368. }
  369. bool CreateClusterTemplateRequest::getHighAvailabilityEnable()const
  370. {
  371. return highAvailabilityEnable_;
  372. }
  373. void CreateClusterTemplateRequest::setHighAvailabilityEnable(bool highAvailabilityEnable)
  374. {
  375. highAvailabilityEnable_ = highAvailabilityEnable;
  376. setCoreParameter("HighAvailabilityEnable", highAvailabilityEnable ? "true" : "false");
  377. }
  378. bool CreateClusterTemplateRequest::getInitCustomHiveMetaDb()const
  379. {
  380. return initCustomHiveMetaDb_;
  381. }
  382. void CreateClusterTemplateRequest::setInitCustomHiveMetaDb(bool initCustomHiveMetaDb)
  383. {
  384. initCustomHiveMetaDb_ = initCustomHiveMetaDb;
  385. setCoreParameter("InitCustomHiveMetaDb", initCustomHiveMetaDb ? "true" : "false");
  386. }