ws_configmgr.ecm 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2018 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. ESPstruct StatusMsgType
  14. {
  15. string MsgLevel; // message level ("info", "warning", "error", "fatal")
  16. string NodeId; // node identifier that generated this status message
  17. string NodeName(""); // node name (not unique, use nodeID to find node)
  18. string Attribute(""); // name of node's attribute generating the message ("" for the node itself)
  19. string Msg; // the message
  20. ESParray<string, parentId> ParentIdList;
  21. };
  22. ESPstruct StatusType
  23. {
  24. bool Error(false); // true if a message exsits in status (below) with a message level of error or higher
  25. ESParray<ESPstruct StatusMsgType, StatusMsg> StatusMessages;
  26. };
  27. ESPresponse [exceptions_inline] EmptyResponse
  28. {
  29. };
  30. ESPresponse StatusResponse
  31. {
  32. bool EnvironmentModified;
  33. ESPstruct StatusType Status;
  34. };
  35. //
  36. // Session management (not to be confused with platform session management)
  37. ESPrequest OpenSessionRequest
  38. {
  39. string Username;
  40. string SchemaPath(""); // location of configuration schema environmentFiles
  41. string MasterSchemaFile(""); // name of master schema control file
  42. string SourcePath(""); // path to envrionment files
  43. string ActivePath(""); // path to active environment file ("" for none)
  44. string PluginPaths(""); // comma separated list of paths
  45. };
  46. ESPresponse [exceptions_inline] OpenSessionResponse
  47. {
  48. string SessionId;
  49. };
  50. ESPrequest CloseSessionRequest
  51. {
  52. string SessionId;
  53. bool ForceClose(false); // set to true for force the closure of a modified environment w/o saving
  54. };
  55. ESPrequest ListOpenSessionsRequest
  56. {
  57. };
  58. ESPstruct OpenSessionInfo
  59. {
  60. string Username;
  61. string CurEnvironmentFile("");
  62. bool Locked;
  63. bool Modified;
  64. };
  65. ESPresponse [exceptions_inline] ListOpenSessionsResponse
  66. {
  67. ESParray<ESPstruct OpenSessionInfo, SessionInfo> OpenSessions;
  68. };
  69. //
  70. // Node management
  71. ESPrequest GetNodeRequest
  72. {
  73. string SessionId;
  74. string NodeId;
  75. };
  76. ESPrequest GetParentsRequest
  77. {
  78. string SessionId;
  79. string NodeId;
  80. };
  81. ESPrequest RemoveNodeRequest
  82. {
  83. string SessionId;
  84. string SessionLockKey;
  85. string NodeId;
  86. };
  87. ESPstruct DependentValueType
  88. {
  89. string AttributeName;
  90. string AttributeValue;
  91. };
  92. ESPstruct ChoiceType
  93. {
  94. string DisplayName;
  95. string Value;
  96. string Desc("");
  97. string MsgType("");
  98. string Msg("");
  99. ESParray<ESPstruct DependentValueType, dependentValue> Dependencies;
  100. ESParray<string, Attribute> OptionalAttributes; // Attributes to be enabled, but are optional if this choice is selected (UI)
  101. ESParray<string, Attribute> RequiredAttributes; // Attributes to be enabled and must be filled in (UI)
  102. };
  103. ESPstruct LimitsType
  104. {
  105. bool MinValid(false);
  106. bool MaxValid(false);
  107. int Min(0);
  108. int Max(0);
  109. bool hasChoices(false);
  110. ESParray<ESPstruct ChoiceType, Choice> ChoiceList;
  111. ESParray<string, Expr> Regex;
  112. };
  113. ESPstruct TypeInfo
  114. {
  115. string BaseType;
  116. string SubType;
  117. ESPstruct LimitsType Limits;
  118. };
  119. ESPstruct NodeInfoType
  120. {
  121. string DisplayName("");
  122. string NodeType("");
  123. string Name;
  124. string Class("");
  125. string Category("");
  126. bool Hidden(false);
  127. string Tooltip("");
  128. };
  129. ESPstruct Node
  130. {
  131. string NodeId;
  132. int NumChildren(0);
  133. ESPstruct NodeInfoType NodeInfo;
  134. };
  135. ESPstruct ChoiceLimitType
  136. {
  137. string DisplayName;
  138. string ItemType;
  139. };
  140. ESPstruct InsertItemType
  141. {
  142. string Name("");
  143. string NodeType("");
  144. string Class("");
  145. string Category("");
  146. bool Required(false);
  147. string Tooltip("");
  148. ESParray<ESPstruct ChoiceLimitType, ChoiceLimit> ChoiceList;
  149. bool FixedChoices(false);
  150. };
  151. ESPstruct AttributeType
  152. {
  153. string DisplayName;
  154. string Name;
  155. unsigned Ordinal;
  156. string Group("");
  157. string Tooltip("");
  158. ESPstruct TypeInfo Type;
  159. string CurrentValue("");
  160. string ForcedValue("");
  161. bool IsPresentInEnvironment;
  162. string PresetValue("");
  163. bool Required(true);
  164. bool ReadOnly(false);
  165. bool Hidden(false);
  166. bool Deprecated(false);
  167. ESParray<string, Modifier> Modifiers;
  168. };
  169. ESPstruct AttributeValueType
  170. {
  171. string Name;
  172. string Value;
  173. };
  174. ESPresponse [exceptions_inline] GetNodeResponse
  175. {
  176. string NodeId;
  177. ESPstruct NodeInfoType NodeInfo;
  178. ESParray<ESPstruct AttributeType, Attribute> Attributes;
  179. ESParray<ESPstruct Node, Child> Children;
  180. ESParray<ESPstruct InsertItemType, Item> Insertable; // list of insertable elements under this node
  181. ESPstruct StatusType Status;
  182. bool LocalValueDefined(false); // true if the node is configured to have a value (not usually true)
  183. ESPstruct AttributeType Value; // this would be <element>value</element> not normal, see valueDefined
  184. };
  185. ESPrequest InsertNodeRequest // response is same as GetPathRequest
  186. {
  187. string SessionId;
  188. string SessionLockKey;
  189. string ParentNodeId;
  190. string NodeType; // name of new instance to create
  191. ESParray<ESPstruct AttributeValueType, Attribute> AttributeValues;
  192. bool AllowInvalid(false); // true to allow setting an invalid value
  193. bool ForceCreate(false); // force creaation of new value if not defined
  194. string LocalValue("");
  195. };
  196. ESPrequest GetCreateNodeInfoRequest
  197. {
  198. string SessionId;
  199. string ParentNodeId;
  200. string NodeType; // name of new instance to create
  201. };
  202. ESPresponse [exceptions_inline] GetCreateNodeInfoResponse
  203. {
  204. ESPstruct NodeInfoType NodeInfo;
  205. ESParray<ESPstruct AttributeType, Attribute> Attributes;
  206. bool LocalValueDefined(false); // true if the node is configured to have a value (not usually true)
  207. ESPstruct AttributeType Value; // this would be <element>value</element> not normal, see valueDefined
  208. };
  209. ESPrequest SetValuesRequest
  210. {
  211. string SessionId;
  212. string SessionLockKey;
  213. string NodeId;
  214. ESParray<ESPstruct AttributeValueType, Attribute> AttributeValues;
  215. bool AllowInvalid(false); // true to allow setting an invalid value
  216. bool ForceCreate(false); // force creaation of new value if not defined
  217. string LocalValue("");
  218. };
  219. ESPresponse [exceptions_inline] GetParentsResponse
  220. {
  221. ESParray<string, parentId> ParentIdList;
  222. };
  223. ESPrequest GetNodeCopyRequest
  224. {
  225. string SessionId;
  226. string NodeId;
  227. };
  228. ESPresponse GetNodeCopyResponse
  229. {
  230. string ValidInsertPath(""); // path to where the copy can be inserted
  231. string NodeCopy(""); // opaque copy, DO NOT MODIFY
  232. };
  233. ESPrequest PasteNodeCopyRequest
  234. {
  235. string SessionId;
  236. string SessionLockKey;
  237. string ParentNodeId;
  238. string NodeCopy;
  239. };
  240. ESPresponse PasteNodeCopyResponse
  241. {
  242. bool NodeInserted(false);
  243. ESPstruct StatusType Status;
  244. string NewNodeId("");
  245. };
  246. //
  247. // Environment management
  248. ESPstruct EnvironmentFileType
  249. {
  250. string Filename;
  251. bool IsActive(false); // True if this is the current active environment
  252. };
  253. ESPrequest GetEnvironmentFileListRequest
  254. {
  255. string SessionId;
  256. };
  257. ESPrequest LockSessionRequest
  258. {
  259. string SessionId;
  260. };
  261. ESPresponse [exceptions_inline] GetEnvironmentListResponse
  262. {
  263. ESParray<ESPstruct EnvironmentFileType, EnvironmentFile> EnvironmentFiles;
  264. };
  265. ESPrequest OpenEnvironmentFileRequest
  266. {
  267. string SessionId;
  268. string Filename;
  269. };
  270. ESPresponse [exceptions_inline] OpenEnvironmentFileResponse
  271. {
  272. string RootNodeId;
  273. };
  274. ESPrequest CloseEnvironmentFileRequest
  275. {
  276. string SessionId;
  277. string SessionLockKey; // required if existing environment is modified and discarding changes
  278. bool DiscardChanges(false); // discard modifications
  279. };
  280. ESPrequest SaveEnvironmentFileRequest
  281. {
  282. string SessionId;
  283. string SessionLockKey; // required if saving existing environment and it has been modified
  284. string Filename(""); // empty string means to overwrite the existing file
  285. };
  286. ESPresponse [exceptions_inline] LockSessionResponse
  287. {
  288. string SessionLockKey; // filled in when a session is sucessfully locked
  289. };
  290. ESPrequest UnlockSessionRequest
  291. {
  292. string SessionId;
  293. string SessionLockKey;
  294. bool RejectIfModified(true);
  295. };
  296. ESPrequest ValidateEnvironmentRequest
  297. {
  298. string SessionId;
  299. bool IncludeHiddenNodes(false); // includes hidden nodes (hidden attributes always included)
  300. };
  301. ESPrequest GetTreeRequest
  302. {
  303. string SessionId;
  304. string NodeId;
  305. bool IncludeAttributes;
  306. int NumLevels(1);
  307. };
  308. ESPstruct TreeElementType
  309. {
  310. string NodeId;
  311. ESPstruct NodeInfoType NodeInfo;
  312. ESParray<ESPstruct AttributeType, attribute> Attributes;
  313. ESParray<ESPstruct TreeElementType, Element> Children;
  314. };
  315. ESPresponse [exceptions_inline] GetTreeResponse
  316. {
  317. ESPstruct TreeElementType Tree;
  318. };
  319. ESPrequest FetchNodesRequest
  320. {
  321. string SessionId;
  322. string StartingNodeId(""); // optional starting node for the fetch, "" for none
  323. string Path; // path to search (uses XPath syntax). If startingNodeId specified, path may not start at root ("/")
  324. };
  325. ESPresponse [exceptions_inline] FetchNodesResponse
  326. {
  327. ESParray<string, nodeId> NodeIds;
  328. };
  329. ESPrequest WizardTestRequest
  330. {
  331. string SessionId;
  332. string FqFilename;
  333. };
  334. ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt")] ws_configmgr
  335. {
  336. ESPMethod
  337. [
  338. description("Open a session with the configuration manager service")
  339. ] OpenSession(OpenSessionRequest, OpenSessionResponse);
  340. ESPMethod
  341. [
  342. description("Close a previously open session")
  343. ] CloseSession(CloseSessionRequest, EmptyResponse);
  344. ESPMethod
  345. [
  346. description("Get a list of environment files available")
  347. ] GetEnvironmentFileList(GetEnvironmentFileListRequest, GetEnvironmentListResponse);
  348. ESPMethod
  349. [
  350. description("Open an environment file")
  351. ] OpenEnvironmentFile(OpenEnvironmentFileRequest, OpenEnvironmentFileResponse);
  352. ESPMethod
  353. [
  354. description("Close an open environment file")
  355. ] CloseEnvironmentFile(CloseEnvironmentFileRequest, EmptyResponse);
  356. ESPMethod
  357. [
  358. description("Save a modifed environment file, or save to a new environment file")
  359. ] SaveEnvironmentFile(SaveEnvironmentFileRequest, EmptyResponse);
  360. ESPMethod
  361. [
  362. description("Lock a session's open environment for modification")
  363. ] LockSession(LockSessionRequest, LockSessionResponse);
  364. ESPMethod
  365. [
  366. description("Unlock a previously locked session")
  367. ] UnlockSession(UnlockSessionRequest, EmptyResponse);
  368. ESPMethod
  369. [
  370. description("Get an environment node")
  371. ] GetNode(GetNodeRequest, GetNodeResponse);
  372. ESPMethod
  373. [
  374. description("Set one or more of a node's attribute values,and/or the node's local value")
  375. ] SetValues(SetValuesRequest, StatusResponse);
  376. ESPMethod
  377. [
  378. description("Returns the nodes parents all the way to the root")
  379. ] GetParents(GetParentsRequest, GetParentsResponse);
  380. ESPMethod
  381. [
  382. description("Insert a new node into the environment")
  383. ] InsertNode(InsertNodeRequest, GetNodeResponse);
  384. ESPMethod
  385. [
  386. description("Get information to insert a new node")
  387. ] GetCreateNodeInfo(GetCreateNodeInfoRequest, GetCreateNodeInfoResponse);
  388. ESPMethod
  389. [
  390. description("Remove a node from the environment")
  391. ] RemoveNode(RemoveNodeRequest, StatusResponse);
  392. ESPMethod
  393. [
  394. description("Validate the environment")
  395. ] ValidateEnvironment(ValidateEnvironmentRequest, StatusResponse);
  396. ESPMethod
  397. [
  398. description("Return a list of open sessions")
  399. ] GetOpenSessions(ListOpenSessionsRequest, ListOpenSessionsResponse);
  400. ESPMethod
  401. [
  402. description("Return the tree of nodes beneath the indicated node for the indicated number of levels")
  403. ] GetNodeTree(GetTreeRequest, GetTreeResponse);
  404. ESPMethod
  405. [
  406. description("Fetch nodes matching the indicated path")
  407. ] FetchNodes(FetchNodesRequest, FetchNodesResponse);
  408. ESPMethod
  409. [
  410. description("Get a copy of a node for paste operations")
  411. ] GetNodeCopy(GetNodeCopyRequest, GetNodeCopyResponse);
  412. ESPMethod
  413. [
  414. description("Paste the copy of a node to an environment")
  415. ] InsertNodeCopy(PasteNodeCopyRequest, PasteNodeCopyResponse);
  416. };
  417. SCMexportdef(ws_configmgr);
  418. SCMapi(ws_configmgr) IClientws_configmgr *createws_configmgrClient();