DescribeDBClusterAttributeResult.cc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  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/polardb/model/DescribeDBClusterAttributeResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Polardb;
  19. using namespace AlibabaCloud::Polardb::Model;
  20. DescribeDBClusterAttributeResult::DescribeDBClusterAttributeResult() :
  21. ServiceResult()
  22. {}
  23. DescribeDBClusterAttributeResult::DescribeDBClusterAttributeResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeDBClusterAttributeResult::~DescribeDBClusterAttributeResult()
  29. {}
  30. void DescribeDBClusterAttributeResult::parse(const std::string &payload)
  31. {
  32. Json::Reader reader;
  33. Json::Value value;
  34. reader.parse(payload, value);
  35. setRequestId(value["RequestId"].asString());
  36. auto allDBNodesNode = value["DBNodes"]["DBNode"];
  37. for (auto valueDBNodesDBNode : allDBNodesNode)
  38. {
  39. DBNode dBNodesObject;
  40. if(!valueDBNodesDBNode["CreationTime"].isNull())
  41. dBNodesObject.creationTime = valueDBNodesDBNode["CreationTime"].asString();
  42. if(!valueDBNodesDBNode["FailoverPriority"].isNull())
  43. dBNodesObject.failoverPriority = std::stoi(valueDBNodesDBNode["FailoverPriority"].asString());
  44. if(!valueDBNodesDBNode["MaxIOPS"].isNull())
  45. dBNodesObject.maxIOPS = std::stoi(valueDBNodesDBNode["MaxIOPS"].asString());
  46. if(!valueDBNodesDBNode["DBNodeClass"].isNull())
  47. dBNodesObject.dBNodeClass = valueDBNodesDBNode["DBNodeClass"].asString();
  48. if(!valueDBNodesDBNode["DBNodeRole"].isNull())
  49. dBNodesObject.dBNodeRole = valueDBNodesDBNode["DBNodeRole"].asString();
  50. if(!valueDBNodesDBNode["ZoneId"].isNull())
  51. dBNodesObject.zoneId = valueDBNodesDBNode["ZoneId"].asString();
  52. if(!valueDBNodesDBNode["MaxConnections"].isNull())
  53. dBNodesObject.maxConnections = std::stoi(valueDBNodesDBNode["MaxConnections"].asString());
  54. if(!valueDBNodesDBNode["DBNodeStatus"].isNull())
  55. dBNodesObject.dBNodeStatus = valueDBNodesDBNode["DBNodeStatus"].asString();
  56. if(!valueDBNodesDBNode["DBNodeId"].isNull())
  57. dBNodesObject.dBNodeId = valueDBNodesDBNode["DBNodeId"].asString();
  58. if(!valueDBNodesDBNode["ImciSwitch"].isNull())
  59. dBNodesObject.imciSwitch = valueDBNodesDBNode["ImciSwitch"].asString();
  60. if(!valueDBNodesDBNode["HotReplicaMode"].isNull())
  61. dBNodesObject.hotReplicaMode = valueDBNodesDBNode["HotReplicaMode"].asString();
  62. if(!valueDBNodesDBNode["AddedCpuCores"].isNull())
  63. dBNodesObject.addedCpuCores = valueDBNodesDBNode["AddedCpuCores"].asString();
  64. if(!valueDBNodesDBNode["MasterId"].isNull())
  65. dBNodesObject.masterId = valueDBNodesDBNode["MasterId"].asString();
  66. if(!valueDBNodesDBNode["SccMode"].isNull())
  67. dBNodesObject.sccMode = valueDBNodesDBNode["SccMode"].asString();
  68. if(!valueDBNodesDBNode["ServerWeight"].isNull())
  69. dBNodesObject.serverWeight = valueDBNodesDBNode["ServerWeight"].asString();
  70. if(!valueDBNodesDBNode["ServerlessType"].isNull())
  71. dBNodesObject.serverlessType = valueDBNodesDBNode["ServerlessType"].asString();
  72. dBNodes_.push_back(dBNodesObject);
  73. }
  74. auto allTagsNode = value["Tags"]["Tag"];
  75. for (auto valueTagsTag : allTagsNode)
  76. {
  77. Tag tagsObject;
  78. if(!valueTagsTag["Key"].isNull())
  79. tagsObject.key = valueTagsTag["Key"].asString();
  80. if(!valueTagsTag["Value"].isNull())
  81. tagsObject.value = valueTagsTag["Value"].asString();
  82. tags_.push_back(tagsObject);
  83. }
  84. auto relatedAPInstanceNode = value["RelatedAPInstance"];
  85. if(!relatedAPInstanceNode["Name"].isNull())
  86. relatedAPInstance_.name = relatedAPInstanceNode["Name"].asString();
  87. if(!relatedAPInstanceNode["ClassCode"].isNull())
  88. relatedAPInstance_.classCode = relatedAPInstanceNode["ClassCode"].asString();
  89. if(!relatedAPInstanceNode["OssStorageUsed"].isNull())
  90. relatedAPInstance_.ossStorageUsed = relatedAPInstanceNode["OssStorageUsed"].asString();
  91. if(!relatedAPInstanceNode["TotalAPNodes"].isNull())
  92. relatedAPInstance_.totalAPNodes = relatedAPInstanceNode["TotalAPNodes"].asString();
  93. if(!relatedAPInstanceNode["StorageUsedMB"].isNull())
  94. relatedAPInstance_.storageUsedMB = std::stof(relatedAPInstanceNode["StorageUsedMB"].asString());
  95. if(!relatedAPInstanceNode["APNodeStatus"].isNull())
  96. relatedAPInstance_.aPNodeStatus = relatedAPInstanceNode["APNodeStatus"].asString();
  97. if(!value["DeletionLock"].isNull())
  98. deletionLock_ = std::stoi(value["DeletionLock"].asString());
  99. if(!value["Category"].isNull())
  100. category_ = value["Category"].asString();
  101. if(!value["ResourceGroupId"].isNull())
  102. resourceGroupId_ = value["ResourceGroupId"].asString();
  103. if(!value["DataLevel1BackupChainSize"].isNull())
  104. dataLevel1BackupChainSize_ = std::stol(value["DataLevel1BackupChainSize"].asString());
  105. if(!value["DBClusterId"].isNull())
  106. dBClusterId_ = value["DBClusterId"].asString();
  107. if(!value["DBType"].isNull())
  108. dBType_ = value["DBType"].asString();
  109. if(!value["DBClusterNetworkType"].isNull())
  110. dBClusterNetworkType_ = value["DBClusterNetworkType"].asString();
  111. if(!value["IsLatestVersion"].isNull())
  112. isLatestVersion_ = value["IsLatestVersion"].asString() == "true";
  113. if(!value["HasCompleteStandbyRes"].isNull())
  114. hasCompleteStandbyRes_ = value["HasCompleteStandbyRes"].asString() == "true";
  115. if(!value["DataSyncMode"].isNull())
  116. dataSyncMode_ = value["DataSyncMode"].asString();
  117. if(!value["StandbyHAMode"].isNull())
  118. standbyHAMode_ = value["StandbyHAMode"].asString();
  119. if(!value["CompressStorageMode"].isNull())
  120. compressStorageMode_ = value["CompressStorageMode"].asString();
  121. if(!value["StorageMax"].isNull())
  122. storageMax_ = std::stol(value["StorageMax"].asString());
  123. if(!value["DBVersion"].isNull())
  124. dBVersion_ = value["DBVersion"].asString();
  125. if(!value["ZoneIds"].isNull())
  126. zoneIds_ = value["ZoneIds"].asString();
  127. if(!value["MaintainTime"].isNull())
  128. maintainTime_ = value["MaintainTime"].asString();
  129. if(!value["Engine"].isNull())
  130. engine_ = value["Engine"].asString();
  131. if(!value["VPCId"].isNull())
  132. vPCId_ = value["VPCId"].asString();
  133. if(!value["DBClusterStatus"].isNull())
  134. dBClusterStatus_ = value["DBClusterStatus"].asString();
  135. if(!value["VSwitchId"].isNull())
  136. vSwitchId_ = value["VSwitchId"].asString();
  137. if(!value["DBClusterDescription"].isNull())
  138. dBClusterDescription_ = value["DBClusterDescription"].asString();
  139. if(!value["Expired"].isNull())
  140. expired_ = value["Expired"].asString();
  141. if(!value["PayType"].isNull())
  142. payType_ = value["PayType"].asString();
  143. if(!value["StoragePayType"].isNull())
  144. storagePayType_ = value["StoragePayType"].asString();
  145. if(!value["LockMode"].isNull())
  146. lockMode_ = value["LockMode"].asString();
  147. if(!value["StorageUsed"].isNull())
  148. storageUsed_ = std::stol(value["StorageUsed"].asString());
  149. if(!value["CompressStorageUsed"].isNull())
  150. compressStorageUsed_ = std::stol(value["CompressStorageUsed"].asString());
  151. if(!value["StorageSpace"].isNull())
  152. storageSpace_ = std::stol(value["StorageSpace"].asString());
  153. if(!value["DBVersionStatus"].isNull())
  154. dBVersionStatus_ = value["DBVersionStatus"].asString();
  155. if(!value["CreationTime"].isNull())
  156. creationTime_ = value["CreationTime"].asString();
  157. if(!value["SQLSize"].isNull())
  158. sQLSize_ = std::stol(value["SQLSize"].asString());
  159. if(!value["InodeTotal"].isNull())
  160. inodeTotal_ = std::stol(value["InodeTotal"].asString());
  161. if(!value["InodeUsed"].isNull())
  162. inodeUsed_ = std::stol(value["InodeUsed"].asString());
  163. if(!value["BlktagTotal"].isNull())
  164. blktagTotal_ = std::stol(value["BlktagTotal"].asString());
  165. if(!value["BlktagUsed"].isNull())
  166. blktagUsed_ = std::stol(value["BlktagUsed"].asString());
  167. if(!value["RegionId"].isNull())
  168. regionId_ = value["RegionId"].asString();
  169. if(!value["ExpireTime"].isNull())
  170. expireTime_ = value["ExpireTime"].asString();
  171. if(!value["SubCategory"].isNull())
  172. subCategory_ = value["SubCategory"].asString();
  173. if(!value["DeployUnit"].isNull())
  174. deployUnit_ = value["DeployUnit"].asString();
  175. if(!value["IsProxyLatestVersion"].isNull())
  176. isProxyLatestVersion_ = value["IsProxyLatestVersion"].asString() == "true";
  177. if(!value["StorageType"].isNull())
  178. storageType_ = value["StorageType"].asString();
  179. if(!value["ServerlessType"].isNull())
  180. serverlessType_ = value["ServerlessType"].asString();
  181. if(!value["StrictConsistency"].isNull())
  182. strictConsistency_ = value["StrictConsistency"].asString();
  183. if(!value["ProxyCpuCores"].isNull())
  184. proxyCpuCores_ = value["ProxyCpuCores"].asString();
  185. if(!value["ProxyStandardCpuCores"].isNull())
  186. proxyStandardCpuCores_ = value["ProxyStandardCpuCores"].asString();
  187. if(!value["ProxyType"].isNull())
  188. proxyType_ = value["ProxyType"].asString();
  189. if(!value["ProxyStatus"].isNull())
  190. proxyStatus_ = value["ProxyStatus"].asString();
  191. if(!value["FeatureHTAPSupported"].isNull())
  192. featureHTAPSupported_ = value["FeatureHTAPSupported"].asString();
  193. if(!value["ProxyServerlessType"].isNull())
  194. proxyServerlessType_ = value["ProxyServerlessType"].asString();
  195. if(!value["AiType"].isNull())
  196. aiType_ = value["AiType"].asString();
  197. }
  198. std::string DescribeDBClusterAttributeResult::getResourceGroupId()const
  199. {
  200. return resourceGroupId_;
  201. }
  202. long DescribeDBClusterAttributeResult::getCompressStorageUsed()const
  203. {
  204. return compressStorageUsed_;
  205. }
  206. std::string DescribeDBClusterAttributeResult::getStoragePayType()const
  207. {
  208. return storagePayType_;
  209. }
  210. long DescribeDBClusterAttributeResult::getDataLevel1BackupChainSize()const
  211. {
  212. return dataLevel1BackupChainSize_;
  213. }
  214. std::string DescribeDBClusterAttributeResult::getProxyStatus()const
  215. {
  216. return proxyStatus_;
  217. }
  218. std::string DescribeDBClusterAttributeResult::getDBType()const
  219. {
  220. return dBType_;
  221. }
  222. long DescribeDBClusterAttributeResult::getBlktagUsed()const
  223. {
  224. return blktagUsed_;
  225. }
  226. std::string DescribeDBClusterAttributeResult::getStandbyHAMode()const
  227. {
  228. return standbyHAMode_;
  229. }
  230. std::string DescribeDBClusterAttributeResult::getProxyStandardCpuCores()const
  231. {
  232. return proxyStandardCpuCores_;
  233. }
  234. std::string DescribeDBClusterAttributeResult::getDBVersion()const
  235. {
  236. return dBVersion_;
  237. }
  238. std::vector<DescribeDBClusterAttributeResult::DBNode> DescribeDBClusterAttributeResult::getDBNodes()const
  239. {
  240. return dBNodes_;
  241. }
  242. std::string DescribeDBClusterAttributeResult::getFeatureHTAPSupported()const
  243. {
  244. return featureHTAPSupported_;
  245. }
  246. std::vector<DescribeDBClusterAttributeResult::Tag> DescribeDBClusterAttributeResult::getTags()const
  247. {
  248. return tags_;
  249. }
  250. std::string DescribeDBClusterAttributeResult::getEngine()const
  251. {
  252. return engine_;
  253. }
  254. std::string DescribeDBClusterAttributeResult::getStorageType()const
  255. {
  256. return storageType_;
  257. }
  258. std::string DescribeDBClusterAttributeResult::getVPCId()const
  259. {
  260. return vPCId_;
  261. }
  262. std::string DescribeDBClusterAttributeResult::getVSwitchId()const
  263. {
  264. return vSwitchId_;
  265. }
  266. std::string DescribeDBClusterAttributeResult::getDBClusterDescription()const
  267. {
  268. return dBClusterDescription_;
  269. }
  270. std::string DescribeDBClusterAttributeResult::getExpired()const
  271. {
  272. return expired_;
  273. }
  274. std::string DescribeDBClusterAttributeResult::getPayType()const
  275. {
  276. return payType_;
  277. }
  278. std::string DescribeDBClusterAttributeResult::getLockMode()const
  279. {
  280. return lockMode_;
  281. }
  282. long DescribeDBClusterAttributeResult::getStorageUsed()const
  283. {
  284. return storageUsed_;
  285. }
  286. long DescribeDBClusterAttributeResult::getInodeTotal()const
  287. {
  288. return inodeTotal_;
  289. }
  290. std::string DescribeDBClusterAttributeResult::getCompressStorageMode()const
  291. {
  292. return compressStorageMode_;
  293. }
  294. std::string DescribeDBClusterAttributeResult::getDBVersionStatus()const
  295. {
  296. return dBVersionStatus_;
  297. }
  298. std::string DescribeDBClusterAttributeResult::getProxyServerlessType()const
  299. {
  300. return proxyServerlessType_;
  301. }
  302. std::string DescribeDBClusterAttributeResult::getCreationTime()const
  303. {
  304. return creationTime_;
  305. }
  306. std::string DescribeDBClusterAttributeResult::getProxyType()const
  307. {
  308. return proxyType_;
  309. }
  310. std::string DescribeDBClusterAttributeResult::getExpireTime()const
  311. {
  312. return expireTime_;
  313. }
  314. int DescribeDBClusterAttributeResult::getDeletionLock()const
  315. {
  316. return deletionLock_;
  317. }
  318. std::string DescribeDBClusterAttributeResult::getCategory()const
  319. {
  320. return category_;
  321. }
  322. std::string DescribeDBClusterAttributeResult::getDBClusterId()const
  323. {
  324. return dBClusterId_;
  325. }
  326. std::string DescribeDBClusterAttributeResult::getDeployUnit()const
  327. {
  328. return deployUnit_;
  329. }
  330. std::string DescribeDBClusterAttributeResult::getDBClusterNetworkType()const
  331. {
  332. return dBClusterNetworkType_;
  333. }
  334. bool DescribeDBClusterAttributeResult::getIsLatestVersion()const
  335. {
  336. return isLatestVersion_;
  337. }
  338. long DescribeDBClusterAttributeResult::getStorageMax()const
  339. {
  340. return storageMax_;
  341. }
  342. std::string DescribeDBClusterAttributeResult::getZoneIds()const
  343. {
  344. return zoneIds_;
  345. }
  346. long DescribeDBClusterAttributeResult::getInodeUsed()const
  347. {
  348. return inodeUsed_;
  349. }
  350. std::string DescribeDBClusterAttributeResult::getMaintainTime()const
  351. {
  352. return maintainTime_;
  353. }
  354. long DescribeDBClusterAttributeResult::getBlktagTotal()const
  355. {
  356. return blktagTotal_;
  357. }
  358. std::string DescribeDBClusterAttributeResult::getDataSyncMode()const
  359. {
  360. return dataSyncMode_;
  361. }
  362. std::string DescribeDBClusterAttributeResult::getDBClusterStatus()const
  363. {
  364. return dBClusterStatus_;
  365. }
  366. std::string DescribeDBClusterAttributeResult::getProxyCpuCores()const
  367. {
  368. return proxyCpuCores_;
  369. }
  370. std::string DescribeDBClusterAttributeResult::getStrictConsistency()const
  371. {
  372. return strictConsistency_;
  373. }
  374. bool DescribeDBClusterAttributeResult::getIsProxyLatestVersion()const
  375. {
  376. return isProxyLatestVersion_;
  377. }
  378. long DescribeDBClusterAttributeResult::getStorageSpace()const
  379. {
  380. return storageSpace_;
  381. }
  382. std::string DescribeDBClusterAttributeResult::getServerlessType()const
  383. {
  384. return serverlessType_;
  385. }
  386. std::string DescribeDBClusterAttributeResult::getSubCategory()const
  387. {
  388. return subCategory_;
  389. }
  390. std::string DescribeDBClusterAttributeResult::getAiType()const
  391. {
  392. return aiType_;
  393. }
  394. bool DescribeDBClusterAttributeResult::getHasCompleteStandbyRes()const
  395. {
  396. return hasCompleteStandbyRes_;
  397. }
  398. DescribeDBClusterAttributeResult::RelatedAPInstance DescribeDBClusterAttributeResult::getRelatedAPInstance()const
  399. {
  400. return relatedAPInstance_;
  401. }
  402. long DescribeDBClusterAttributeResult::getSQLSize()const
  403. {
  404. return sQLSize_;
  405. }
  406. std::string DescribeDBClusterAttributeResult::getRegionId()const
  407. {
  408. return regionId_;
  409. }