CreateClusterV2Request.cc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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/CreateClusterV2Request.h>
  17. using AlibabaCloud::Emr::Model::CreateClusterV2Request;
  18. CreateClusterV2Request::CreateClusterV2Request() :
  19. RpcServiceRequest("emr", "2016-04-08", "CreateClusterV2")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. CreateClusterV2Request::~CreateClusterV2Request()
  24. {}
  25. bool CreateClusterV2Request::getAutoPayOrder()const
  26. {
  27. return autoPayOrder_;
  28. }
  29. void CreateClusterV2Request::setAutoPayOrder(bool autoPayOrder)
  30. {
  31. autoPayOrder_ = autoPayOrder;
  32. setParameter("AutoPayOrder", autoPayOrder ? "true" : "false");
  33. }
  34. long CreateClusterV2Request::getResourceOwnerId()const
  35. {
  36. return resourceOwnerId_;
  37. }
  38. void CreateClusterV2Request::setResourceOwnerId(long resourceOwnerId)
  39. {
  40. resourceOwnerId_ = resourceOwnerId;
  41. setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
  42. }
  43. std::string CreateClusterV2Request::getLogPath()const
  44. {
  45. return logPath_;
  46. }
  47. void CreateClusterV2Request::setLogPath(const std::string& logPath)
  48. {
  49. logPath_ = logPath;
  50. setParameter("LogPath", logPath);
  51. }
  52. std::string CreateClusterV2Request::getMasterPwd()const
  53. {
  54. return masterPwd_;
  55. }
  56. void CreateClusterV2Request::setMasterPwd(const std::string& masterPwd)
  57. {
  58. masterPwd_ = masterPwd;
  59. setParameter("MasterPwd", masterPwd);
  60. }
  61. std::string CreateClusterV2Request::getConfigurations()const
  62. {
  63. return configurations_;
  64. }
  65. void CreateClusterV2Request::setConfigurations(const std::string& configurations)
  66. {
  67. configurations_ = configurations;
  68. setParameter("Configurations", configurations);
  69. }
  70. bool CreateClusterV2Request::getSshEnable()const
  71. {
  72. return sshEnable_;
  73. }
  74. void CreateClusterV2Request::setSshEnable(bool sshEnable)
  75. {
  76. sshEnable_ = sshEnable;
  77. setParameter("SshEnable", sshEnable ? "true" : "false");
  78. }
  79. std::string CreateClusterV2Request::getKeyPairName()const
  80. {
  81. return keyPairName_;
  82. }
  83. void CreateClusterV2Request::setKeyPairName(const std::string& keyPairName)
  84. {
  85. keyPairName_ = keyPairName;
  86. setParameter("KeyPairName", keyPairName);
  87. }
  88. std::string CreateClusterV2Request::getMetaStoreType()const
  89. {
  90. return metaStoreType_;
  91. }
  92. void CreateClusterV2Request::setMetaStoreType(const std::string& metaStoreType)
  93. {
  94. metaStoreType_ = metaStoreType;
  95. setParameter("MetaStoreType", metaStoreType);
  96. }
  97. std::string CreateClusterV2Request::getSecurityGroupName()const
  98. {
  99. return securityGroupName_;
  100. }
  101. void CreateClusterV2Request::setSecurityGroupName(const std::string& securityGroupName)
  102. {
  103. securityGroupName_ = securityGroupName;
  104. setParameter("SecurityGroupName", securityGroupName);
  105. }
  106. std::string CreateClusterV2Request::getMachineType()const
  107. {
  108. return machineType_;
  109. }
  110. void CreateClusterV2Request::setMachineType(const std::string& machineType)
  111. {
  112. machineType_ = machineType;
  113. setParameter("MachineType", machineType);
  114. }
  115. std::vector<CreateClusterV2Request::HostComponentInfo> CreateClusterV2Request::getHostComponentInfo()const
  116. {
  117. return hostComponentInfo_;
  118. }
  119. void CreateClusterV2Request::setHostComponentInfo(const std::vector<HostComponentInfo>& hostComponentInfo)
  120. {
  121. hostComponentInfo_ = hostComponentInfo;
  122. for(int dep1 = 0; dep1!= hostComponentInfo.size(); dep1++) {
  123. auto hostComponentInfoObj = hostComponentInfo.at(dep1);
  124. std::string hostComponentInfoObjStr = "HostComponentInfo." + std::to_string(dep1 + 1);
  125. setParameter(hostComponentInfoObjStr + ".HostName", hostComponentInfoObj.hostName);
  126. for(int dep2 = 0; dep2!= hostComponentInfoObj.componentNameList.size(); dep2++) {
  127. setParameter(hostComponentInfoObjStr + ".ComponentNameList."+ std::to_string(dep2), hostComponentInfoObj.componentNameList.at(dep2));
  128. }
  129. setParameter(hostComponentInfoObjStr + ".ServiceName", hostComponentInfoObj.serviceName);
  130. }
  131. }
  132. std::string CreateClusterV2Request::getClickHouseConf()const
  133. {
  134. return clickHouseConf_;
  135. }
  136. void CreateClusterV2Request::setClickHouseConf(const std::string& clickHouseConf)
  137. {
  138. clickHouseConf_ = clickHouseConf;
  139. setParameter("ClickHouseConf", clickHouseConf);
  140. }
  141. std::vector<CreateClusterV2Request::BootstrapAction> CreateClusterV2Request::getBootstrapAction()const
  142. {
  143. return bootstrapAction_;
  144. }
  145. void CreateClusterV2Request::setBootstrapAction(const std::vector<BootstrapAction>& bootstrapAction)
  146. {
  147. bootstrapAction_ = bootstrapAction;
  148. for(int dep1 = 0; dep1!= bootstrapAction.size(); dep1++) {
  149. auto bootstrapActionObj = bootstrapAction.at(dep1);
  150. std::string bootstrapActionObjStr = "BootstrapAction." + std::to_string(dep1 + 1);
  151. setParameter(bootstrapActionObjStr + ".Path", bootstrapActionObj.path);
  152. setParameter(bootstrapActionObjStr + ".Arg", bootstrapActionObj.arg);
  153. setParameter(bootstrapActionObjStr + ".Name", bootstrapActionObj.name);
  154. }
  155. }
  156. std::string CreateClusterV2Request::getMetaStoreConf()const
  157. {
  158. return metaStoreConf_;
  159. }
  160. void CreateClusterV2Request::setMetaStoreConf(const std::string& metaStoreConf)
  161. {
  162. metaStoreConf_ = metaStoreConf;
  163. setParameter("MetaStoreConf", metaStoreConf);
  164. }
  165. std::string CreateClusterV2Request::getEmrVer()const
  166. {
  167. return emrVer_;
  168. }
  169. void CreateClusterV2Request::setEmrVer(const std::string& emrVer)
  170. {
  171. emrVer_ = emrVer;
  172. setParameter("EmrVer", emrVer);
  173. }
  174. std::vector<CreateClusterV2Request::Tag> CreateClusterV2Request::getTag()const
  175. {
  176. return tag_;
  177. }
  178. void CreateClusterV2Request::setTag(const std::vector<Tag>& tag)
  179. {
  180. tag_ = tag;
  181. for(int dep1 = 0; dep1!= tag.size(); dep1++) {
  182. auto tagObj = tag.at(dep1);
  183. std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
  184. setParameter(tagObjStr + ".Value", tagObj.value);
  185. setParameter(tagObjStr + ".Key", tagObj.key);
  186. }
  187. }
  188. std::string CreateClusterV2Request::getAuthorizeContent()const
  189. {
  190. return authorizeContent_;
  191. }
  192. void CreateClusterV2Request::setAuthorizeContent(const std::string& authorizeContent)
  193. {
  194. authorizeContent_ = authorizeContent;
  195. setParameter("AuthorizeContent", authorizeContent);
  196. }
  197. bool CreateClusterV2Request::getIsOpenPublicIp()const
  198. {
  199. return isOpenPublicIp_;
  200. }
  201. void CreateClusterV2Request::setIsOpenPublicIp(bool isOpenPublicIp)
  202. {
  203. isOpenPublicIp_ = isOpenPublicIp;
  204. setParameter("IsOpenPublicIp", isOpenPublicIp ? "true" : "false");
  205. }
  206. int CreateClusterV2Request::getPeriod()const
  207. {
  208. return period_;
  209. }
  210. void CreateClusterV2Request::setPeriod(int period)
  211. {
  212. period_ = period;
  213. setParameter("Period", std::to_string(period));
  214. }
  215. std::string CreateClusterV2Request::getInstanceGeneration()const
  216. {
  217. return instanceGeneration_;
  218. }
  219. void CreateClusterV2Request::setInstanceGeneration(const std::string& instanceGeneration)
  220. {
  221. instanceGeneration_ = instanceGeneration;
  222. setParameter("InstanceGeneration", instanceGeneration);
  223. }
  224. std::string CreateClusterV2Request::getVSwitchId()const
  225. {
  226. return vSwitchId_;
  227. }
  228. void CreateClusterV2Request::setVSwitchId(const std::string& vSwitchId)
  229. {
  230. vSwitchId_ = vSwitchId;
  231. setParameter("VSwitchId", vSwitchId);
  232. }
  233. std::string CreateClusterV2Request::getClusterType()const
  234. {
  235. return clusterType_;
  236. }
  237. void CreateClusterV2Request::setClusterType(const std::string& clusterType)
  238. {
  239. clusterType_ = clusterType;
  240. setParameter("ClusterType", clusterType);
  241. }
  242. bool CreateClusterV2Request::getAutoRenew()const
  243. {
  244. return autoRenew_;
  245. }
  246. void CreateClusterV2Request::setAutoRenew(bool autoRenew)
  247. {
  248. autoRenew_ = autoRenew;
  249. setParameter("AutoRenew", autoRenew ? "true" : "false");
  250. }
  251. std::vector<std::string> CreateClusterV2Request::getOptionSoftWareList()const
  252. {
  253. return optionSoftWareList_;
  254. }
  255. void CreateClusterV2Request::setOptionSoftWareList(const std::vector<std::string>& optionSoftWareList)
  256. {
  257. optionSoftWareList_ = optionSoftWareList;
  258. for(int dep1 = 0; dep1!= optionSoftWareList.size(); dep1++) {
  259. setParameter("OptionSoftWareList."+ std::to_string(dep1), optionSoftWareList.at(dep1));
  260. }
  261. }
  262. std::string CreateClusterV2Request::getNetType()const
  263. {
  264. return netType_;
  265. }
  266. void CreateClusterV2Request::setNetType(const std::string& netType)
  267. {
  268. netType_ = netType;
  269. setParameter("NetType", netType);
  270. }
  271. std::string CreateClusterV2Request::getName()const
  272. {
  273. return name_;
  274. }
  275. void CreateClusterV2Request::setName(const std::string& name)
  276. {
  277. name_ = name;
  278. setParameter("Name", name);
  279. }
  280. std::string CreateClusterV2Request::getZoneId()const
  281. {
  282. return zoneId_;
  283. }
  284. void CreateClusterV2Request::setZoneId(const std::string& zoneId)
  285. {
  286. zoneId_ = zoneId;
  287. setParameter("ZoneId", zoneId);
  288. }
  289. bool CreateClusterV2Request::getUseCustomHiveMetaDB()const
  290. {
  291. return useCustomHiveMetaDB_;
  292. }
  293. void CreateClusterV2Request::setUseCustomHiveMetaDB(bool useCustomHiveMetaDB)
  294. {
  295. useCustomHiveMetaDB_ = useCustomHiveMetaDB;
  296. setParameter("UseCustomHiveMetaDB", useCustomHiveMetaDB ? "true" : "false");
  297. }
  298. bool CreateClusterV2Request::getInitCustomHiveMetaDB()const
  299. {
  300. return initCustomHiveMetaDB_;
  301. }
  302. void CreateClusterV2Request::setInitCustomHiveMetaDB(bool initCustomHiveMetaDB)
  303. {
  304. initCustomHiveMetaDB_ = initCustomHiveMetaDB;
  305. setParameter("InitCustomHiveMetaDB", initCustomHiveMetaDB ? "true" : "false");
  306. }
  307. bool CreateClusterV2Request::getIoOptimized()const
  308. {
  309. return ioOptimized_;
  310. }
  311. void CreateClusterV2Request::setIoOptimized(bool ioOptimized)
  312. {
  313. ioOptimized_ = ioOptimized;
  314. setParameter("IoOptimized", ioOptimized ? "true" : "false");
  315. }
  316. std::string CreateClusterV2Request::getSecurityGroupId()const
  317. {
  318. return securityGroupId_;
  319. }
  320. void CreateClusterV2Request::setSecurityGroupId(const std::string& securityGroupId)
  321. {
  322. securityGroupId_ = securityGroupId;
  323. setParameter("SecurityGroupId", securityGroupId);
  324. }
  325. bool CreateClusterV2Request::getEasEnable()const
  326. {
  327. return easEnable_;
  328. }
  329. void CreateClusterV2Request::setEasEnable(bool easEnable)
  330. {
  331. easEnable_ = easEnable;
  332. setParameter("EasEnable", easEnable ? "true" : "false");
  333. }
  334. std::string CreateClusterV2Request::getDepositType()const
  335. {
  336. return depositType_;
  337. }
  338. void CreateClusterV2Request::setDepositType(const std::string& depositType)
  339. {
  340. depositType_ = depositType;
  341. setParameter("DepositType", depositType);
  342. }
  343. std::string CreateClusterV2Request::getAccessKeyId()const
  344. {
  345. return accessKeyId_;
  346. }
  347. void CreateClusterV2Request::setAccessKeyId(const std::string& accessKeyId)
  348. {
  349. accessKeyId_ = accessKeyId;
  350. setParameter("AccessKeyId", accessKeyId);
  351. }
  352. std::string CreateClusterV2Request::getRegionId()const
  353. {
  354. return regionId_;
  355. }
  356. void CreateClusterV2Request::setRegionId(const std::string& regionId)
  357. {
  358. regionId_ = regionId;
  359. setParameter("RegionId", regionId);
  360. }
  361. bool CreateClusterV2Request::getUseLocalMetaDb()const
  362. {
  363. return useLocalMetaDb_;
  364. }
  365. void CreateClusterV2Request::setUseLocalMetaDb(bool useLocalMetaDb)
  366. {
  367. useLocalMetaDb_ = useLocalMetaDb;
  368. setParameter("UseLocalMetaDb", useLocalMetaDb ? "true" : "false");
  369. }
  370. std::vector<CreateClusterV2Request::UserInfo> CreateClusterV2Request::getUserInfo()const
  371. {
  372. return userInfo_;
  373. }
  374. void CreateClusterV2Request::setUserInfo(const std::vector<UserInfo>& userInfo)
  375. {
  376. userInfo_ = userInfo;
  377. for(int dep1 = 0; dep1!= userInfo.size(); dep1++) {
  378. auto userInfoObj = userInfo.at(dep1);
  379. std::string userInfoObjStr = "UserInfo." + std::to_string(dep1 + 1);
  380. setParameter(userInfoObjStr + ".Password", userInfoObj.password);
  381. setParameter(userInfoObjStr + ".UserId", userInfoObj.userId);
  382. setParameter(userInfoObjStr + ".UserName", userInfoObj.userName);
  383. }
  384. }
  385. std::string CreateClusterV2Request::getUserDefinedEmrEcsRole()const
  386. {
  387. return userDefinedEmrEcsRole_;
  388. }
  389. void CreateClusterV2Request::setUserDefinedEmrEcsRole(const std::string& userDefinedEmrEcsRole)
  390. {
  391. userDefinedEmrEcsRole_ = userDefinedEmrEcsRole;
  392. setParameter("UserDefinedEmrEcsRole", userDefinedEmrEcsRole);
  393. }
  394. std::string CreateClusterV2Request::getWhiteListType()const
  395. {
  396. return whiteListType_;
  397. }
  398. void CreateClusterV2Request::setWhiteListType(const std::string& whiteListType)
  399. {
  400. whiteListType_ = whiteListType;
  401. setParameter("WhiteListType", whiteListType);
  402. }
  403. std::string CreateClusterV2Request::getRelatedClusterId()const
  404. {
  405. return relatedClusterId_;
  406. }
  407. void CreateClusterV2Request::setRelatedClusterId(const std::string& relatedClusterId)
  408. {
  409. relatedClusterId_ = relatedClusterId;
  410. setParameter("RelatedClusterId", relatedClusterId);
  411. }
  412. std::string CreateClusterV2Request::getVpcId()const
  413. {
  414. return vpcId_;
  415. }
  416. void CreateClusterV2Request::setVpcId(const std::string& vpcId)
  417. {
  418. vpcId_ = vpcId;
  419. setParameter("VpcId", vpcId);
  420. }
  421. std::vector<CreateClusterV2Request::HostGroup> CreateClusterV2Request::getHostGroup()const
  422. {
  423. return hostGroup_;
  424. }
  425. void CreateClusterV2Request::setHostGroup(const std::vector<HostGroup>& hostGroup)
  426. {
  427. hostGroup_ = hostGroup;
  428. for(int dep1 = 0; dep1!= hostGroup.size(); dep1++) {
  429. auto hostGroupObj = hostGroup.at(dep1);
  430. std::string hostGroupObjStr = "HostGroup." + std::to_string(dep1 + 1);
  431. setParameter(hostGroupObjStr + ".Period", std::to_string(hostGroupObj.period));
  432. setParameter(hostGroupObjStr + ".SysDiskCapacity", std::to_string(hostGroupObj.sysDiskCapacity));
  433. setParameter(hostGroupObjStr + ".DiskCapacity", std::to_string(hostGroupObj.diskCapacity));
  434. setParameter(hostGroupObjStr + ".SysDiskType", hostGroupObj.sysDiskType);
  435. setParameter(hostGroupObjStr + ".ClusterId", hostGroupObj.clusterId);
  436. setParameter(hostGroupObjStr + ".DiskType", hostGroupObj.diskType);
  437. setParameter(hostGroupObjStr + ".HostGroupName", hostGroupObj.hostGroupName);
  438. setParameter(hostGroupObjStr + ".VSwitchId", hostGroupObj.vSwitchId);
  439. setParameter(hostGroupObjStr + ".DiskCount", std::to_string(hostGroupObj.diskCount));
  440. setParameter(hostGroupObjStr + ".AutoRenew", hostGroupObj.autoRenew ? "true" : "false");
  441. setParameter(hostGroupObjStr + ".GpuDriver", hostGroupObj.gpuDriver);
  442. setParameter(hostGroupObjStr + ".HostGroupId", hostGroupObj.hostGroupId);
  443. setParameter(hostGroupObjStr + ".NodeCount", std::to_string(hostGroupObj.nodeCount));
  444. setParameter(hostGroupObjStr + ".InstanceType", hostGroupObj.instanceType);
  445. setParameter(hostGroupObjStr + ".Comment", hostGroupObj.comment);
  446. setParameter(hostGroupObjStr + ".ChargeType", hostGroupObj.chargeType);
  447. setParameter(hostGroupObjStr + ".CreateType", hostGroupObj.createType);
  448. setParameter(hostGroupObjStr + ".HostGroupType", hostGroupObj.hostGroupType);
  449. }
  450. }
  451. std::string CreateClusterV2Request::getChargeType()const
  452. {
  453. return chargeType_;
  454. }
  455. void CreateClusterV2Request::setChargeType(const std::string& chargeType)
  456. {
  457. chargeType_ = chargeType;
  458. setParameter("ChargeType", chargeType);
  459. }
  460. std::vector<CreateClusterV2Request::ServiceInfo> CreateClusterV2Request::getServiceInfo()const
  461. {
  462. return serviceInfo_;
  463. }
  464. void CreateClusterV2Request::setServiceInfo(const std::vector<ServiceInfo>& serviceInfo)
  465. {
  466. serviceInfo_ = serviceInfo;
  467. for(int dep1 = 0; dep1!= serviceInfo.size(); dep1++) {
  468. auto serviceInfoObj = serviceInfo.at(dep1);
  469. std::string serviceInfoObjStr = "ServiceInfo." + std::to_string(dep1 + 1);
  470. setParameter(serviceInfoObjStr + ".ServiceVersion", serviceInfoObj.serviceVersion);
  471. setParameter(serviceInfoObjStr + ".ServiceName", serviceInfoObj.serviceName);
  472. }
  473. }
  474. std::vector<CreateClusterV2Request::Config> CreateClusterV2Request::getConfig()const
  475. {
  476. return config_;
  477. }
  478. void CreateClusterV2Request::setConfig(const std::vector<Config>& config)
  479. {
  480. config_ = config;
  481. for(int dep1 = 0; dep1!= config.size(); dep1++) {
  482. auto configObj = config.at(dep1);
  483. std::string configObjStr = "Config." + std::to_string(dep1 + 1);
  484. setParameter(configObjStr + ".ConfigKey", configObj.configKey);
  485. setParameter(configObjStr + ".FileName", configObj.fileName);
  486. setParameter(configObjStr + ".Encrypt", configObj.encrypt);
  487. setParameter(configObjStr + ".Replace", configObj.replace);
  488. setParameter(configObjStr + ".ConfigValue", configObj.configValue);
  489. setParameter(configObjStr + ".ServiceName", configObj.serviceName);
  490. }
  491. }
  492. bool CreateClusterV2Request::getHighAvailabilityEnable()const
  493. {
  494. return highAvailabilityEnable_;
  495. }
  496. void CreateClusterV2Request::setHighAvailabilityEnable(bool highAvailabilityEnable)
  497. {
  498. highAvailabilityEnable_ = highAvailabilityEnable;
  499. setParameter("HighAvailabilityEnable", highAvailabilityEnable ? "true" : "false");
  500. }