ws_machine.ecm 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #include "xslprocessor.hpp"
  14. SCMenum ThresholdType
  15. {
  16. THRESHOLD_PERCENTAGE,
  17. THRESHOLD_MB
  18. };
  19. ESPrequest GetMachineInfoRequest
  20. {
  21. ESParray<string> Addresses;
  22. [hidden] string SortBy;
  23. TpMachineType ClusterType;
  24. string Cluster;
  25. string OldIP;
  26. string Path;
  27. string AddProcessesToFilter;
  28. bool ApplyProcessFilter;
  29. bool GetProcessorInfo;
  30. bool GetStorageInfo;
  31. [min_ver("1.11")] bool LocalFileSystemsOnly;
  32. bool GetSoftwareInfo;
  33. int MemThreshold;
  34. int DiskThreshold;
  35. int CpuThreshold;
  36. int AutoRefresh;
  37. ThresholdType MemThresholdType;
  38. ThresholdType DiskThresholdType;
  39. string UserName;
  40. [password, cols(20)] string Password;
  41. [password, cols(20)] string SecurityString;
  42. };
  43. //--define a struct that mimics GetMachineInfoRequest so it can be
  44. //--echoed back in the response
  45. //
  46. ESPstruct RequestInfoStruct
  47. {
  48. ESParray<string> Addresses;
  49. [hidden] string SortBy;
  50. TpMachineType ClusterType;
  51. string Cluster;
  52. string OldIP; //used for swap node
  53. string Path;
  54. string AddProcessesToFilter;
  55. bool ApplyProcessFilter;
  56. bool GetProcessorInfo;
  57. bool GetStorageInfo;
  58. [min_ver("1.11")] bool LocalFileSystemsOnly;
  59. bool GetSoftwareInfo;
  60. int MemThreshold;
  61. int DiskThreshold;
  62. int CpuThreshold;
  63. int AutoRefresh;
  64. ThresholdType MemThresholdType;
  65. ThresholdType DiskThresholdType;
  66. [password, cols(20)] string SecurityString;
  67. [min_ver("1.02")] string UserName;
  68. [min_ver("1.02"), password, cols(20)] string Password;
  69. [min_ver("1.03")] bool EnableSNMP;
  70. };
  71. ESPstruct ProcessorInfo
  72. {
  73. string Type;
  74. int Load;
  75. };
  76. ESPstruct StorageInfo
  77. {
  78. string Description;
  79. string Type;
  80. int64 Available;
  81. int PercentAvail;
  82. int64 Total;
  83. int Failures;
  84. };
  85. ESPstruct SWRunInfo
  86. {
  87. string Name;
  88. int Instances;
  89. int State;
  90. };
  91. ESPstruct ProcessInfo
  92. {
  93. int PID;
  94. string Description;
  95. string Parameter;
  96. };
  97. ESPStruct [nil_remove] ComponentInfo
  98. {
  99. int Condition;
  100. int State;
  101. string UpTime;//component's uptime
  102. };
  103. ESPstruct MachineInfoEx
  104. {
  105. string Address;
  106. [min_ver("1.04")] string ConfigAddress;
  107. string Name;
  108. string ProcessType;
  109. string DisplayType;
  110. string Description;
  111. string AgentVersion;
  112. string Contact;
  113. string Location;
  114. string UpTime;
  115. string ComponentName;
  116. string ComponentPath;
  117. [min_ver("1.13")] string RoxieState;
  118. [min_ver("1.13")] string RoxieStateDetails;
  119. int OS;
  120. [min_ver("1.10")] int ProcessNumber;
  121. ESParray<ESPstruct ProcessorInfo> Processors;
  122. ESParray<ESPstruct StorageInfo> Storage;
  123. ESParray<ESPstruct SWRunInfo> Running;
  124. ESPstruct StorageInfo PhysicalMemory;
  125. ESPstruct StorageInfo VirtualMemory;
  126. ESPstruct ComponentInfo ComponentInfo;
  127. };
  128. ESPresponse [encode(0), exceptions_inline] GetMachineInfoResponse
  129. {
  130. ESPstruct RequestInfoStruct RequestInfo;
  131. ESParray<string> Columns;
  132. ESParray<ESPstruct MachineInfoEx> Machines;
  133. string TimeStamp;
  134. [min_ver("1.02")] string UserName;
  135. [min_ver("1.02"), password, cols(20)] string Password;
  136. [min_ver("1.12")] string AcceptLanguage;
  137. };
  138. ESPrequest GetMachineInfoRequestEx
  139. {
  140. ESParray<string> Addresses;
  141. TpMachineType ClusterType;
  142. };
  143. ESPresponse [encode(0), exceptions_inline] GetMachineInfoResponseEx
  144. {
  145. [min_ver("1.12")] string AcceptLanguage;
  146. ESParray<ESPstruct MachineInfoEx> Machines;
  147. };
  148. //-------- GetMetrics ---------
  149. //
  150. ESPrequest MetricsRequest
  151. {
  152. [password, cols(20)] string SecurityString;
  153. ESParray<string> Addresses;
  154. ESParray<string> ShowColumns;
  155. int AutoRefresh;
  156. bool SelectAllChecked(false);
  157. [min_ver("1.02")] string Cluster;
  158. [min_ver("1.07")] bool AutoUpdate(true);
  159. };
  160. ESPresponse [encode(0), exceptions_inline] MetricsResponse
  161. {
  162. string FieldInformation;
  163. string Metrics;
  164. int AutoRefresh;
  165. [min_ver("1.02")] string Cluster;
  166. [min_ver("1.06")] bool SelectAllChecked(false);
  167. [min_ver("1.07")] bool AutoUpdate(true);
  168. [min_ver("1.12")] string AcceptLanguage;
  169. };
  170. ESPstruct RemoteExecResult
  171. {
  172. TpMachineType ClusterType;
  173. [min_ver("1.01")] string AddressOrig;
  174. string Address;
  175. string Response;
  176. int ResultCode;
  177. };
  178. ESPrequest StartStopBeginRequest
  179. {
  180. ESParray<string> Addresses;
  181. string Key1;
  182. [password, cols(20)] string Key2;
  183. bool Stop;
  184. [min_ver("1.08")] int MemThreshold;
  185. [min_ver("1.08")] int DiskThreshold;
  186. [min_ver("1.08")] int CpuThreshold;
  187. [min_ver("1.08")] int AutoRefresh;
  188. [min_ver("1.08")] ThresholdType MemThresholdType;
  189. [min_ver("1.08")] ThresholdType DiskThresholdType;
  190. };
  191. ESPresponse [exceptions_inline] StartStopBeginResponse
  192. {
  193. string Addresses;
  194. string Key1;
  195. [password, cols(20)] string Key2;
  196. bool Stop;
  197. [min_ver("1.08")] int MemThreshold;
  198. [min_ver("1.08")] int DiskThreshold;
  199. [min_ver("1.08")] int CpuThreshold;
  200. [min_ver("1.08")] int AutoRefresh;
  201. [min_ver("1.08")] ThresholdType MemThresholdType;
  202. [min_ver("1.08")] ThresholdType DiskThresholdType;
  203. };
  204. ESPrequest StartStopDoneRequest
  205. {
  206. string Addresses;
  207. string Key1;
  208. [password, cols(20)] string Key2;
  209. bool Stop;
  210. [min_ver("1.08")] int MemThreshold;
  211. [min_ver("1.08")] int DiskThreshold;
  212. [min_ver("1.08")] int CpuThreshold;
  213. [min_ver("1.08")] int AutoRefresh;
  214. [min_ver("1.08")] ThresholdType MemThresholdType;
  215. [min_ver("1.08")] ThresholdType DiskThresholdType;
  216. };
  217. ESPrequest StartStopRequest
  218. {
  219. ESParray<string> Addresses;
  220. [min_ver("1.01")] string Key1;
  221. [min_ver("1.01"), password, cols(20)] string Key2;
  222. bool Stop;
  223. };
  224. ESPstruct StartStopResult
  225. {
  226. string AddressOrig;
  227. string Address;
  228. string CompType;
  229. [min_ver("1.05")] string Name;
  230. string Path;
  231. string Command;
  232. string Response;
  233. int ResultCode;
  234. int OS;
  235. };
  236. ESPresponse [encode(0), exceptions_inline] StartStopResponse
  237. {
  238. ESParray<ESPstruct StartStopResult> StartStopResults;
  239. bool Stop;
  240. [min_ver("1.09")] bool ContainCluster;
  241. [min_ver("1.08")] int MemThreshold;
  242. [min_ver("1.08")] int DiskThreshold;
  243. [min_ver("1.08")] int CpuThreshold;
  244. [min_ver("1.08")] int AutoRefresh;
  245. [min_ver("1.08")] ThresholdType MemThresholdType;
  246. [min_ver("1.08")] ThresholdType DiskThresholdType;
  247. };
  248. ESPrequest GetTargetClusterInfoRequest
  249. {
  250. ESParray<string> TargetClusters;
  251. string AddProcessesToFilter;
  252. bool ApplyProcessFilter;
  253. bool GetProcessorInfo;
  254. bool GetStorageInfo;
  255. [min_ver("1.11")] bool LocalFileSystemsOnly;
  256. bool GetSoftwareInfo;
  257. int MemThreshold;
  258. int DiskThreshold;
  259. int CpuThreshold;
  260. int AutoRefresh;
  261. ThresholdType MemThresholdType;
  262. ThresholdType DiskThresholdType;
  263. };
  264. ESPstruct TargetClusterInfo
  265. {
  266. string Name;
  267. string Type;
  268. ESParray<ESPstruct MachineInfoEx> Processes;
  269. };
  270. ESPresponse [encode(0), exceptions_inline] GetTargetClusterInfoResponse
  271. {
  272. ESParray<string> Columns;
  273. ESPstruct RequestInfoStruct RequestInfo;
  274. ESParray<ESPstruct TargetClusterInfo> TargetClusterInfoList;
  275. string TimeStamp;
  276. [min_ver("1.12")] string AcceptLanguage;
  277. };
  278. ESPstruct [nil_remove] StatusReport
  279. {
  280. int StatusID;
  281. string Status;
  282. string StatusDetails;
  283. string Reporter;
  284. int64 TimeReported;
  285. string TimeReportedStr;
  286. string TimeCached;
  287. string URL;
  288. };
  289. ESPstruct [nil_remove] ComponentStatus
  290. {
  291. int ComponentTypeID;
  292. string ComponentType;
  293. string EndPoint;
  294. int StatusID;
  295. string Status;
  296. int64 TimeReported;
  297. string TimeReportedStr;
  298. string Reporter;
  299. ESParray<ESPstruct StatusReport> StatusReports;
  300. };
  301. ESPrequest [nil_remove] GetComponentStatusRequest
  302. {
  303. };
  304. ESPresponse [encode(0), nil_remove, exceptions_inline] GetComponentStatusResponse
  305. {
  306. int StatusCode;
  307. string Status;
  308. string ComponentType;
  309. string EndPoint;
  310. int ComponentStatusID;
  311. string ComponentStatus;
  312. int64 TimeReported;
  313. string TimeReportedStr;
  314. string Reporter;
  315. ESPstruct StatusReport StatusReport;
  316. ESParray<ESPstruct ComponentStatus, ComponentStatus> ComponentStatusList;
  317. };
  318. ESPrequest [nil_remove] UpdateComponentStatusRequest
  319. {
  320. string Reporter;
  321. ESParray<ESPstruct ComponentStatus, ComponentStatus> ComponentStatusList;
  322. };
  323. ESPresponse [encode(0), nil_remove, exceptions_inline] UpdateComponentStatusResponse
  324. {
  325. int StatusCode;
  326. string Status;
  327. };
  328. //-------- service ---------
  329. ESPservice [auth_feature("DEFERRED"), version("1.13")] ws_machine
  330. {
  331. ESPuses ESPstruct RequestInfoStruct;
  332. ESPuses ESPstruct MachineInfoEx;
  333. ESPuses ESPstruct ProcessorInfo;
  334. ESPuses ESPstruct StorageInfo;
  335. ESPuses ESPstruct SWRunInfo;
  336. ESPuses ESPstruct RemoteExecResult;
  337. ESPuses ESPStruct ComponentInfo;
  338. ESPmethod [resp_xsl_default("./smc_xslt/clusterprocesses.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
  339. GetTargetClusterInfo(GetTargetClusterInfoRequest, GetTargetClusterInfoResponse);
  340. ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/machines.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
  341. GetMachineInfo(GetMachineInfoRequest, GetMachineInfoResponse);
  342. ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/machines.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
  343. GetMachineInfoEx(GetMachineInfoRequestEx, GetMachineInfoResponseEx);
  344. ESPmethod GetComponentStatus(GetComponentStatusRequest, GetComponentStatusResponse);
  345. ESPmethod UpdateComponentStatus(UpdateComponentStatusRequest, UpdateComponentStatusResponse);
  346. ESPmethod [resp_xsl_default("./smc_xslt/ws_machine/metrics.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
  347. GetMetrics(MetricsRequest, MetricsResponse);
  348. };
  349. SCMexportdef(ws_machine);
  350. SCMapi(ws_machine) IClientws_machine *createws_machineClient();