ws_smc.ecm 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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. ////////////////////////////////////////////////////////////
  14. #include "ws_topology.hpp"
  15. EspInclude(ws_topology);
  16. #include "ws_workunits.hpp"
  17. EspInclude(ws_workunits);
  18. ESPStruct ActiveWorkunit
  19. {
  20. string Wuid;
  21. string State;
  22. int StateID; //remove it later
  23. string Owner;
  24. string Jobname;
  25. string Server;
  26. strint Instance;
  27. string Priority;
  28. [min_ver("1.01")] string Extra;
  29. [min_ver("1.02")] string GraphName;
  30. [min_ver("1.02")] string Duration;
  31. [min_ver("1.02")] string GID;
  32. [min_ver("1.03")] string QueueName;
  33. [min_ver("1.04")] int MemoryBlocked;
  34. [min_ver("1.09")] bool IsPausing(false);
  35. [min_ver("1.10")] string Warning;
  36. [min_ver("1.15")] ClusterName;
  37. [min_ver("1.15")] string ClusterType;
  38. [min_ver("1.15")] string ClusterQueueName;
  39. [min_ver("1.16")] string TargetClusterName;
  40. };
  41. ESPStruct TargetCluster
  42. {
  43. string ClusterName;
  44. string QueueName;
  45. string QueueStatus;
  46. string StatusDetails;
  47. string Warning;
  48. int ClusterType;
  49. int ClusterSize;
  50. int ClusterStatus;
  51. };
  52. ESPStruct ThorCluster
  53. {
  54. string ClusterName;
  55. [min_ver("1.03")] string QueueName;
  56. string QueueStatus;
  57. [min_ver("1.05")] int QueueAvailable;
  58. [min_ver("1.05")] int JobsRunning;
  59. [min_ver("1.05")] int JobsInQueue;
  60. [min_ver("1.07")] int QueueStatus2;
  61. [min_ver("1.09")] string ThorLCR;
  62. [min_ver("1.11")] int ClusterSize;
  63. };
  64. ESPStruct HThorCluster
  65. {
  66. string ClusterName;
  67. string QueueName;
  68. string QueueStatus;
  69. int JobsRunning;
  70. int JobsInQueue;
  71. int QueueStatus2;
  72. int ClusterSize;
  73. };
  74. ESPStruct RoxieCluster
  75. {
  76. string ClusterName;
  77. string QueueName;
  78. string QueueStatus;
  79. int JobsRunning;
  80. int JobsInQueue;
  81. int QueueStatus2;
  82. [min_ver("1.11")] int ClusterSize;
  83. };
  84. ESPStruct DFUJob
  85. {
  86. string TimeStarted;
  87. int Done;
  88. int Total;
  89. string Command;
  90. };
  91. ESPStruct ServerJobQueue
  92. {
  93. string QueueName;
  94. string ServerName;
  95. string ServerType;
  96. string QueueStatus;
  97. [min_ver("1.17")] string StatusDetails;
  98. [min_ver("1.19")] string NetworkAddress;
  99. [min_ver("1.19")] int Port;
  100. };
  101. ESPstruct [nil_remove] StatusServerInfo
  102. {
  103. ESPstruct TargetCluster TargetClusterInfo;
  104. ESPstruct ServerJobQueue ServerInfo;
  105. ESParray<ESPstruct ActiveWorkunit> Workunits;
  106. };
  107. ESPrequest [nil_remove] ActivityRequest
  108. {
  109. string ChatURL;
  110. string BannerContent;
  111. string BannerColor;
  112. string BannerSize;
  113. string BannerScroll;
  114. int BannerAction(0);
  115. bool EnableChatURL;
  116. bool FromSubmitBtn(false);
  117. string SortBy;
  118. bool Descending(false);
  119. };
  120. ESPresponse [exceptions_inline] ActivityResponse
  121. {
  122. string Build;
  123. [depr_ver("1.16")] ESParray<ESPstruct ThorCluster> ThorClusters;
  124. [min_ver("1.07"), depr_ver("1.16")] ESParray<ESPstruct RoxieCluster> RoxieClusters;
  125. [min_ver("1.12"), depr_ver("1.16")] ESParray<ESPstruct HThorCluster> HThorClusters;
  126. [min_ver("1.16")] ESParray<ESPstruct TargetCluster> ThorClusterList;
  127. [min_ver("1.16")] ESParray<ESPstruct TargetCluster> RoxieClusterList;
  128. [min_ver("1.16")] ESParray<ESPstruct TargetCluster> HThorClusterList;
  129. ESParray<ESPstruct DFUJob> DFUJobs;
  130. ESParray<ESPstruct ActiveWorkunit> Running;
  131. [min_ver("1.06")] string BannerContent;
  132. [min_ver("1.06")] string BannerColor;
  133. [min_ver("1.06")] string BannerSize;
  134. [min_ver("1.08")] string BannerScroll;
  135. [min_ver("1.06")] string ChatURL;
  136. [min_ver("1.06")] int ShowBanner(0);
  137. [min_ver("1.06")] int ShowChatURL(0);
  138. [min_ver("1.11")] string SortBy;
  139. [min_ver("1.11")] bool Descending(false);
  140. [min_ver("1.12")] bool SuperUser(false);
  141. [min_ver("1.12")] string AccessRight;
  142. [min_ver("1.14")] ESParray<ESPstruct ServerJobQueue> ServerJobQueues;
  143. };
  144. ESPrequest SMCIndexRequest
  145. {
  146. };
  147. ESPresponse [exceptions_inline] SMCIndexResponse
  148. {
  149. };
  150. ESPStruct Capability
  151. {
  152. string name;
  153. string description;
  154. };
  155. ESPStruct Permission
  156. {
  157. string Feature;
  158. ESParray<ESPstruct Capability> Capabilities;
  159. };
  160. ESPrequest SMCPermissionsRequest
  161. {
  162. };
  163. ESPresponse [] SMCPermissionsResponse
  164. {
  165. ESParray<ESPstruct Permission> Permissions;
  166. };
  167. ESPrequest SMCQueueRequest
  168. {
  169. string Cluster;
  170. string QueueName;
  171. string Comment;
  172. [min_ver("1.19")] string ServerType;
  173. [min_ver("1.19")] string NetworkAddress;
  174. [min_ver("1.19")] int Port;
  175. };
  176. ESPresponse [exceptions_inline] SMCQueueResponse
  177. {
  178. [min_ver("1.19")] ESPstruct StatusServerInfo StatusServerInfo;
  179. };
  180. ESPrequest SMCJobRequest
  181. {
  182. int ClusterType;
  183. string Cluster;
  184. string QueueName;
  185. string Wuid;
  186. };
  187. ESPresponse [exceptions_inline] SMCJobResponse
  188. {
  189. };
  190. ESPStruct SMCJob
  191. {
  192. string Wuid;
  193. string QueueName;
  194. };
  195. ESPrequest SMCPriorityRequest
  196. {
  197. [depr_ver("1.18")] int ClusterType;
  198. [depr_ver("1.18")] string Cluster;
  199. string QueueName;
  200. string Wuid;
  201. string Priority;
  202. [min_ver("1.18")] ESParray<ESPstruct SMCJob> SMCJobs;
  203. };
  204. ESPresponse [exceptions_inline] SMCPriorityResponse
  205. {
  206. };
  207. ESPrequest GetThorQueueAvailabilityRequest
  208. {
  209. };
  210. ESPresponse [exceptions_inline] GetThorQueueAvailabilityResponse
  211. {
  212. ESParray<ESPstruct ThorCluster> ThorClusters;
  213. };
  214. ESPrequest [nil_remove] SetBannerRequest
  215. {
  216. string ChatURL;
  217. string BannerContent;
  218. string BannerColor;
  219. string BannerSize;
  220. string BannerScroll;
  221. int BannerAction;
  222. bool EnableChatURL;
  223. bool FromSubmitBtn(false);
  224. };
  225. ESPresponse [exceptions_inline] SetBannerResponse
  226. {
  227. };
  228. ESPrequest NotInCommunityEditionRequest
  229. {
  230. string EEPortal;
  231. };
  232. ESPresponse [exceptions_inline] NotInCommunityEditionResponse
  233. {
  234. };
  235. ESPStruct HPCCResource
  236. {
  237. string Name;
  238. string Description;
  239. string FileName;
  240. string Version;
  241. };
  242. ESPStruct HPCCResourceRepository
  243. {
  244. string Name;
  245. string Path;
  246. ESParray<ESPstruct HPCCResource> HPCCResources;
  247. };
  248. ESPrequest
  249. [
  250. ]
  251. BrowseResourcesRequest
  252. {
  253. };
  254. ESPresponse
  255. [
  256. exceptions_inline, nil_remove
  257. ]
  258. BrowseResourcesResponse
  259. {
  260. string PortalURL;
  261. string NetAddress;
  262. int OS;
  263. [min_ver("1.13")] bool UseResource;
  264. ESParray<ESPstruct HPCCResourceRepository> HPCCResourceRepositories;
  265. };
  266. ESPenum RoxieControlCmdType : string
  267. {
  268. ATTACH("Attach"),
  269. DETACH("Detach"),
  270. STATE("State"),
  271. RELOAD("Reload"),
  272. RELOAD_RETRY("ReloadRetry")
  273. };
  274. ESPrequest RoxieControlCmdRequest
  275. {
  276. string ProcessCluster;
  277. ESPenum RoxieControlCmdType Command;
  278. int Wait;
  279. };
  280. ESPStruct [nil_remove] RoxieControlEndpointInfo
  281. {
  282. string Address;
  283. bool Attached;
  284. string StateHash;
  285. string Status;
  286. };
  287. ESPresponse
  288. [
  289. exceptions_inline, nil_remove
  290. ]
  291. RoxieControlCmdResponse
  292. {
  293. ESParray<ESPstruct RoxieControlEndpointInfo, Endpoint> Endpoints;
  294. };
  295. ESPrequest GetStatusServerInfoRequest
  296. {
  297. string ServerName;
  298. string ServerType;
  299. string NetworkAddress;
  300. int Port;
  301. };
  302. ESPresponse
  303. [
  304. exceptions_inline, nil_remove
  305. ]
  306. GetStatusServerInfoResponse
  307. {
  308. ESPstruct StatusServerInfo StatusServerInfo;
  309. };
  310. ESPenum LockModes : string
  311. {
  312. ALL("ALL"),
  313. READ("READ"),
  314. WRITE("WRITE"),
  315. HOLD("HOLD"),
  316. SUB("SUB")
  317. };
  318. ESPStruct [nil_remove] Lock
  319. {
  320. string EPIP;
  321. string XPath;
  322. string LogicalFile;
  323. int64 SessionID;
  324. unsigned DurationMS;
  325. string TimeLocked;
  326. string Modes;
  327. ESParray<string> ModeNames;
  328. };
  329. ESPrequest [nil_remove] LockQueryRequest
  330. {
  331. string EPIP;
  332. string XPath;
  333. unsigned DurationMSLow;
  334. unsigned DurationMSHigh;
  335. string TimeLockedLow;
  336. string TimeLockedHigh;
  337. ESPenum LockModes Mode;
  338. bool AllFileLocks(false);
  339. };
  340. ESPresponse [exceptions_inline] LockQueryResponse
  341. {
  342. ESParray<ESPstruct Lock> Locks;
  343. int NumLocks;
  344. };
  345. ESPservice [auth_feature("DEFERRED"), noforms, version("1.19"), exceptions_inline("./smc_xslt/exceptions.xslt"), use_method_name] WsSMC
  346. {
  347. ESPmethod Index(SMCIndexRequest, SMCIndexResponse);
  348. ESPmethod [resp_xsl_default("/esp/xslt/index.xslt")] Activity(ActivityRequest, ActivityResponse);
  349. ESPmethod ClearQueue(SMCQueueRequest, SMCQueueResponse);
  350. ESPmethod PauseQueue(SMCQueueRequest, SMCQueueResponse);
  351. ESPmethod ResumeQueue(SMCQueueRequest, SMCQueueResponse);
  352. ESPmethod StopQueue(SMCQueueRequest, SMCQueueResponse);
  353. ESPmethod RemoveJob(SMCJobRequest, SMCJobResponse);
  354. ESPmethod MoveJobFront(SMCJobRequest, SMCJobResponse);
  355. ESPmethod MoveJobBack(SMCJobRequest, SMCJobResponse);
  356. ESPmethod MoveJobUp(SMCJobRequest, SMCJobResponse);
  357. ESPmethod MoveJobDown(SMCJobRequest, SMCJobResponse);
  358. //this one doesn't seem to do any feature level check, Kevin/Tony?
  359. ESPmethod [auth_feature("NONE")] SetJobPriority(SMCPriorityRequest, SMCPriorityResponse);
  360. ESPmethod GetThorQueueAvailability(GetThorQueueAvailabilityRequest, GetThorQueueAvailabilityResponse);
  361. //this one ensures superuser, but no feature check is done, Kevin/Tony?
  362. ESPmethod [auth_feature("NONE")] SetBanner(SetBannerRequest, SetBannerResponse);
  363. //this one ensures superuser, but no feature check is done, Kevin/Tony?
  364. ESPmethod [auth_feature("NONE")] NotInCommunityEdition(NotInCommunityEditionRequest, NotInCommunityEditionResponse);
  365. ESPmethod [resp_xsl_default("/esp/xslt/hpccresourcelist.xslt")] BrowseResources(BrowseResourcesRequest, BrowseResourcesResponse);
  366. ESPmethod RoxieControlCmd(RoxieControlCmdRequest, RoxieControlCmdResponse);
  367. //this one doesn't seem to do any feature level check, Kevin/Tony?
  368. ESPmethod [auth_feature("NONE")] GetStatusServerInfo(GetStatusServerInfoRequest, GetStatusServerInfoResponse);
  369. //this one doesn't seem to do any feature level check, Kevin/Tony?
  370. ESPmethod [auth_feature("NONE")] LockQuery(LockQueryRequest, LockQueryResponse);
  371. };
  372. SCMexportdef(WSSMC);
  373. SCMapi(WSSMC) IClientWsSMC *createWsSMCClient();