ws_smc.ecm 11 KB

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