swagger.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. {
  2. "basePath":"/fs",
  3. "definitions":{
  4. "Error":{
  5. "description":"A human readable error mesage.",
  6. "type":"string"
  7. }
  8. },
  9. "host":"localhost:9040",
  10. "info":{
  11. "description":"Query and control the Remote Union File System.",
  12. "title":"RUFS API",
  13. "version":"1.0.0"
  14. },
  15. "paths":{
  16. "/about":{
  17. "get":{
  18. "description":"Returns available API versions, product name and product version.",
  19. "produces":[
  20. "application/json"
  21. ],
  22. "responses":{
  23. "200":{
  24. "description":"About info object",
  25. "schema":{
  26. "properties":{
  27. "api_versions":{
  28. "description":"List of available API versions.",
  29. "items":{
  30. "description":"Available API version.",
  31. "type":"string"
  32. },
  33. "type":"array"
  34. },
  35. "product":{
  36. "description":"Product name of the REST API provider.",
  37. "type":"string"
  38. },
  39. "version":{
  40. "description":"Version of the REST API provider.",
  41. "type":"string"
  42. }
  43. },
  44. "type":"object"
  45. }
  46. },
  47. "default":{
  48. "description":"Error response",
  49. "schema":{
  50. "$ref":"#/definitions/Error"
  51. }
  52. }
  53. },
  54. "summary":"Return information about the REST API provider."
  55. }
  56. },
  57. "/v1/admin":{
  58. "get":{
  59. "description":"All current tree configurations; each object has a list of all known branches and the current mapping.",
  60. "parameters":[
  61. {
  62. "description":"Refresh a particular tree (reload branches and mappings).",
  63. "in":"query",
  64. "name":"refresh",
  65. "required":false,
  66. "type":"string"
  67. }
  68. ],
  69. "produces":[
  70. "text/plain",
  71. "application/json"
  72. ],
  73. "responses":{
  74. "200":{
  75. "description":"A key-value map of tree name to tree configuration"
  76. },
  77. "default":{
  78. "description":"Error response",
  79. "schema":{
  80. "$ref":"#/definitions/Error"
  81. }
  82. }
  83. },
  84. "summary":"Return all current tree configurations."
  85. },
  86. "post":{
  87. "consumes":[
  88. "application/json"
  89. ],
  90. "description":"Create a new named tree.",
  91. "parameters":[
  92. {
  93. "description":"Name of the new tree.",
  94. "in":"body",
  95. "name":"data",
  96. "required":true,
  97. "schema":{
  98. "type":"string"
  99. }
  100. }
  101. ],
  102. "produces":[
  103. "text/plain"
  104. ],
  105. "responses":{
  106. "200":{
  107. "description":"Returns an empty body if successful."
  108. },
  109. "default":{
  110. "description":"Error response",
  111. "schema":{
  112. "$ref":"#/definitions/Error"
  113. }
  114. }
  115. },
  116. "summary":"Create a new tree."
  117. }
  118. },
  119. "/v1/admin/{tree}":{
  120. "delete":{
  121. "description":"Delete a named tree.",
  122. "parameters":[
  123. {
  124. "description":"Name of the tree.",
  125. "in":"path",
  126. "name":"tree",
  127. "required":true,
  128. "type":"string"
  129. }
  130. ],
  131. "produces":[
  132. "text/plain"
  133. ],
  134. "responses":{
  135. "200":{
  136. "description":"Returns an empty body if successful."
  137. },
  138. "default":{
  139. "description":"Error response",
  140. "schema":{
  141. "$ref":"#/definitions/Error"
  142. }
  143. }
  144. },
  145. "summary":"Delete a tree."
  146. }
  147. },
  148. "/v1/admin/{tree}/branch":{
  149. "post":{
  150. "consumes":[
  151. "application/json"
  152. ],
  153. "description":"Add a new remote branch to the tree.",
  154. "parameters":[
  155. {
  156. "description":"Name of the tree.",
  157. "in":"path",
  158. "name":"tree",
  159. "required":true,
  160. "type":"string"
  161. },
  162. {
  163. "description":"Definition of the new branch.",
  164. "in":"body",
  165. "name":"data",
  166. "required":true,
  167. "schema":{
  168. "properties":{
  169. "branch":{
  170. "description":"Name of the remote branch (must match on the remote branch).",
  171. "type":"string"
  172. },
  173. "fingerprint":{
  174. "description":"Expected SSL fingerprint of the remote branch (shown during startup) or an empty string.",
  175. "type":"string"
  176. },
  177. "rpc":{
  178. "description":"RPC definition of the remote branch (e.g. localhost:9020).",
  179. "type":"string"
  180. }
  181. },
  182. "type":"object"
  183. }
  184. }
  185. ],
  186. "produces":[
  187. "text/plain"
  188. ],
  189. "responses":{
  190. "200":{
  191. "description":"Returns an empty body if successful."
  192. },
  193. "default":{
  194. "description":"Error response",
  195. "schema":{
  196. "$ref":"#/definitions/Error"
  197. }
  198. }
  199. },
  200. "summary":"Add a new branch."
  201. }
  202. },
  203. "/v1/admin/{tree}/mapping":{
  204. "post":{
  205. "consumes":[
  206. "application/json"
  207. ],
  208. "description":"Add a new mapping to the tree.",
  209. "parameters":[
  210. {
  211. "description":"Name of the tree.",
  212. "in":"path",
  213. "name":"tree",
  214. "required":true,
  215. "type":"string"
  216. },
  217. {
  218. "description":"Definition of the new branch.",
  219. "in":"body",
  220. "name":"data",
  221. "required":true,
  222. "schema":{
  223. "properties":{
  224. "branch":{
  225. "description":"Name of the known remote branch.",
  226. "type":"string"
  227. },
  228. "dir":{
  229. "description":"Tree directory which should hold the branch root.",
  230. "type":"string"
  231. },
  232. "writable":{
  233. "description":"Flag if the branch should be mapped as writable.",
  234. "type":"string"
  235. }
  236. },
  237. "type":"object"
  238. }
  239. }
  240. ],
  241. "produces":[
  242. "text/plain"
  243. ],
  244. "responses":{
  245. "200":{
  246. "description":"Returns an empty body if successful."
  247. },
  248. "default":{
  249. "description":"Error response",
  250. "schema":{
  251. "$ref":"#/definitions/Error"
  252. }
  253. }
  254. },
  255. "summary":"Add a new mapping."
  256. }
  257. },
  258. "/v1/dir/{tree}/{path}":{
  259. "get":{
  260. "description":"List the contents of a directory.",
  261. "parameters":[
  262. {
  263. "description":"Name of the tree.",
  264. "in":"path",
  265. "name":"tree",
  266. "required":true,
  267. "type":"string"
  268. },
  269. {
  270. "description":"Directory path.",
  271. "in":"path",
  272. "name":"path",
  273. "required":true,
  274. "type":"string"
  275. },
  276. {
  277. "description":"Add listings of subdirectories.",
  278. "in":"query",
  279. "name":"recursive",
  280. "required":false,
  281. "type":"boolean"
  282. },
  283. {
  284. "description":"Include file checksums.",
  285. "in":"query",
  286. "name":"checksums",
  287. "required":false,
  288. "type":"boolean"
  289. }
  290. ],
  291. "produces":[
  292. "text/plain",
  293. "application/json"
  294. ],
  295. "responses":{
  296. "200":{
  297. "description":"Returns a map of directories with a list of files as values."
  298. },
  299. "default":{
  300. "description":"Error response",
  301. "schema":{
  302. "$ref":"#/definitions/Error"
  303. }
  304. }
  305. },
  306. "summary":"Read a directory."
  307. }
  308. },
  309. "/v1/file/{tree}/{path}":{
  310. "delete":{
  311. "description":"Delete a file or directory.",
  312. "parameters":[
  313. {
  314. "description":"Name of the tree.",
  315. "in":"path",
  316. "name":"tree",
  317. "required":true,
  318. "type":"string"
  319. },
  320. {
  321. "description":"File or directory path.",
  322. "in":"path",
  323. "name":"path",
  324. "required":true,
  325. "type":"string"
  326. },
  327. {
  328. "description":"List of (full path) files which should be deleted",
  329. "in":"body",
  330. "name":"filelist",
  331. "required":false,
  332. "schema":{
  333. "items":{
  334. "description":"File (with full path) which should be deleted.",
  335. "type":"string"
  336. },
  337. "type":"array"
  338. }
  339. }
  340. ],
  341. "produces":[
  342. "text/plain"
  343. ],
  344. "responses":{
  345. "200":{
  346. "description":"Returns the content of the requested file."
  347. },
  348. "default":{
  349. "description":"Error response",
  350. "schema":{
  351. "$ref":"#/definitions/Error"
  352. }
  353. }
  354. },
  355. "summary":"Delete a file or directory."
  356. },
  357. "get":{
  358. "description":"Return the contents of a file.",
  359. "parameters":[
  360. {
  361. "description":"Name of the tree.",
  362. "in":"path",
  363. "name":"tree",
  364. "required":true,
  365. "type":"string"
  366. },
  367. {
  368. "description":"File path.",
  369. "in":"path",
  370. "name":"path",
  371. "required":true,
  372. "type":"string"
  373. }
  374. ],
  375. "produces":[
  376. "text/plain",
  377. "application/octet-stream"
  378. ],
  379. "responses":{
  380. "200":{
  381. "description":"Returns the content of the requested file."
  382. },
  383. "default":{
  384. "description":"Error response",
  385. "schema":{
  386. "$ref":"#/definitions/Error"
  387. }
  388. }
  389. },
  390. "summary":"Read a file."
  391. },
  392. "post":{
  393. "consumes":[
  394. "multipart/form-data"
  395. ],
  396. "description":"Upload or overwrite a file.",
  397. "parameters":[
  398. {
  399. "description":"Name of the tree.",
  400. "in":"path",
  401. "name":"tree",
  402. "required":true,
  403. "type":"string"
  404. },
  405. {
  406. "description":"File path.",
  407. "in":"path",
  408. "name":"path",
  409. "required":true,
  410. "type":"string"
  411. },
  412. {
  413. "description":"Page to redirect to after processing the request.",
  414. "in":"formData",
  415. "name":"redirect",
  416. "required":false,
  417. "type":"string"
  418. },
  419. {
  420. "description":"File(s) to create / overwrite.",
  421. "in":"formData",
  422. "name":"uploadfile",
  423. "required":true,
  424. "type":"file"
  425. }
  426. ],
  427. "produces":[
  428. "text/plain"
  429. ],
  430. "responses":{
  431. "200":{
  432. "description":"Successful upload no redirect parameter given."
  433. },
  434. "302":{
  435. "description":"Successful upload - redirect according to the given redirect parameter."
  436. },
  437. "default":{
  438. "description":"Error response",
  439. "schema":{
  440. "$ref":"#/definitions/Error"
  441. }
  442. }
  443. },
  444. "summary":"Upload a file."
  445. },
  446. "put":{
  447. "consumes":[
  448. "application/json"
  449. ],
  450. "description":"Perform a file operation like rename or copy.",
  451. "parameters":[
  452. {
  453. "description":"Name of the tree.",
  454. "in":"path",
  455. "name":"tree",
  456. "required":true,
  457. "type":"string"
  458. },
  459. {
  460. "description":"File path.",
  461. "in":"path",
  462. "name":"path",
  463. "required":true,
  464. "type":"string"
  465. },
  466. {
  467. "description":"Operation which should be executes",
  468. "in":"body",
  469. "name":"operation",
  470. "required":true,
  471. "schema":{
  472. "properties":{
  473. "action":{
  474. "description":"Action to perform.",
  475. "enum":[
  476. "rename",
  477. "mkdir",
  478. "copy",
  479. "sync"
  480. ],
  481. "type":"string"
  482. },
  483. "destination":{
  484. "description":"Destination directory when copying files.",
  485. "type":"string"
  486. },
  487. "files":{
  488. "description":"List of (full path) files which should be copied / renamed.",
  489. "items":{
  490. "description":"File (with full path) which should be copied / renamed.",
  491. "type":"string"
  492. },
  493. "type":"array"
  494. },
  495. "newname":{
  496. "description":"New filename when renaming a single file.",
  497. "type":"string"
  498. },
  499. "newnames":{
  500. "description":"List of new file names when renaming multiple files using the files parameter.",
  501. "items":{
  502. "description":"New filename.",
  503. "type":"string"
  504. },
  505. "type":"array"
  506. }
  507. },
  508. "type":"object"
  509. }
  510. }
  511. ],
  512. "produces":[
  513. "text/plain",
  514. "application/json"
  515. ],
  516. "responses":{
  517. "200":{
  518. "description":"Returns the content of the requested file."
  519. },
  520. "default":{
  521. "description":"Error response",
  522. "schema":{
  523. "$ref":"#/definitions/Error"
  524. }
  525. }
  526. },
  527. "summary":"Perform a file operation."
  528. }
  529. },
  530. "/v1/progress/{tree}/{progress_id}":{
  531. "get":{
  532. "description":"Return a progress object showing the progress of an ongoing operation.",
  533. "parameters":[
  534. {
  535. "description":"Name of the tree.",
  536. "in":"path",
  537. "name":"tree",
  538. "required":true,
  539. "type":"string"
  540. },
  541. {
  542. "description":"Id of progress object.",
  543. "in":"path",
  544. "name":"progress_id",
  545. "required":true,
  546. "type":"string"
  547. }
  548. ],
  549. "produces":[
  550. "text/plain",
  551. "application/json"
  552. ],
  553. "responses":{
  554. "200":{
  555. "description":"Returns the requested progress object."
  556. },
  557. "default":{
  558. "description":"Error response",
  559. "schema":{
  560. "$ref":"#/definitions/Error"
  561. }
  562. }
  563. },
  564. "summary":"Request progress update."
  565. }
  566. },
  567. "/v1/zip/{tree}":{
  568. "post":{
  569. "consumes":[
  570. "application/x-www-form-urlencoded"
  571. ],
  572. "description":"Combine a list of given files into a single zip file.",
  573. "parameters":[
  574. {
  575. "description":"Name of the tree.",
  576. "in":"path",
  577. "name":"tree",
  578. "required":true,
  579. "type":"string"
  580. },
  581. {
  582. "description":"JSON encoded list of (full path) files which should be zipped up",
  583. "in":"body",
  584. "name":"files",
  585. "required":true,
  586. "schema":{
  587. "items":{
  588. "description":"File (with full path) which should be included in the zip file.",
  589. "type":"string"
  590. },
  591. "type":"array"
  592. }
  593. }
  594. ],
  595. "produces":[
  596. "text/plain"
  597. ],
  598. "responses":{
  599. "200":{
  600. "description":"Returns the content of the requested file."
  601. },
  602. "default":{
  603. "description":"Error response",
  604. "schema":{
  605. "$ref":"#/definitions/Error"
  606. }
  607. }
  608. },
  609. "summary":"Create zip file from a list of files."
  610. }
  611. }
  612. },
  613. "produces":[
  614. "application/json"
  615. ],
  616. "schemes":[
  617. "https"
  618. ],
  619. "swagger":"2.0"
  620. }