DescribeInstanceTopologyResult.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. #ifndef ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEINSTANCETOPOLOGYRESULT_H_
  17. #define ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEINSTANCETOPOLOGYRESULT_H_
  18. #include <string>
  19. #include <vector>
  20. #include <utility>
  21. #include <alibabacloud/core/ServiceResult.h>
  22. #include <alibabacloud/oceanbasepro/OceanBaseProExport.h>
  23. namespace AlibabaCloud
  24. {
  25. namespace OceanBasePro
  26. {
  27. namespace Model
  28. {
  29. class ALIBABACLOUD_OCEANBASEPRO_EXPORT DescribeInstanceTopologyResult : public ServiceResult
  30. {
  31. public:
  32. struct InstanceTopology
  33. {
  34. struct TenantsItem
  35. {
  36. struct TenantZonesItem
  37. {
  38. struct UnitsItem
  39. {
  40. float unitCpu;
  41. long unitDataSize;
  42. std::string unitId;
  43. float unitMemory;
  44. std::string replicaType;
  45. bool enableMigrateUnit;
  46. bool enableCancelMigrateUnit;
  47. std::string nodeId;
  48. std::string unitStatus;
  49. bool manualMigrate;
  50. };
  51. std::string tenantZoneRole;
  52. std::string replicaType;
  53. bool isPrimaryTenantZone;
  54. std::string tenantZoneId;
  55. std::string logicalZone;
  56. std::vector<TenantZonesItem::UnitsItem> units;
  57. };
  58. float tenantDiskSize;
  59. std::string tenantName;
  60. std::string primaryZoneDeployType;
  61. std::string tenantId;
  62. std::string tenantStatus;
  63. float tenantMemory;
  64. std::vector<TenantsItem::TenantZonesItem> tenantZones;
  65. int tenantUnitNum;
  66. float tenantUnitMemory;
  67. float tenantUnitCpu;
  68. float tenantCpu;
  69. std::string tenantDeployType;
  70. std::string tenantMode;
  71. };
  72. struct ZonesItem
  73. {
  74. struct ZoneResource
  75. {
  76. struct DiskSize1
  77. {
  78. std::vector<std::string> maxDiskUsedObServer;
  79. double maxDiskUsedPercent;
  80. };
  81. DiskSize1 diskSize1;
  82. };
  83. struct NodesItem
  84. {
  85. struct NodeResource
  86. {
  87. struct Cpu
  88. {
  89. int totalCpu;
  90. float usedCpu;
  91. };
  92. struct Memory
  93. {
  94. float usedMemory;
  95. long totalMemory;
  96. };
  97. struct DiskSize
  98. {
  99. double usedDiskSize;
  100. double totalDiskSize;
  101. };
  102. Memory memory;
  103. DiskSize diskSize;
  104. Cpu cpu;
  105. };
  106. NodeResource nodeResource;
  107. std::string replicaType;
  108. std::string nodeId;
  109. std::string logicalZone;
  110. long readOnlyCopyId;
  111. std::string nodeStatus;
  112. long fullCopyId;
  113. long nodeCopyId;
  114. };
  115. std::string zoneId;
  116. ZoneResource zoneResource;
  117. std::string region;
  118. std::string zoneDisk;
  119. std::vector<ZonesItem::NodesItem> nodes;
  120. };
  121. struct ReplicasItem
  122. {
  123. struct ReplicaResource
  124. {
  125. struct Memory2
  126. {
  127. long usedMemory;
  128. long totalMemory;
  129. };
  130. struct DiskSize3
  131. {
  132. float usedDiskSize;
  133. long totalDiskSize;
  134. };
  135. struct Cpu4
  136. {
  137. int totalCpu;
  138. int usedCpu;
  139. };
  140. DiskSize3 diskSize3;
  141. Memory2 memory2;
  142. Cpu4 cpu4;
  143. };
  144. int zoneLogicalId;
  145. std::string status;
  146. ReplicaResource replicaResource;
  147. int nodeNum;
  148. std::string replicaType;
  149. std::string logicalZone;
  150. std::string zoneRegionName;
  151. std::string zoneLogicalName;
  152. };
  153. std::vector<TenantsItem> tenants;
  154. std::vector<ReplicasItem> replicas;
  155. std::vector<ZonesItem> zones;
  156. };
  157. DescribeInstanceTopologyResult();
  158. explicit DescribeInstanceTopologyResult(const std::string &payload);
  159. ~DescribeInstanceTopologyResult();
  160. InstanceTopology getInstanceTopology()const;
  161. protected:
  162. void parse(const std::string &payload);
  163. private:
  164. InstanceTopology instanceTopology_;
  165. };
  166. }
  167. }
  168. }
  169. #endif // !ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEINSTANCETOPOLOGYRESULT_H_