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