swagger.json 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545
  1. {
  2. "basePath":"/db",
  3. "definitions":{
  4. "Error":{
  5. "description":"A human readable error mesage.",
  6. "type":"string"
  7. },
  8. "GraphQLRequest":{
  9. "properties":{
  10. "operationName":{
  11. "description":"GraphQL query operation name.",
  12. "type":"string"
  13. },
  14. "query":{
  15. "description":"GraphQL query.",
  16. "type":"string"
  17. },
  18. "variables":{
  19. "description":"GraphQL query variable values.",
  20. "type":"object"
  21. }
  22. },
  23. "type":"object"
  24. },
  25. "GroupSelectionState":{
  26. "properties":{
  27. "groups":{
  28. "description":"List of group names which include one or more selected nodes.",
  29. "items":{
  30. "description":"Group name.",
  31. "type":"string"
  32. },
  33. "type":"array"
  34. },
  35. "keys":{
  36. "description":"Lists of selected node keys which are part of the groups in the 'groups' list.",
  37. "items":{
  38. "description":"List of node keys.",
  39. "items":{
  40. "description":"Node key.",
  41. "type":"string"
  42. },
  43. "type":"array"
  44. },
  45. "type":"array"
  46. },
  47. "kinds":{
  48. "description":"Lists of selected node kinds which are part of the groups in the 'groups' list.",
  49. "items":{
  50. "description":"List of node kinds.",
  51. "items":{
  52. "description":"Node kind.",
  53. "type":"string"
  54. },
  55. "type":"array"
  56. },
  57. "type":"array"
  58. }
  59. },
  60. "type":"object"
  61. },
  62. "QueryResult":{
  63. "properties":{
  64. "groups":{
  65. "description":"Group names for each row.",
  66. "items":{
  67. "description":" Groups of the primary kind node.",
  68. "items":{
  69. "description":"Group name.",
  70. "type":"string"
  71. },
  72. "type":"array"
  73. },
  74. "type":"array"
  75. },
  76. "header":{
  77. "description":"Header for the query result.",
  78. "properties":{
  79. "data":{
  80. "description":"The data which is displayed in each column of the search result.",
  81. "items":{
  82. "description":"Data source for the column (e.g. 1:n:name - Name of starting nodes, 3:e:key - Key of edge traversed in the second traversal).",
  83. "type":"string"
  84. },
  85. "type":"array"
  86. },
  87. "format":{
  88. "description":"All column format definitions of the search result.",
  89. "items":{
  90. "description":"Column format as specified in the show format (e.g. text).",
  91. "type":"string"
  92. },
  93. "type":"array"
  94. },
  95. "labels":{
  96. "description":"All column labels of the search result.",
  97. "items":{
  98. "description":"Column label.",
  99. "type":"string"
  100. },
  101. "type":"array"
  102. }
  103. },
  104. "type":"object"
  105. },
  106. "rows":{
  107. "description":"Rows of the query result.",
  108. "items":{
  109. "description":"Columns of a row of the query result.",
  110. "items":{
  111. "description":"A single cell of the query result (string, integer or null).",
  112. "type":"object"
  113. },
  114. "type":"array"
  115. },
  116. "type":"array"
  117. },
  118. "selections":{
  119. "description":"List of row selections.",
  120. "items":{
  121. "description":"Row selection.",
  122. "type":"boolean"
  123. },
  124. "type":"array"
  125. },
  126. "sources":{
  127. "description":"Data sources of the query result.",
  128. "items":{
  129. "description":"Columns of a row of the query result.",
  130. "items":{
  131. "description":"Data source of a single cell of the query result.",
  132. "type":"string"
  133. },
  134. "type":"array"
  135. },
  136. "type":"array"
  137. },
  138. "total_selections":{
  139. "description":"Number of total selections.",
  140. "format":"integer",
  141. "type":"number"
  142. }
  143. },
  144. "type":"object"
  145. },
  146. "SelectionState":{
  147. "properties":{
  148. "keys":{
  149. "description":"Lists of selected node keys.",
  150. "items":{
  151. "description":"Node key.",
  152. "type":"string"
  153. },
  154. "type":"array"
  155. },
  156. "kinds":{
  157. "description":"Kinds of all selected nodes.",
  158. "items":{
  159. "description":"Node kind.",
  160. "type":"string"
  161. },
  162. "type":"array"
  163. }
  164. },
  165. "type":"object"
  166. }
  167. },
  168. "host":"localhost:9090",
  169. "info":{
  170. "description":"Query and modify the EliasDB datastore.",
  171. "title":"EliasDB API",
  172. "version":"1.0.0"
  173. },
  174. "paths":{
  175. "/about":{
  176. "get":{
  177. "description":"Returns available API versions, product name and product version.",
  178. "produces":[
  179. "text/plain",
  180. "application/json"
  181. ],
  182. "responses":{
  183. "200":{
  184. "description":"About info object",
  185. "schema":{
  186. "properties":{
  187. "api_versions":{
  188. "description":"List of available API versions.",
  189. "items":{
  190. "description":"Available API version.",
  191. "type":"string"
  192. },
  193. "type":"array"
  194. },
  195. "product":{
  196. "description":"Product name of the REST API provider.",
  197. "type":"string"
  198. },
  199. "version":{
  200. "description":"Version of the REST API provider.",
  201. "type":"string"
  202. }
  203. },
  204. "type":"object"
  205. }
  206. },
  207. "default":{
  208. "description":"Error response",
  209. "schema":{
  210. "$ref":"#/definitions/Error"
  211. }
  212. }
  213. },
  214. "summary":"Return information about the REST API provider."
  215. }
  216. },
  217. "/v1/blob/{partition}":{
  218. "post":{
  219. "consumes":[
  220. "application/octet-stream"
  221. ],
  222. "description":"The blob endpoint can be used to store binary data. Its location will be automatically allocated.",
  223. "parameters":[
  224. {
  225. "description":"The data to store.",
  226. "in":"body",
  227. "name":"data",
  228. "required":true,
  229. "schema":{
  230. "description":"A blob of binary data."
  231. }
  232. },
  233. {
  234. "description":"Partition to select.",
  235. "in":"path",
  236. "name":"partition",
  237. "required":true,
  238. "type":"string"
  239. }
  240. ],
  241. "produces":[
  242. "text/plain",
  243. "application/json"
  244. ],
  245. "responses":{
  246. "200":{
  247. "description":"The operation was successful.",
  248. "schema":{
  249. "properties":{
  250. "id":{
  251. "description":"The data ID which can be used to lookup the data.",
  252. "type":"number"
  253. }
  254. },
  255. "type":"object"
  256. }
  257. },
  258. "default":{
  259. "description":"Error response",
  260. "schema":{
  261. "$ref":"#/definitions/Error"
  262. }
  263. }
  264. },
  265. "summary":"Create a binary blob of data."
  266. }
  267. },
  268. "/v1/blob/{partition}/{id}":{
  269. "delete":{
  270. "description":"The blob endpoint can be used to remove binary data from a specific location.",
  271. "parameters":[
  272. {
  273. "description":"ID of the binary blob.",
  274. "in":"path",
  275. "name":"id",
  276. "required":true,
  277. "type":"string"
  278. },
  279. {
  280. "description":"Partition to select.",
  281. "in":"path",
  282. "name":"partition",
  283. "required":true,
  284. "type":"string"
  285. }
  286. ],
  287. "produces":[
  288. "text/plain"
  289. ],
  290. "responses":{
  291. "200":{
  292. "description":"The operation was successful."
  293. },
  294. "default":{
  295. "description":"Error response",
  296. "schema":{
  297. "$ref":"#/definitions/Error"
  298. }
  299. }
  300. },
  301. "summary":"Remove a binary blob of data."
  302. },
  303. "get":{
  304. "description":"The blob endpoint can be used to retrieve binary data from a specific location.",
  305. "parameters":[
  306. {
  307. "description":"ID of the binary blob.",
  308. "in":"path",
  309. "name":"id",
  310. "required":true,
  311. "type":"string"
  312. },
  313. {
  314. "description":"Partition to select.",
  315. "in":"path",
  316. "name":"partition",
  317. "required":true,
  318. "type":"string"
  319. }
  320. ],
  321. "produces":[
  322. "text/plain",
  323. "application/octet-stream"
  324. ],
  325. "responses":{
  326. "200":{
  327. "description":"The requested binary blob."
  328. },
  329. "default":{
  330. "description":"Error response",
  331. "schema":{
  332. "$ref":"#/definitions/Error"
  333. }
  334. }
  335. },
  336. "summary":"Retrieve a binary blob of data."
  337. },
  338. "put":{
  339. "description":"The blob endpoint can be used to update binary data at a specific location.",
  340. "parameters":[
  341. {
  342. "description":"ID of the binary blob.",
  343. "in":"path",
  344. "name":"id",
  345. "required":true,
  346. "type":"string"
  347. },
  348. {
  349. "description":"Partition to select.",
  350. "in":"path",
  351. "name":"partition",
  352. "required":true,
  353. "type":"string"
  354. }
  355. ],
  356. "produces":[
  357. "text/plain"
  358. ],
  359. "responses":{
  360. "200":{
  361. "description":"The operation was successful."
  362. },
  363. "default":{
  364. "description":"Error response",
  365. "schema":{
  366. "$ref":"#/definitions/Error"
  367. }
  368. }
  369. },
  370. "summary":"Update a binary blob of data."
  371. }
  372. },
  373. "/v1/cluster":{
  374. "get":{
  375. "description":"The cluster endpoint returns the cluster state info which contains cluster members and their state.",
  376. "produces":[
  377. "text/plain",
  378. "application/json"
  379. ],
  380. "responses":{
  381. "200":{
  382. "description":"A key-value map."
  383. },
  384. "default":{
  385. "description":"Error response",
  386. "schema":{
  387. "$ref":"#/definitions/Error"
  388. }
  389. }
  390. },
  391. "summary":"Return cluster specific information."
  392. }
  393. },
  394. "/v1/cluster/log":{
  395. "delete":{
  396. "description":"A delete call to the log endpoint resets the cluster related log and clears the ring buffer in memory.",
  397. "produces":[
  398. "text/plain",
  399. "application/json"
  400. ],
  401. "responses":{
  402. "200":{
  403. "description":"Cluster related log was reset."
  404. },
  405. "default":{
  406. "description":"Error response",
  407. "schema":{
  408. "$ref":"#/definitions/Error"
  409. }
  410. }
  411. },
  412. "summary":"Reset the cluster log."
  413. },
  414. "get":{
  415. "description":"The cluster log endpoint returns the latest cluster related log messages from a memory ring buffer.",
  416. "produces":[
  417. "text/plain",
  418. "application/json"
  419. ],
  420. "responses":{
  421. "200":{
  422. "description":"A list of log messages."
  423. },
  424. "default":{
  425. "description":"Error response",
  426. "schema":{
  427. "$ref":"#/definitions/Error"
  428. }
  429. }
  430. },
  431. "summary":"Return latest cluster related log messages."
  432. }
  433. },
  434. "/v1/cluster/memberinfos":{
  435. "get":{
  436. "description":"The memberinfos returns the static member info of every known cluster member. If a member is not reachable its info contains a single key-value pair with the key error and an error message as value.",
  437. "produces":[
  438. "text/plain",
  439. "application/json"
  440. ],
  441. "responses":{
  442. "200":{
  443. "description":"A map of memberinfos (keys are member names)."
  444. },
  445. "default":{
  446. "description":"Error response",
  447. "schema":{
  448. "$ref":"#/definitions/Error"
  449. }
  450. }
  451. },
  452. "summary":"Return static member info of every known cluster member."
  453. }
  454. },
  455. "/v1/cluster/{command}":{
  456. "put":{
  457. "consumes":[
  458. "application/json"
  459. ],
  460. "description":"The cluster can be controlled via this command endpoint on any member.",
  461. "parameters":[
  462. {
  463. "description":"Valid commands are: ping, join and eject.",
  464. "in":"path",
  465. "name":"command",
  466. "required":true,
  467. "type":"string"
  468. },
  469. {
  470. "description":"Arguments for a command",
  471. "in":"body",
  472. "name":"args",
  473. "required":true,
  474. "schema":{
  475. "properties":{
  476. "name":{
  477. "description":"Name of a cluster member (ping/join=member to contact, eject=member to eject).",
  478. "type":"string"
  479. },
  480. "netaddr":{
  481. "description":"Network address of a member e.g. localhost:9030 (ping/join=member address to contact)",
  482. "type":"string"
  483. }
  484. },
  485. "type":"object"
  486. }
  487. }
  488. ],
  489. "produces":[
  490. "text/plain",
  491. "application/json"
  492. ],
  493. "responses":{
  494. "200":{
  495. "description":"Only the ping command returns its result. All other positive responses are empty."
  496. },
  497. "default":{
  498. "description":"Error response",
  499. "schema":{
  500. "$ref":"#/definitions/Error"
  501. }
  502. }
  503. },
  504. "summary":"Commands can be given to the cluster by using PUT requests."
  505. }
  506. },
  507. "/v1/eql":{
  508. "post":{
  509. "consumes":[
  510. "application/json"
  511. ],
  512. "description":"The eql endpoint should be used to parse a given EQL query into an Abstract Syntax Tree or pretty print a given Abstract Syntax Tree into an EQL query.",
  513. "parameters":[
  514. {
  515. "description":"Query or AST which should be converted.",
  516. "in":"body",
  517. "name":"data",
  518. "required":true,
  519. "schema":{
  520. "properties":{
  521. "ast":{
  522. "description":"AST which should be pretty printed.",
  523. "type":"object"
  524. },
  525. "query":{
  526. "description":"Query which should be parsed.",
  527. "type":"string"
  528. }
  529. },
  530. "type":"object"
  531. }
  532. }
  533. ],
  534. "produces":[
  535. "text/plain",
  536. "application/json"
  537. ],
  538. "responses":{
  539. "200":{
  540. "description":"The operation was successful.",
  541. "schema":{
  542. "properties":{
  543. "ast":{
  544. "description":"The resulting AST if a query was parsed.",
  545. "type":"object"
  546. },
  547. "query":{
  548. "description":"The pretty printed query if an AST was given.",
  549. "type":"string"
  550. }
  551. },
  552. "type":"object"
  553. }
  554. },
  555. "default":{
  556. "description":"Error response",
  557. "schema":{
  558. "$ref":"#/definitions/Error"
  559. }
  560. }
  561. },
  562. "summary":"EQL parser and pretty printer endpoint."
  563. }
  564. },
  565. "/v1/find":{
  566. "get":{
  567. "description":"The find endpoint should be used to run simple index searches for either a value or a phrase.",
  568. "parameters":[
  569. {
  570. "description":"A word or phrase to search for.",
  571. "in":"query",
  572. "name":"text",
  573. "required":false,
  574. "type":"string"
  575. },
  576. {
  577. "description":"A node value to search for.",
  578. "in":"query",
  579. "name":"value",
  580. "required":false,
  581. "type":"string"
  582. },
  583. {
  584. "description":"Flag if a complete node lookup should be done (otherwise only key and kind are returned).",
  585. "in":"query",
  586. "name":"lookup",
  587. "required":false,
  588. "type":"boolean"
  589. },
  590. {
  591. "description":"Limit the search to a partition (without the option all partitions are searched).",
  592. "in":"query",
  593. "name":"part",
  594. "required":false,
  595. "type":"string"
  596. }
  597. ],
  598. "produces":[
  599. "text/plain",
  600. "application/json"
  601. ],
  602. "responses":{
  603. "200":{
  604. "description":"An object of search results.",
  605. "schema":{
  606. "description":"Object of results per partition.",
  607. "properties":{
  608. "partition":{
  609. "description":"Object of results per kind.",
  610. "properties":{
  611. "kind":{
  612. "description":"List of found nodes.",
  613. "items":{
  614. "description":"Found node.",
  615. "type":"object"
  616. },
  617. "type":"array"
  618. }
  619. },
  620. "type":"object"
  621. }
  622. },
  623. "type":"object"
  624. }
  625. },
  626. "default":{
  627. "description":"Error response",
  628. "schema":{
  629. "$ref":"#/definitions/Error"
  630. }
  631. }
  632. },
  633. "summary":"Run index searches on the EliasDB datastore."
  634. }
  635. },
  636. "/v1/graph/{partition}":{
  637. "post":{
  638. "consumes":[
  639. "application/json"
  640. ],
  641. "description":"A whole graph can be send. POST will store data in the datastore and always overwrite any existing data.",
  642. "parameters":[
  643. {
  644. "description":"Partition to select.",
  645. "in":"path",
  646. "name":"partition",
  647. "required":true,
  648. "type":"string"
  649. },
  650. {
  651. "description":"Nodes and Edges which should be stored",
  652. "in":"body",
  653. "name":"entities",
  654. "required":true,
  655. "schema":{
  656. "properties":{
  657. "edges":{
  658. "description":"List of edges to be inserted / updated.",
  659. "items":{
  660. "description":"Edge to be inserted / updated.",
  661. "type":"object"
  662. },
  663. "type":"array"
  664. },
  665. "nodes":{
  666. "description":"List of nodes to be inserted / updated.",
  667. "items":{
  668. "description":"Node to be inserted / updated.",
  669. "type":"object"
  670. },
  671. "type":"array"
  672. }
  673. },
  674. "type":"object"
  675. }
  676. }
  677. ],
  678. "produces":[
  679. "text/plain",
  680. "application/json"
  681. ],
  682. "responses":{
  683. "200":{
  684. "description":"No data is returned when data is created."
  685. },
  686. "default":{
  687. "description":"Error response",
  688. "schema":{
  689. "$ref":"#/definitions/Error"
  690. }
  691. }
  692. },
  693. "summary":"Data can be send by using POST requests."
  694. }
  695. },
  696. "/v1/graph/{partition}/{entity_type}":{
  697. "post":{
  698. "consumes":[
  699. "application/json"
  700. ],
  701. "description":"A list of nodes / edges can be send. POST will store data in the datastore and always overwrite any existing data.",
  702. "parameters":[
  703. {
  704. "description":"Partition to select.",
  705. "in":"path",
  706. "name":"partition",
  707. "required":true,
  708. "type":"string"
  709. },
  710. {
  711. "description":"Datastore entity type which should selected. Either n for nodes or e for edges.",
  712. "in":"path",
  713. "name":"entity_type",
  714. "required":true,
  715. "type":"string"
  716. },
  717. {
  718. "description":"Nodes or Edges which should be stored",
  719. "in":"body",
  720. "name":"entities",
  721. "required":true,
  722. "schema":{
  723. "items":{
  724. "description":"Node or edge to be inserted / updated.",
  725. "type":"object"
  726. },
  727. "type":"array"
  728. }
  729. }
  730. ],
  731. "produces":[
  732. "text/plain",
  733. "application/json"
  734. ],
  735. "responses":{
  736. "200":{
  737. "description":"No data is returned when data is created."
  738. },
  739. "default":{
  740. "description":"Error response",
  741. "schema":{
  742. "$ref":"#/definitions/Error"
  743. }
  744. }
  745. },
  746. "summary":"Data can be send by using POST requests."
  747. }
  748. },
  749. "/v1/graph/{partition}/{entity_type}/{kind}":{
  750. "get":{
  751. "description":"GET requests can be used to query a series of nodes. The X-Total-Count header contains the total number of nodes which were found.",
  752. "parameters":[
  753. {
  754. "description":"Node or edge kind to be queried.",
  755. "in":"path",
  756. "name":"kind",
  757. "required":true,
  758. "type":"string"
  759. },
  760. {
  761. "description":"Partition to select.",
  762. "in":"path",
  763. "name":"partition",
  764. "required":true,
  765. "type":"string"
  766. },
  767. {
  768. "description":"Datastore entity type which should selected. Either n for nodes or e for edges.",
  769. "in":"path",
  770. "name":"entity_type",
  771. "required":true,
  772. "type":"string"
  773. },
  774. {
  775. "description":"How many list items to return.",
  776. "format":"integer",
  777. "in":"query",
  778. "name":"limit",
  779. "required":false,
  780. "type":"number"
  781. },
  782. {
  783. "description":"Offset in the dataset.",
  784. "format":"integer",
  785. "in":"query",
  786. "name":"offset",
  787. "required":false,
  788. "type":"number"
  789. }
  790. ],
  791. "produces":[
  792. "text/plain",
  793. "application/json"
  794. ],
  795. "responses":{
  796. "200":{
  797. "description":"The return data is a list of objects",
  798. "schema":{
  799. "items":{
  800. "type":"object"
  801. },
  802. "type":"array"
  803. }
  804. },
  805. "default":{
  806. "description":"Error response",
  807. "schema":{
  808. "$ref":"#/definitions/Error"
  809. }
  810. }
  811. },
  812. "summary":"The graph endpoint is the main entry point to request data."
  813. }
  814. },
  815. "/v1/graph/{partition}/{entity_type}/{kind}/{key}":{
  816. "get":{
  817. "description":"GET requests can be used to query a single node.",
  818. "parameters":[
  819. {
  820. "description":"Node or edge kind to be queried.",
  821. "in":"path",
  822. "name":"kind",
  823. "required":true,
  824. "type":"string"
  825. },
  826. {
  827. "description":"Partition to select.",
  828. "in":"path",
  829. "name":"partition",
  830. "required":true,
  831. "type":"string"
  832. },
  833. {
  834. "description":"Datastore entity type which should selected. Either n for nodes or e for edges.",
  835. "in":"path",
  836. "name":"entity_type",
  837. "required":true,
  838. "type":"string"
  839. },
  840. {
  841. "description":"Node or edge key to be queried.",
  842. "in":"path",
  843. "name":"key",
  844. "required":true,
  845. "type":"string"
  846. },
  847. {
  848. "description":"How many list items to return.",
  849. "format":"integer",
  850. "in":"query",
  851. "name":"limit",
  852. "required":false,
  853. "type":"number"
  854. },
  855. {
  856. "description":"Offset in the dataset.",
  857. "format":"integer",
  858. "in":"query",
  859. "name":"offset",
  860. "required":false,
  861. "type":"number"
  862. }
  863. ],
  864. "produces":[
  865. "text/plain",
  866. "application/json"
  867. ],
  868. "responses":{
  869. "200":{
  870. "description":"The return data is a single object",
  871. "schema":{
  872. "type":"object"
  873. }
  874. },
  875. "default":{
  876. "description":"Error response",
  877. "schema":{
  878. "$ref":"#/definitions/Error"
  879. }
  880. }
  881. },
  882. "summary":"The graph endpoint is the main entry point to request data."
  883. }
  884. },
  885. "/v1/graph/{partition}/{entity_type}/{kind}/{key}/{traversal_spec}":{
  886. "get":{
  887. "description":"GET requests can be used to query a single node and then traverse to its neighbours.",
  888. "parameters":[
  889. {
  890. "description":"Node or edge kind to be queried.",
  891. "in":"path",
  892. "name":"kind",
  893. "required":true,
  894. "type":"string"
  895. },
  896. {
  897. "description":"Partition to select.",
  898. "in":"path",
  899. "name":"partition",
  900. "required":true,
  901. "type":"string"
  902. },
  903. {
  904. "description":"Datastore entity type which should selected. Either n for nodes or e for edges.",
  905. "in":"path",
  906. "name":"entity_type",
  907. "required":true,
  908. "type":"string"
  909. },
  910. {
  911. "description":"Node or edge key to be queried.",
  912. "in":"path",
  913. "name":"key",
  914. "required":true,
  915. "type":"string"
  916. },
  917. {
  918. "description":"Traversal to be followed from a single node.",
  919. "in":"path",
  920. "name":"traversal_spec",
  921. "required":true,
  922. "type":"string"
  923. }
  924. ],
  925. "produces":[
  926. "text/plain",
  927. "application/json"
  928. ],
  929. "responses":{
  930. "200":{
  931. "description":"The return data are two lists containing traversed nodes and edges. The traversal endpoint does NOT support limit and offset parameters. Also the X-Total-Count header is not set.",
  932. "schema":{
  933. "items":{
  934. "items":{
  935. "type":"object"
  936. },
  937. "type":"array"
  938. },
  939. "type":"array"
  940. }
  941. },
  942. "default":{
  943. "description":"Error response",
  944. "schema":{
  945. "$ref":"#/definitions/Error"
  946. }
  947. }
  948. },
  949. "summary":"The graph endpoint is the main entry point to request data."
  950. }
  951. },
  952. "/v1/graphql-query/{partition}":{
  953. "get":{
  954. "consumes":[
  955. "application/json"
  956. ],
  957. "description":"The GraphQL interface can be used to query data.",
  958. "parameters":[
  959. {
  960. "description":"Partition to query.",
  961. "in":"path",
  962. "name":"partition",
  963. "required":true,
  964. "type":"string"
  965. },
  966. {
  967. "description":"GraphQL query operation name.",
  968. "in":"query",
  969. "name":"operationName",
  970. "required":false,
  971. "type":"string"
  972. },
  973. {
  974. "description":"GraphQL query.",
  975. "in":"query",
  976. "name":"query",
  977. "required":true,
  978. "type":"string"
  979. },
  980. {
  981. "description":"GraphQL query variable values.",
  982. "in":"query",
  983. "name":"variables",
  984. "required":false,
  985. "type":"string"
  986. }
  987. ],
  988. "produces":[
  989. "text/plain",
  990. "application/json"
  991. ],
  992. "responses":{
  993. "200":{
  994. "description":"The operation was successful."
  995. },
  996. "default":{
  997. "description":"Error response",
  998. "schema":{
  999. "$ref":"#/definitions/Error"
  1000. }
  1001. }
  1002. },
  1003. "summary":"GraphQL interface which only executes non-modifying queries."
  1004. }
  1005. },
  1006. "/v1/graphql/{partition}":{
  1007. "post":{
  1008. "consumes":[
  1009. "application/json"
  1010. ],
  1011. "description":"The GraphQL interface can be used to query and modify data.",
  1012. "parameters":[
  1013. {
  1014. "description":"Partition to query.",
  1015. "in":"path",
  1016. "name":"partition",
  1017. "required":true,
  1018. "type":"string"
  1019. },
  1020. {
  1021. "description":"GraphQL request",
  1022. "in":"body",
  1023. "name":"graphql_request",
  1024. "required":true,
  1025. "schema":{
  1026. "$ref":"#/definitions/GraphQLRequest"
  1027. }
  1028. }
  1029. ],
  1030. "produces":[
  1031. "text/plain",
  1032. "application/json"
  1033. ],
  1034. "responses":{
  1035. "200":{
  1036. "description":"The operation was successful."
  1037. },
  1038. "default":{
  1039. "description":"Error response",
  1040. "schema":{
  1041. "$ref":"#/definitions/Error"
  1042. }
  1043. }
  1044. },
  1045. "summary":"GraphQL interface."
  1046. }
  1047. },
  1048. "/v1/index/{partition}/{entity_type}/{kind}":{
  1049. "get":{
  1050. "description":"The index endpoint should be used to run index searches for either a word, phrase or a whole value. All queries must specify a kind and an node/edge attribute.",
  1051. "parameters":[
  1052. {
  1053. "description":"Partition to query.",
  1054. "in":"path",
  1055. "name":"partition",
  1056. "required":true,
  1057. "type":"string"
  1058. },
  1059. {
  1060. "description":"Datastore entity type which should selected. Either n for nodes or e for edges.",
  1061. "in":"path",
  1062. "name":"entity_type",
  1063. "required":true,
  1064. "type":"string"
  1065. },
  1066. {
  1067. "description":"Node or edge kind to be queried.",
  1068. "in":"path",
  1069. "name":"kind",
  1070. "required":true,
  1071. "type":"string"
  1072. },
  1073. {
  1074. "description":"Attribute which should contain the word, phrase or value.",
  1075. "in":"query",
  1076. "name":"attr",
  1077. "required":true,
  1078. "type":"string"
  1079. },
  1080. {
  1081. "description":"Word to search for in word queries.",
  1082. "in":"query",
  1083. "name":"word",
  1084. "required":false,
  1085. "type":"string"
  1086. },
  1087. {
  1088. "description":"Phrase to search for in phrase queries.",
  1089. "in":"query",
  1090. "name":"phrase",
  1091. "required":false,
  1092. "type":"string"
  1093. },
  1094. {
  1095. "description":"Value (node/edge attribute value) to search for in value queries.",
  1096. "in":"query",
  1097. "name":"value",
  1098. "required":false,
  1099. "type":"string"
  1100. }
  1101. ],
  1102. "produces":[
  1103. "text/plain",
  1104. "application/json"
  1105. ],
  1106. "responses":{
  1107. "200":{
  1108. "description":"A list of keys or when doing a word search a map with node/edge key to word positions."
  1109. },
  1110. "default":{
  1111. "description":"Error response",
  1112. "schema":{
  1113. "$ref":"#/definitions/Error"
  1114. }
  1115. }
  1116. },
  1117. "summary":"Run index searches on the EliasDB datastore."
  1118. }
  1119. },
  1120. "/v1/info":{
  1121. "get":{
  1122. "description":"The info endpoint returns general database information such as known node kinds, known attributes, etc.",
  1123. "produces":[
  1124. "text/plain",
  1125. "application/json"
  1126. ],
  1127. "responses":{
  1128. "200":{
  1129. "description":"A key-value map."
  1130. },
  1131. "default":{
  1132. "description":"Error response",
  1133. "schema":{
  1134. "$ref":"#/definitions/Error"
  1135. }
  1136. }
  1137. },
  1138. "summary":"Return general datastore information."
  1139. }
  1140. },
  1141. "/v1/info/kind/{kind}":{
  1142. "get":{
  1143. "description":"The info kind endpoint returns information on a given node kind such as known attributes and edges.",
  1144. "parameters":[
  1145. {
  1146. "description":"Node or edge kind to be queried.",
  1147. "in":"path",
  1148. "name":"kind",
  1149. "required":true,
  1150. "type":"string"
  1151. }
  1152. ],
  1153. "produces":[
  1154. "text/plain",
  1155. "application/json"
  1156. ],
  1157. "responses":{
  1158. "200":{
  1159. "description":"A key-value map."
  1160. },
  1161. "default":{
  1162. "description":"Error response",
  1163. "schema":{
  1164. "$ref":"#/definitions/Error"
  1165. }
  1166. }
  1167. },
  1168. "summary":"Return information on a given node or edge kind."
  1169. }
  1170. },
  1171. "/v1/query/{partition}":{
  1172. "get":{
  1173. "description":"The query endpoint should be used to run EQL search queries against partitions. The return value is always a list (even if there is only a single entry). A query result gets an ID and is stored in a cache. The ID is returned in the X-Cache-Id header. Subsequent requests for the same result can use the ID instead of a query.",
  1174. "parameters":[
  1175. {
  1176. "description":"Partition to query.",
  1177. "in":"path",
  1178. "name":"partition",
  1179. "required":true,
  1180. "type":"string"
  1181. },
  1182. {
  1183. "description":"URL encoded query to execute.",
  1184. "in":"query",
  1185. "name":"q",
  1186. "required":false,
  1187. "type":"string"
  1188. },
  1189. {
  1190. "description":"Result ID to retrieve from the result cache.",
  1191. "format":"integer",
  1192. "in":"query",
  1193. "name":"rid",
  1194. "required":false,
  1195. "type":"number"
  1196. },
  1197. {
  1198. "description":"How many list items to return.",
  1199. "format":"integer",
  1200. "in":"query",
  1201. "name":"limit",
  1202. "required":false,
  1203. "type":"number"
  1204. },
  1205. {
  1206. "description":"Offset in the dataset.",
  1207. "format":"integer",
  1208. "in":"query",
  1209. "name":"offset",
  1210. "required":false,
  1211. "type":"number"
  1212. },
  1213. {
  1214. "description":"Include group information in the result if set to any value.",
  1215. "format":"integer",
  1216. "in":"query",
  1217. "name":"groups",
  1218. "required":false,
  1219. "type":"number"
  1220. }
  1221. ],
  1222. "produces":[
  1223. "text/plain",
  1224. "application/json"
  1225. ],
  1226. "responses":{
  1227. "200":{
  1228. "description":"A query result",
  1229. "schema":{
  1230. "$ref":"#/definitions/QueryResult"
  1231. }
  1232. },
  1233. "default":{
  1234. "description":"Error response",
  1235. "schema":{
  1236. "$ref":"#/definitions/Error"
  1237. }
  1238. }
  1239. },
  1240. "summary":"Run EQL queries to query the EliasDB datastore."
  1241. }
  1242. },
  1243. "/v1/queryresult/{rid}/csv":{
  1244. "get":{
  1245. "description":"The csv endpoint is used to generate a CSV string from the search result.",
  1246. "parameters":[
  1247. {
  1248. "description":"Result ID of a query result.",
  1249. "in":"path",
  1250. "name":"rid",
  1251. "required":true,
  1252. "type":"string"
  1253. }
  1254. ],
  1255. "produces":[
  1256. "text/plain"
  1257. ],
  1258. "responses":{
  1259. "200":{
  1260. "description":"A CSV string."
  1261. },
  1262. "default":{
  1263. "description":"Error response",
  1264. "schema":{
  1265. "$ref":"#/definitions/Error"
  1266. }
  1267. }
  1268. },
  1269. "summary":"Return the search result in CSV format."
  1270. }
  1271. },
  1272. "/v1/queryresult/{rid}/groupselected":{
  1273. "get":{
  1274. "description":"Returns the current selections state which contains all selected nodes which are in groups.",
  1275. "parameters":[
  1276. {
  1277. "description":"Result ID of a query result.",
  1278. "in":"path",
  1279. "name":"rid",
  1280. "required":true,
  1281. "type":"string"
  1282. }
  1283. ],
  1284. "produces":[
  1285. "text/plain",
  1286. "application/json"
  1287. ],
  1288. "responses":{
  1289. "200":{
  1290. "description":"Current group selection state.",
  1291. "schema":{
  1292. "$ref":"#/definitions/GroupSelectionState"
  1293. }
  1294. },
  1295. "default":{
  1296. "description":"Error response",
  1297. "schema":{
  1298. "$ref":"#/definitions/Error"
  1299. }
  1300. }
  1301. },
  1302. "summary":"Get the current group selection state."
  1303. },
  1304. "post":{
  1305. "description":"Sets the groups in the given selection state.",
  1306. "parameters":[
  1307. {
  1308. "description":"Result ID of a query result.",
  1309. "in":"path",
  1310. "name":"rid",
  1311. "required":true,
  1312. "type":"string"
  1313. },
  1314. {
  1315. "description":"Group seletion state of a query result",
  1316. "in":"body",
  1317. "name":"selection_state",
  1318. "required":true,
  1319. "schema":{
  1320. "$ref":"#/definitions/GroupSelectionState"
  1321. }
  1322. }
  1323. ],
  1324. "produces":[
  1325. "text/plain",
  1326. "application/json"
  1327. ],
  1328. "responses":{
  1329. "200":{
  1330. "description":"Current group selection state after the operation.",
  1331. "schema":{
  1332. "$ref":"#/definitions/GroupSelectionState"
  1333. }
  1334. },
  1335. "default":{
  1336. "description":"Error response",
  1337. "schema":{
  1338. "$ref":"#/definitions/Error"
  1339. }
  1340. }
  1341. },
  1342. "summary":"Set a new group selection state."
  1343. }
  1344. },
  1345. "/v1/queryresult/{rid}/groupselected/{group_name}":{
  1346. "delete":{
  1347. "description":"The groupselected endpoint is used to remove all selected nodes (primary node of each row) from the given (existing) group.",
  1348. "parameters":[
  1349. {
  1350. "description":"Result ID of a query result.",
  1351. "in":"path",
  1352. "name":"rid",
  1353. "required":true,
  1354. "type":"string"
  1355. },
  1356. {
  1357. "description":"Name of an existing group.",
  1358. "in":"path",
  1359. "name":"group_name",
  1360. "required":true,
  1361. "type":"string"
  1362. }
  1363. ],
  1364. "produces":[
  1365. "text/plain",
  1366. "application/json"
  1367. ],
  1368. "responses":{
  1369. "200":{
  1370. "description":"Current group selection state after the operation.",
  1371. "schema":{
  1372. "$ref":"#/definitions/GroupSelectionState"
  1373. }
  1374. },
  1375. "default":{
  1376. "description":"Error response",
  1377. "schema":{
  1378. "$ref":"#/definitions/Error"
  1379. }
  1380. }
  1381. },
  1382. "summary":"Remove all selected nodes (primary node of each row) from the given group."
  1383. },
  1384. "put":{
  1385. "description":"The groupselected endpoint is used to add all selected nodes (primary node of each row) to the given (existing) group.",
  1386. "parameters":[
  1387. {
  1388. "description":"Result ID of a query result.",
  1389. "in":"path",
  1390. "name":"rid",
  1391. "required":true,
  1392. "type":"string"
  1393. },
  1394. {
  1395. "description":"Name of an existing group.",
  1396. "in":"path",
  1397. "name":"group_name",
  1398. "required":true,
  1399. "type":"string"
  1400. }
  1401. ],
  1402. "produces":[
  1403. "text/plain",
  1404. "application/json"
  1405. ],
  1406. "responses":{
  1407. "200":{
  1408. "description":"Current group selection state after the operation.",
  1409. "schema":{
  1410. "$ref":"#/definitions/GroupSelectionState"
  1411. }
  1412. },
  1413. "default":{
  1414. "description":"Error response",
  1415. "schema":{
  1416. "$ref":"#/definitions/Error"
  1417. }
  1418. }
  1419. },
  1420. "summary":"Add all selected nodes (primary node of each row) to the given group."
  1421. }
  1422. },
  1423. "/v1/queryresult/{rid}/quickfilter/{column}":{
  1424. "get":{
  1425. "description":"The quickfilter endpoint is used to determine the 10 most frequent used values in a particular result column.",
  1426. "parameters":[
  1427. {
  1428. "description":"Result ID of a query result.",
  1429. "in":"path",
  1430. "name":"rid",
  1431. "required":true,
  1432. "type":"string"
  1433. },
  1434. {
  1435. "description":"Column of the query result.",
  1436. "in":"path",
  1437. "name":"column",
  1438. "required":true,
  1439. "type":"string"
  1440. },
  1441. {
  1442. "description":"Limit the maximum number of result items.",
  1443. "in":"query",
  1444. "name":"limit",
  1445. "required":false,
  1446. "type":"string"
  1447. }
  1448. ],
  1449. "produces":[
  1450. "text/plain",
  1451. "application/json"
  1452. ],
  1453. "responses":{
  1454. "200":{
  1455. "description":"An object containing values and frequencies."
  1456. },
  1457. "default":{
  1458. "description":"Error response",
  1459. "schema":{
  1460. "$ref":"#/definitions/Error"
  1461. }
  1462. }
  1463. },
  1464. "summary":"Return quickfilter information on a given result column."
  1465. }
  1466. },
  1467. "/v1/queryresult/{rid}/select":{
  1468. "get":{
  1469. "description":"The select endpoint is used to query all selected nodes of a given query result.",
  1470. "parameters":[
  1471. {
  1472. "description":"Result ID of a query result.",
  1473. "in":"path",
  1474. "name":"rid",
  1475. "required":true,
  1476. "type":"string"
  1477. }
  1478. ],
  1479. "produces":[
  1480. "text/plain",
  1481. "application/json"
  1482. ],
  1483. "responses":{
  1484. "200":{
  1485. "description":"Current total selections.",
  1486. "schema":{
  1487. "$ref":"#/definitions/SelectionState"
  1488. }
  1489. },
  1490. "default":{
  1491. "description":"Error response",
  1492. "schema":{
  1493. "$ref":"#/definitions/Error"
  1494. }
  1495. }
  1496. },
  1497. "summary":"Return the (primary) nodes which are currently selected."
  1498. }
  1499. },
  1500. "/v1/queryresult/{rid}/select/{row}":{
  1501. "put":{
  1502. "description":"The select endpoint is used to select one or more rows of a given query result.",
  1503. "parameters":[
  1504. {
  1505. "description":"Result ID of a query result.",
  1506. "in":"path",
  1507. "name":"rid",
  1508. "required":true,
  1509. "type":"string"
  1510. },
  1511. {
  1512. "description":"Row number of the query result or 'all', 'none' or 'invert'.",
  1513. "in":"path",
  1514. "name":"row",
  1515. "required":true,
  1516. "type":"string"
  1517. }
  1518. ],
  1519. "produces":[
  1520. "text/plain",
  1521. "application/json"
  1522. ],
  1523. "responses":{
  1524. "200":{
  1525. "description":"Current total selections."
  1526. },
  1527. "default":{
  1528. "description":"Error response",
  1529. "schema":{
  1530. "$ref":"#/definitions/Error"
  1531. }
  1532. }
  1533. },
  1534. "summary":"Selects one or more rows of a given query result."
  1535. }
  1536. }
  1537. },
  1538. "produces":[
  1539. "application/json"
  1540. ],
  1541. "schemes":[
  1542. "https"
  1543. ],
  1544. "swagger":"2.0"
  1545. }