openapi.json 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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. "description": "Required to be true for the API request to pass",
  238. "required": true,
  239. "schema": {
  240. "type": "boolean",
  241. "default": true
  242. }
  243. }
  244. ],
  245. "responses": {
  246. "200": {
  247. "description": "Share created successfully",
  248. "content": {
  249. "application/json": {
  250. "schema": {
  251. "type": "object",
  252. "required": [
  253. "ocs"
  254. ],
  255. "properties": {
  256. "ocs": {
  257. "type": "object",
  258. "required": [
  259. "meta",
  260. "data"
  261. ],
  262. "properties": {
  263. "meta": {
  264. "$ref": "#/components/schemas/OCSMeta"
  265. },
  266. "data": {}
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "/ocs/v2.php/cloud/shares/{id}/reshare": {
  278. "post": {
  279. "operationId": "request_handler-re-share",
  280. "summary": "create re-share on behalf of another user",
  281. "tags": [
  282. "request_handler"
  283. ],
  284. "security": [
  285. {},
  286. {
  287. "bearer_auth": []
  288. },
  289. {
  290. "basic_auth": []
  291. }
  292. ],
  293. "parameters": [
  294. {
  295. "name": "token",
  296. "in": "query",
  297. "description": "Shared secret between servers",
  298. "schema": {
  299. "type": "string",
  300. "nullable": true
  301. }
  302. },
  303. {
  304. "name": "shareWith",
  305. "in": "query",
  306. "description": "ID of the user that receives the share",
  307. "schema": {
  308. "type": "string",
  309. "nullable": true
  310. }
  311. },
  312. {
  313. "name": "remoteId",
  314. "in": "query",
  315. "description": "ID of the remote",
  316. "schema": {
  317. "type": "integer",
  318. "format": "int64",
  319. "nullable": true,
  320. "default": 0
  321. }
  322. },
  323. {
  324. "name": "id",
  325. "in": "path",
  326. "description": "ID of the share",
  327. "required": true,
  328. "schema": {
  329. "type": "integer",
  330. "format": "int64"
  331. }
  332. },
  333. {
  334. "name": "OCS-APIRequest",
  335. "in": "header",
  336. "description": "Required to be true for the API request to pass",
  337. "required": true,
  338. "schema": {
  339. "type": "boolean",
  340. "default": true
  341. }
  342. }
  343. ],
  344. "responses": {
  345. "200": {
  346. "description": "Remote share returned",
  347. "content": {
  348. "application/json": {
  349. "schema": {
  350. "type": "object",
  351. "required": [
  352. "ocs"
  353. ],
  354. "properties": {
  355. "ocs": {
  356. "type": "object",
  357. "required": [
  358. "meta",
  359. "data"
  360. ],
  361. "properties": {
  362. "meta": {
  363. "$ref": "#/components/schemas/OCSMeta"
  364. },
  365. "data": {
  366. "type": "object",
  367. "required": [
  368. "token",
  369. "remoteId"
  370. ],
  371. "properties": {
  372. "token": {
  373. "type": "string"
  374. },
  375. "remoteId": {
  376. "type": "string"
  377. }
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. }
  386. },
  387. "400": {
  388. "description": "Re-sharing is not possible",
  389. "content": {
  390. "text/plain": {
  391. "schema": {
  392. "type": "string"
  393. }
  394. }
  395. }
  396. }
  397. }
  398. }
  399. },
  400. "/ocs/v2.php/cloud/shares/{id}/permissions": {
  401. "post": {
  402. "operationId": "request_handler-update-permissions",
  403. "summary": "update share information to keep federated re-shares in sync",
  404. "tags": [
  405. "request_handler"
  406. ],
  407. "security": [
  408. {},
  409. {
  410. "bearer_auth": []
  411. },
  412. {
  413. "basic_auth": []
  414. }
  415. ],
  416. "parameters": [
  417. {
  418. "name": "token",
  419. "in": "query",
  420. "description": "Shared secret between servers",
  421. "schema": {
  422. "type": "string",
  423. "nullable": true
  424. }
  425. },
  426. {
  427. "name": "permissions",
  428. "in": "query",
  429. "description": "New permissions",
  430. "schema": {
  431. "type": "integer",
  432. "format": "int64",
  433. "nullable": true
  434. }
  435. },
  436. {
  437. "name": "id",
  438. "in": "path",
  439. "description": "ID of the share",
  440. "required": true,
  441. "schema": {
  442. "type": "integer",
  443. "format": "int64"
  444. }
  445. },
  446. {
  447. "name": "OCS-APIRequest",
  448. "in": "header",
  449. "description": "Required to be true for the API request to pass",
  450. "required": true,
  451. "schema": {
  452. "type": "boolean",
  453. "default": true
  454. }
  455. }
  456. ],
  457. "responses": {
  458. "200": {
  459. "description": "Permissions updated successfully",
  460. "content": {
  461. "application/json": {
  462. "schema": {
  463. "type": "object",
  464. "required": [
  465. "ocs"
  466. ],
  467. "properties": {
  468. "ocs": {
  469. "type": "object",
  470. "required": [
  471. "meta",
  472. "data"
  473. ],
  474. "properties": {
  475. "meta": {
  476. "$ref": "#/components/schemas/OCSMeta"
  477. },
  478. "data": {}
  479. }
  480. }
  481. }
  482. }
  483. }
  484. }
  485. },
  486. "400": {
  487. "description": "Updating permissions is not possible",
  488. "content": {
  489. "text/plain": {
  490. "schema": {
  491. "type": "string"
  492. }
  493. }
  494. }
  495. }
  496. }
  497. }
  498. },
  499. "/ocs/v2.php/cloud/shares/{id}/accept": {
  500. "post": {
  501. "operationId": "request_handler-accept-share",
  502. "summary": "accept server-to-server share",
  503. "tags": [
  504. "request_handler"
  505. ],
  506. "security": [
  507. {},
  508. {
  509. "bearer_auth": []
  510. },
  511. {
  512. "basic_auth": []
  513. }
  514. ],
  515. "parameters": [
  516. {
  517. "name": "token",
  518. "in": "query",
  519. "description": "Shared secret between servers",
  520. "schema": {
  521. "type": "string",
  522. "nullable": true
  523. }
  524. },
  525. {
  526. "name": "id",
  527. "in": "path",
  528. "description": "ID of the remote share",
  529. "required": true,
  530. "schema": {
  531. "type": "integer",
  532. "format": "int64"
  533. }
  534. },
  535. {
  536. "name": "OCS-APIRequest",
  537. "in": "header",
  538. "description": "Required to be true for the API request to pass",
  539. "required": true,
  540. "schema": {
  541. "type": "boolean",
  542. "default": true
  543. }
  544. }
  545. ],
  546. "responses": {
  547. "200": {
  548. "description": "Share accepted successfully",
  549. "content": {
  550. "application/json": {
  551. "schema": {
  552. "type": "object",
  553. "required": [
  554. "ocs"
  555. ],
  556. "properties": {
  557. "ocs": {
  558. "type": "object",
  559. "required": [
  560. "meta",
  561. "data"
  562. ],
  563. "properties": {
  564. "meta": {
  565. "$ref": "#/components/schemas/OCSMeta"
  566. },
  567. "data": {}
  568. }
  569. }
  570. }
  571. }
  572. }
  573. }
  574. },
  575. "500": {
  576. "description": "",
  577. "content": {
  578. "text/plain": {
  579. "schema": {
  580. "type": "string"
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }
  587. },
  588. "/ocs/v2.php/cloud/shares/{id}/decline": {
  589. "post": {
  590. "operationId": "request_handler-decline-share",
  591. "summary": "decline server-to-server share",
  592. "tags": [
  593. "request_handler"
  594. ],
  595. "security": [
  596. {},
  597. {
  598. "bearer_auth": []
  599. },
  600. {
  601. "basic_auth": []
  602. }
  603. ],
  604. "parameters": [
  605. {
  606. "name": "token",
  607. "in": "query",
  608. "description": "Shared secret between servers",
  609. "schema": {
  610. "type": "string",
  611. "nullable": true
  612. }
  613. },
  614. {
  615. "name": "id",
  616. "in": "path",
  617. "description": "ID of the remote share",
  618. "required": true,
  619. "schema": {
  620. "type": "integer",
  621. "format": "int64"
  622. }
  623. },
  624. {
  625. "name": "OCS-APIRequest",
  626. "in": "header",
  627. "description": "Required to be true for the API request to pass",
  628. "required": true,
  629. "schema": {
  630. "type": "boolean",
  631. "default": true
  632. }
  633. }
  634. ],
  635. "responses": {
  636. "200": {
  637. "description": "Share declined successfully",
  638. "content": {
  639. "application/json": {
  640. "schema": {
  641. "type": "object",
  642. "required": [
  643. "ocs"
  644. ],
  645. "properties": {
  646. "ocs": {
  647. "type": "object",
  648. "required": [
  649. "meta",
  650. "data"
  651. ],
  652. "properties": {
  653. "meta": {
  654. "$ref": "#/components/schemas/OCSMeta"
  655. },
  656. "data": {}
  657. }
  658. }
  659. }
  660. }
  661. }
  662. }
  663. }
  664. }
  665. }
  666. },
  667. "/ocs/v2.php/cloud/shares/{id}/unshare": {
  668. "post": {
  669. "operationId": "request_handler-unshare",
  670. "summary": "remove server-to-server share if it was unshared by the owner",
  671. "tags": [
  672. "request_handler"
  673. ],
  674. "security": [
  675. {},
  676. {
  677. "bearer_auth": []
  678. },
  679. {
  680. "basic_auth": []
  681. }
  682. ],
  683. "parameters": [
  684. {
  685. "name": "token",
  686. "in": "query",
  687. "description": "Shared secret between servers",
  688. "schema": {
  689. "type": "string",
  690. "nullable": true
  691. }
  692. },
  693. {
  694. "name": "id",
  695. "in": "path",
  696. "description": "ID of the share",
  697. "required": true,
  698. "schema": {
  699. "type": "integer",
  700. "format": "int64"
  701. }
  702. },
  703. {
  704. "name": "OCS-APIRequest",
  705. "in": "header",
  706. "description": "Required to be true for the API request to pass",
  707. "required": true,
  708. "schema": {
  709. "type": "boolean",
  710. "default": true
  711. }
  712. }
  713. ],
  714. "responses": {
  715. "200": {
  716. "description": "Share unshared successfully",
  717. "content": {
  718. "application/json": {
  719. "schema": {
  720. "type": "object",
  721. "required": [
  722. "ocs"
  723. ],
  724. "properties": {
  725. "ocs": {
  726. "type": "object",
  727. "required": [
  728. "meta",
  729. "data"
  730. ],
  731. "properties": {
  732. "meta": {
  733. "$ref": "#/components/schemas/OCSMeta"
  734. },
  735. "data": {}
  736. }
  737. }
  738. }
  739. }
  740. }
  741. }
  742. }
  743. }
  744. }
  745. },
  746. "/ocs/v2.php/cloud/shares/{id}/revoke": {
  747. "post": {
  748. "operationId": "request_handler-revoke",
  749. "summary": "federated share was revoked, either by the owner or the re-sharer",
  750. "tags": [
  751. "request_handler"
  752. ],
  753. "security": [
  754. {},
  755. {
  756. "bearer_auth": []
  757. },
  758. {
  759. "basic_auth": []
  760. }
  761. ],
  762. "parameters": [
  763. {
  764. "name": "token",
  765. "in": "query",
  766. "description": "Shared secret between servers",
  767. "schema": {
  768. "type": "string",
  769. "nullable": true
  770. }
  771. },
  772. {
  773. "name": "id",
  774. "in": "path",
  775. "description": "ID of the share",
  776. "required": true,
  777. "schema": {
  778. "type": "integer",
  779. "format": "int64"
  780. }
  781. },
  782. {
  783. "name": "OCS-APIRequest",
  784. "in": "header",
  785. "description": "Required to be true for the API request to pass",
  786. "required": true,
  787. "schema": {
  788. "type": "boolean",
  789. "default": true
  790. }
  791. }
  792. ],
  793. "responses": {
  794. "200": {
  795. "description": "Share revoked successfully",
  796. "content": {
  797. "application/json": {
  798. "schema": {
  799. "type": "object",
  800. "required": [
  801. "ocs"
  802. ],
  803. "properties": {
  804. "ocs": {
  805. "type": "object",
  806. "required": [
  807. "meta",
  808. "data"
  809. ],
  810. "properties": {
  811. "meta": {
  812. "$ref": "#/components/schemas/OCSMeta"
  813. },
  814. "data": {}
  815. }
  816. }
  817. }
  818. }
  819. }
  820. }
  821. },
  822. "400": {
  823. "description": "Revoking the share is not possible",
  824. "content": {
  825. "text/plain": {
  826. "schema": {
  827. "type": "string"
  828. }
  829. }
  830. }
  831. }
  832. }
  833. }
  834. },
  835. "/ocs/v2.php/cloud/shares/{id}/move": {
  836. "post": {
  837. "operationId": "request_handler-move",
  838. "summary": "change the owner of a server-to-server share",
  839. "tags": [
  840. "request_handler"
  841. ],
  842. "security": [
  843. {},
  844. {
  845. "bearer_auth": []
  846. },
  847. {
  848. "basic_auth": []
  849. }
  850. ],
  851. "parameters": [
  852. {
  853. "name": "token",
  854. "in": "query",
  855. "description": "Shared secret between servers",
  856. "schema": {
  857. "type": "string",
  858. "nullable": true
  859. }
  860. },
  861. {
  862. "name": "remote",
  863. "in": "query",
  864. "description": "Address of the remote",
  865. "schema": {
  866. "type": "string",
  867. "nullable": true
  868. }
  869. },
  870. {
  871. "name": "remote_id",
  872. "in": "query",
  873. "description": "ID of the remote",
  874. "schema": {
  875. "type": "string",
  876. "nullable": true
  877. }
  878. },
  879. {
  880. "name": "id",
  881. "in": "path",
  882. "description": "ID of the share",
  883. "required": true,
  884. "schema": {
  885. "type": "integer",
  886. "format": "int64"
  887. }
  888. },
  889. {
  890. "name": "OCS-APIRequest",
  891. "in": "header",
  892. "description": "Required to be true for the API request to pass",
  893. "required": true,
  894. "schema": {
  895. "type": "boolean",
  896. "default": true
  897. }
  898. }
  899. ],
  900. "responses": {
  901. "200": {
  902. "description": "Share moved successfully",
  903. "content": {
  904. "application/json": {
  905. "schema": {
  906. "type": "object",
  907. "required": [
  908. "ocs"
  909. ],
  910. "properties": {
  911. "ocs": {
  912. "type": "object",
  913. "required": [
  914. "meta",
  915. "data"
  916. ],
  917. "properties": {
  918. "meta": {
  919. "$ref": "#/components/schemas/OCSMeta"
  920. },
  921. "data": {
  922. "type": "object",
  923. "required": [
  924. "remote",
  925. "owner"
  926. ],
  927. "properties": {
  928. "remote": {
  929. "type": "string"
  930. },
  931. "owner": {
  932. "type": "string"
  933. }
  934. }
  935. }
  936. }
  937. }
  938. }
  939. }
  940. }
  941. }
  942. },
  943. "400": {
  944. "description": "Moving share is not possible",
  945. "content": {
  946. "text/plain": {
  947. "schema": {
  948. "type": "string"
  949. }
  950. }
  951. }
  952. }
  953. }
  954. }
  955. }
  956. },
  957. "tags": [
  958. {
  959. "name": "mount_public_link",
  960. "description": "Class MountPublicLinkController\nconvert public links to federated shares"
  961. }
  962. ]
  963. }