openapi.json 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "federatedfilesharing",
  5. "version": "0.0.1",
  6. "description": "Provide federated file sharing across servers",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "OCSMeta": {
  24. "type": "object",
  25. "required": [
  26. "status",
  27. "statuscode"
  28. ],
  29. "properties": {
  30. "status": {
  31. "type": "string"
  32. },
  33. "statuscode": {
  34. "type": "integer"
  35. },
  36. "message": {
  37. "type": "string"
  38. },
  39. "totalitems": {
  40. "type": "string"
  41. },
  42. "itemsperpage": {
  43. "type": "string"
  44. }
  45. }
  46. }
  47. }
  48. },
  49. "paths": {
  50. "/index.php/apps/federatedfilesharing/createFederatedShare": {
  51. "post": {
  52. "operationId": "mount_public_link-create-federated-share",
  53. "summary": "send federated share to a user of a public link",
  54. "tags": [
  55. "mount_public_link"
  56. ],
  57. "security": [
  58. {},
  59. {
  60. "bearer_auth": []
  61. },
  62. {
  63. "basic_auth": []
  64. }
  65. ],
  66. "parameters": [
  67. {
  68. "name": "shareWith",
  69. "in": "query",
  70. "description": "Username to share with",
  71. "required": true,
  72. "schema": {
  73. "type": "string"
  74. }
  75. },
  76. {
  77. "name": "token",
  78. "in": "query",
  79. "description": "Token of the share",
  80. "required": true,
  81. "schema": {
  82. "type": "string"
  83. }
  84. },
  85. {
  86. "name": "password",
  87. "in": "query",
  88. "description": "Password of the share",
  89. "schema": {
  90. "type": "string",
  91. "default": ""
  92. }
  93. }
  94. ],
  95. "responses": {
  96. "200": {
  97. "description": "Remote URL returned",
  98. "content": {
  99. "application/json": {
  100. "schema": {
  101. "type": "object",
  102. "required": [
  103. "remoteUrl"
  104. ],
  105. "properties": {
  106. "remoteUrl": {
  107. "type": "string"
  108. }
  109. }
  110. }
  111. }
  112. }
  113. },
  114. "400": {
  115. "description": "Creating share is not possible",
  116. "content": {
  117. "application/json": {
  118. "schema": {
  119. "type": "object",
  120. "required": [
  121. "message"
  122. ],
  123. "properties": {
  124. "message": {
  125. "type": "string"
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. }
  133. }
  134. },
  135. "/ocs/v2.php/cloud/shares": {
  136. "post": {
  137. "operationId": "request_handler-create-share",
  138. "summary": "create a new share",
  139. "tags": [
  140. "request_handler"
  141. ],
  142. "security": [
  143. {},
  144. {
  145. "bearer_auth": []
  146. },
  147. {
  148. "basic_auth": []
  149. }
  150. ],
  151. "parameters": [
  152. {
  153. "name": "remote",
  154. "in": "query",
  155. "description": "Address of the remote",
  156. "schema": {
  157. "type": "string",
  158. "nullable": true
  159. }
  160. },
  161. {
  162. "name": "token",
  163. "in": "query",
  164. "description": "Shared secret between servers",
  165. "schema": {
  166. "type": "string",
  167. "nullable": true
  168. }
  169. },
  170. {
  171. "name": "name",
  172. "in": "query",
  173. "description": "Name of the shared resource",
  174. "schema": {
  175. "type": "string",
  176. "nullable": true
  177. }
  178. },
  179. {
  180. "name": "owner",
  181. "in": "query",
  182. "description": "Display name of the receiver",
  183. "schema": {
  184. "type": "string",
  185. "nullable": true
  186. }
  187. },
  188. {
  189. "name": "sharedBy",
  190. "in": "query",
  191. "description": "Display name of the sender",
  192. "schema": {
  193. "type": "string",
  194. "nullable": true
  195. }
  196. },
  197. {
  198. "name": "shareWith",
  199. "in": "query",
  200. "description": "ID of the user that receives the share",
  201. "schema": {
  202. "type": "string",
  203. "nullable": true
  204. }
  205. },
  206. {
  207. "name": "remoteId",
  208. "in": "query",
  209. "description": "ID of the remote",
  210. "schema": {
  211. "type": "integer",
  212. "format": "int64",
  213. "nullable": true
  214. }
  215. },
  216. {
  217. "name": "sharedByFederatedId",
  218. "in": "query",
  219. "description": "Federated ID of the sender",
  220. "schema": {
  221. "type": "string",
  222. "nullable": true
  223. }
  224. },
  225. {
  226. "name": "ownerFederatedId",
  227. "in": "query",
  228. "description": "Federated ID of the receiver",
  229. "schema": {
  230. "type": "string",
  231. "nullable": true
  232. }
  233. },
  234. {
  235. "name": "OCS-APIRequest",
  236. "in": "header",
  237. "required": true,
  238. "schema": {
  239. "type": "string",
  240. "default": "true"
  241. }
  242. }
  243. ],
  244. "responses": {
  245. "200": {
  246. "description": "",
  247. "content": {
  248. "application/json": {
  249. "schema": {
  250. "type": "object",
  251. "required": [
  252. "ocs"
  253. ],
  254. "properties": {
  255. "ocs": {
  256. "type": "object",
  257. "required": [
  258. "meta",
  259. "data"
  260. ],
  261. "properties": {
  262. "meta": {
  263. "$ref": "#/components/schemas/OCSMeta"
  264. },
  265. "data": {}
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. }
  275. },
  276. "/ocs/v2.php/cloud/shares/{id}/reshare": {
  277. "post": {
  278. "operationId": "request_handler-re-share",
  279. "summary": "create re-share on behalf of another user",
  280. "tags": [
  281. "request_handler"
  282. ],
  283. "security": [
  284. {},
  285. {
  286. "bearer_auth": []
  287. },
  288. {
  289. "basic_auth": []
  290. }
  291. ],
  292. "parameters": [
  293. {
  294. "name": "token",
  295. "in": "query",
  296. "description": "Shared secret between servers",
  297. "schema": {
  298. "type": "string",
  299. "nullable": true
  300. }
  301. },
  302. {
  303. "name": "shareWith",
  304. "in": "query",
  305. "description": "ID of the user that receives the share",
  306. "schema": {
  307. "type": "string",
  308. "nullable": true
  309. }
  310. },
  311. {
  312. "name": "remoteId",
  313. "in": "query",
  314. "description": "ID of the remote",
  315. "schema": {
  316. "type": "integer",
  317. "format": "int64",
  318. "nullable": true,
  319. "default": 0
  320. }
  321. },
  322. {
  323. "name": "id",
  324. "in": "path",
  325. "description": "ID of the share",
  326. "required": true,
  327. "schema": {
  328. "type": "integer",
  329. "format": "int64"
  330. }
  331. },
  332. {
  333. "name": "OCS-APIRequest",
  334. "in": "header",
  335. "required": true,
  336. "schema": {
  337. "type": "string",
  338. "default": "true"
  339. }
  340. }
  341. ],
  342. "responses": {
  343. "200": {
  344. "description": "Remote share returned",
  345. "content": {
  346. "application/json": {
  347. "schema": {
  348. "type": "object",
  349. "required": [
  350. "ocs"
  351. ],
  352. "properties": {
  353. "ocs": {
  354. "type": "object",
  355. "required": [
  356. "meta",
  357. "data"
  358. ],
  359. "properties": {
  360. "meta": {
  361. "$ref": "#/components/schemas/OCSMeta"
  362. },
  363. "data": {
  364. "type": "object",
  365. "required": [
  366. "token",
  367. "remoteId"
  368. ],
  369. "properties": {
  370. "token": {
  371. "type": "string"
  372. },
  373. "remoteId": {
  374. "type": "string"
  375. }
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. },
  385. "400": {
  386. "description": "Re-sharing is not possible",
  387. "content": {
  388. "text/plain": {
  389. "schema": {
  390. "type": "string"
  391. }
  392. }
  393. }
  394. }
  395. }
  396. }
  397. },
  398. "/ocs/v2.php/cloud/shares/{id}/permissions": {
  399. "post": {
  400. "operationId": "request_handler-update-permissions",
  401. "summary": "update share information to keep federated re-shares in sync",
  402. "tags": [
  403. "request_handler"
  404. ],
  405. "security": [
  406. {},
  407. {
  408. "bearer_auth": []
  409. },
  410. {
  411. "basic_auth": []
  412. }
  413. ],
  414. "parameters": [
  415. {
  416. "name": "token",
  417. "in": "query",
  418. "description": "Shared secret between servers",
  419. "schema": {
  420. "type": "string",
  421. "nullable": true
  422. }
  423. },
  424. {
  425. "name": "permissions",
  426. "in": "query",
  427. "description": "New permissions",
  428. "schema": {
  429. "type": "integer",
  430. "format": "int64",
  431. "nullable": true
  432. }
  433. },
  434. {
  435. "name": "id",
  436. "in": "path",
  437. "description": "ID of the share",
  438. "required": true,
  439. "schema": {
  440. "type": "integer",
  441. "format": "int64"
  442. }
  443. },
  444. {
  445. "name": "OCS-APIRequest",
  446. "in": "header",
  447. "required": true,
  448. "schema": {
  449. "type": "string",
  450. "default": "true"
  451. }
  452. }
  453. ],
  454. "responses": {
  455. "200": {
  456. "description": "Permissions updated successfully",
  457. "content": {
  458. "application/json": {
  459. "schema": {
  460. "type": "object",
  461. "required": [
  462. "ocs"
  463. ],
  464. "properties": {
  465. "ocs": {
  466. "type": "object",
  467. "required": [
  468. "meta",
  469. "data"
  470. ],
  471. "properties": {
  472. "meta": {
  473. "$ref": "#/components/schemas/OCSMeta"
  474. },
  475. "data": {}
  476. }
  477. }
  478. }
  479. }
  480. }
  481. }
  482. },
  483. "400": {
  484. "description": "Updating permissions is not possible",
  485. "content": {
  486. "text/plain": {
  487. "schema": {
  488. "type": "string"
  489. }
  490. }
  491. }
  492. }
  493. }
  494. }
  495. },
  496. "/ocs/v2.php/cloud/shares/{id}/accept": {
  497. "post": {
  498. "operationId": "request_handler-accept-share",
  499. "summary": "accept server-to-server share",
  500. "tags": [
  501. "request_handler"
  502. ],
  503. "security": [
  504. {},
  505. {
  506. "bearer_auth": []
  507. },
  508. {
  509. "basic_auth": []
  510. }
  511. ],
  512. "parameters": [
  513. {
  514. "name": "token",
  515. "in": "query",
  516. "description": "Shared secret between servers",
  517. "schema": {
  518. "type": "string",
  519. "nullable": true
  520. }
  521. },
  522. {
  523. "name": "id",
  524. "in": "path",
  525. "description": "ID of the remote share",
  526. "required": true,
  527. "schema": {
  528. "type": "integer",
  529. "format": "int64"
  530. }
  531. },
  532. {
  533. "name": "OCS-APIRequest",
  534. "in": "header",
  535. "required": true,
  536. "schema": {
  537. "type": "string",
  538. "default": "true"
  539. }
  540. }
  541. ],
  542. "responses": {
  543. "200": {
  544. "description": "Share accepted successfully",
  545. "content": {
  546. "application/json": {
  547. "schema": {
  548. "type": "object",
  549. "required": [
  550. "ocs"
  551. ],
  552. "properties": {
  553. "ocs": {
  554. "type": "object",
  555. "required": [
  556. "meta",
  557. "data"
  558. ],
  559. "properties": {
  560. "meta": {
  561. "$ref": "#/components/schemas/OCSMeta"
  562. },
  563. "data": {}
  564. }
  565. }
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "500": {
  572. "description": "",
  573. "content": {
  574. "text/plain": {
  575. "schema": {
  576. "type": "string"
  577. }
  578. }
  579. }
  580. }
  581. }
  582. }
  583. },
  584. "/ocs/v2.php/cloud/shares/{id}/decline": {
  585. "post": {
  586. "operationId": "request_handler-decline-share",
  587. "summary": "decline server-to-server share",
  588. "tags": [
  589. "request_handler"
  590. ],
  591. "security": [
  592. {},
  593. {
  594. "bearer_auth": []
  595. },
  596. {
  597. "basic_auth": []
  598. }
  599. ],
  600. "parameters": [
  601. {
  602. "name": "token",
  603. "in": "query",
  604. "description": "Shared secret between servers",
  605. "schema": {
  606. "type": "string",
  607. "nullable": true
  608. }
  609. },
  610. {
  611. "name": "id",
  612. "in": "path",
  613. "description": "ID of the remote share",
  614. "required": true,
  615. "schema": {
  616. "type": "integer",
  617. "format": "int64"
  618. }
  619. },
  620. {
  621. "name": "OCS-APIRequest",
  622. "in": "header",
  623. "required": true,
  624. "schema": {
  625. "type": "string",
  626. "default": "true"
  627. }
  628. }
  629. ],
  630. "responses": {
  631. "200": {
  632. "description": "",
  633. "content": {
  634. "application/json": {
  635. "schema": {
  636. "type": "object",
  637. "required": [
  638. "ocs"
  639. ],
  640. "properties": {
  641. "ocs": {
  642. "type": "object",
  643. "required": [
  644. "meta",
  645. "data"
  646. ],
  647. "properties": {
  648. "meta": {
  649. "$ref": "#/components/schemas/OCSMeta"
  650. },
  651. "data": {}
  652. }
  653. }
  654. }
  655. }
  656. }
  657. }
  658. }
  659. }
  660. }
  661. },
  662. "/ocs/v2.php/cloud/shares/{id}/unshare": {
  663. "post": {
  664. "operationId": "request_handler-unshare",
  665. "summary": "remove server-to-server share if it was unshared by the owner",
  666. "tags": [
  667. "request_handler"
  668. ],
  669. "security": [
  670. {},
  671. {
  672. "bearer_auth": []
  673. },
  674. {
  675. "basic_auth": []
  676. }
  677. ],
  678. "parameters": [
  679. {
  680. "name": "token",
  681. "in": "query",
  682. "description": "Shared secret between servers",
  683. "schema": {
  684. "type": "string",
  685. "nullable": true
  686. }
  687. },
  688. {
  689. "name": "id",
  690. "in": "path",
  691. "description": "ID of the share",
  692. "required": true,
  693. "schema": {
  694. "type": "integer",
  695. "format": "int64"
  696. }
  697. },
  698. {
  699. "name": "OCS-APIRequest",
  700. "in": "header",
  701. "required": true,
  702. "schema": {
  703. "type": "string",
  704. "default": "true"
  705. }
  706. }
  707. ],
  708. "responses": {
  709. "200": {
  710. "description": "",
  711. "content": {
  712. "application/json": {
  713. "schema": {
  714. "type": "object",
  715. "required": [
  716. "ocs"
  717. ],
  718. "properties": {
  719. "ocs": {
  720. "type": "object",
  721. "required": [
  722. "meta",
  723. "data"
  724. ],
  725. "properties": {
  726. "meta": {
  727. "$ref": "#/components/schemas/OCSMeta"
  728. },
  729. "data": {}
  730. }
  731. }
  732. }
  733. }
  734. }
  735. }
  736. }
  737. }
  738. }
  739. },
  740. "/ocs/v2.php/cloud/shares/{id}/revoke": {
  741. "post": {
  742. "operationId": "request_handler-revoke",
  743. "summary": "federated share was revoked, either by the owner or the re-sharer",
  744. "tags": [
  745. "request_handler"
  746. ],
  747. "security": [
  748. {},
  749. {
  750. "bearer_auth": []
  751. },
  752. {
  753. "basic_auth": []
  754. }
  755. ],
  756. "parameters": [
  757. {
  758. "name": "token",
  759. "in": "query",
  760. "description": "Shared secret between servers",
  761. "schema": {
  762. "type": "string",
  763. "nullable": true
  764. }
  765. },
  766. {
  767. "name": "id",
  768. "in": "path",
  769. "description": "ID of the share",
  770. "required": true,
  771. "schema": {
  772. "type": "integer",
  773. "format": "int64"
  774. }
  775. },
  776. {
  777. "name": "OCS-APIRequest",
  778. "in": "header",
  779. "required": true,
  780. "schema": {
  781. "type": "string",
  782. "default": "true"
  783. }
  784. }
  785. ],
  786. "responses": {
  787. "200": {
  788. "description": "Share revoked successfully",
  789. "content": {
  790. "application/json": {
  791. "schema": {
  792. "type": "object",
  793. "required": [
  794. "ocs"
  795. ],
  796. "properties": {
  797. "ocs": {
  798. "type": "object",
  799. "required": [
  800. "meta",
  801. "data"
  802. ],
  803. "properties": {
  804. "meta": {
  805. "$ref": "#/components/schemas/OCSMeta"
  806. },
  807. "data": {}
  808. }
  809. }
  810. }
  811. }
  812. }
  813. }
  814. },
  815. "400": {
  816. "description": "Revoking the share is not possible",
  817. "content": {
  818. "text/plain": {
  819. "schema": {
  820. "type": "string"
  821. }
  822. }
  823. }
  824. }
  825. }
  826. }
  827. },
  828. "/ocs/v2.php/cloud/shares/{id}/move": {
  829. "post": {
  830. "operationId": "request_handler-move",
  831. "summary": "change the owner of a server-to-server share",
  832. "tags": [
  833. "request_handler"
  834. ],
  835. "security": [
  836. {},
  837. {
  838. "bearer_auth": []
  839. },
  840. {
  841. "basic_auth": []
  842. }
  843. ],
  844. "parameters": [
  845. {
  846. "name": "token",
  847. "in": "query",
  848. "description": "Shared secret between servers",
  849. "schema": {
  850. "type": "string",
  851. "nullable": true
  852. }
  853. },
  854. {
  855. "name": "remote",
  856. "in": "query",
  857. "description": "Address of the remote",
  858. "schema": {
  859. "type": "string",
  860. "nullable": true
  861. }
  862. },
  863. {
  864. "name": "remote_id",
  865. "in": "query",
  866. "description": "ID of the remote",
  867. "schema": {
  868. "type": "string",
  869. "nullable": true
  870. }
  871. },
  872. {
  873. "name": "id",
  874. "in": "path",
  875. "description": "ID of the share",
  876. "required": true,
  877. "schema": {
  878. "type": "integer",
  879. "format": "int64"
  880. }
  881. },
  882. {
  883. "name": "OCS-APIRequest",
  884. "in": "header",
  885. "required": true,
  886. "schema": {
  887. "type": "string",
  888. "default": "true"
  889. }
  890. }
  891. ],
  892. "responses": {
  893. "200": {
  894. "description": "Share moved successfully",
  895. "content": {
  896. "application/json": {
  897. "schema": {
  898. "type": "object",
  899. "required": [
  900. "ocs"
  901. ],
  902. "properties": {
  903. "ocs": {
  904. "type": "object",
  905. "required": [
  906. "meta",
  907. "data"
  908. ],
  909. "properties": {
  910. "meta": {
  911. "$ref": "#/components/schemas/OCSMeta"
  912. },
  913. "data": {
  914. "type": "object",
  915. "required": [
  916. "remote",
  917. "owner"
  918. ],
  919. "properties": {
  920. "remote": {
  921. "type": "string"
  922. },
  923. "owner": {
  924. "type": "string"
  925. }
  926. }
  927. }
  928. }
  929. }
  930. }
  931. }
  932. }
  933. }
  934. },
  935. "400": {
  936. "description": "Moving share is not possible",
  937. "content": {
  938. "text/plain": {
  939. "schema": {
  940. "type": "string"
  941. }
  942. }
  943. }
  944. }
  945. }
  946. }
  947. }
  948. },
  949. "tags": [
  950. {
  951. "name": "mount_public_link",
  952. "description": "Class MountPublicLinkController\nconvert public links to federated shares"
  953. }
  954. ]
  955. }