openapi.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "cloud_federation_api",
  5. "version": "0.0.1",
  6. "description": "Enable clouds to communicate with each other and exchange data",
  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. "AddShare": {
  24. "type": "object",
  25. "required": [
  26. "recipientDisplayName"
  27. ],
  28. "properties": {
  29. "recipientDisplayName": {
  30. "type": "string"
  31. }
  32. }
  33. },
  34. "Capabilities": {
  35. "type": "object",
  36. "required": [
  37. "ocm"
  38. ],
  39. "properties": {
  40. "ocm": {
  41. "type": "object",
  42. "required": [
  43. "enabled",
  44. "apiVersion",
  45. "endPoint",
  46. "resourceTypes"
  47. ],
  48. "properties": {
  49. "enabled": {
  50. "type": "boolean"
  51. },
  52. "apiVersion": {
  53. "type": "string"
  54. },
  55. "endPoint": {
  56. "type": "string"
  57. },
  58. "resourceTypes": {
  59. "type": "array",
  60. "items": {
  61. "type": "object",
  62. "required": [
  63. "name",
  64. "shareTypes",
  65. "protocols"
  66. ],
  67. "properties": {
  68. "name": {
  69. "type": "string"
  70. },
  71. "shareTypes": {
  72. "type": "array",
  73. "items": {
  74. "type": "string"
  75. }
  76. },
  77. "protocols": {
  78. "type": "object",
  79. "required": [
  80. "webdav"
  81. ],
  82. "properties": {
  83. "webdav": {
  84. "type": "string"
  85. }
  86. }
  87. }
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
  94. },
  95. "Error": {
  96. "type": "object",
  97. "required": [
  98. "message"
  99. ],
  100. "properties": {
  101. "message": {
  102. "type": "string"
  103. }
  104. }
  105. },
  106. "ValidationError": {
  107. "allOf": [
  108. {
  109. "$ref": "#/components/schemas/Error"
  110. },
  111. {
  112. "type": "object",
  113. "required": [
  114. "validationErrors"
  115. ],
  116. "properties": {
  117. "validationErrors": {
  118. "type": "array",
  119. "items": {
  120. "type": "object",
  121. "required": [
  122. "name",
  123. "message"
  124. ],
  125. "properties": {
  126. "name": {
  127. "type": "string"
  128. },
  129. "message": {
  130. "type": "string",
  131. "nullable": true
  132. }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. ]
  139. }
  140. }
  141. },
  142. "paths": {
  143. "/index.php/ocm/shares": {
  144. "post": {
  145. "operationId": "request_handler-add-share",
  146. "summary": "Add share",
  147. "tags": [
  148. "request_handler"
  149. ],
  150. "security": [
  151. {},
  152. {
  153. "bearer_auth": []
  154. },
  155. {
  156. "basic_auth": []
  157. }
  158. ],
  159. "parameters": [
  160. {
  161. "name": "shareWith",
  162. "in": "query",
  163. "description": "The user who the share will be shared with",
  164. "required": true,
  165. "schema": {
  166. "type": "string"
  167. }
  168. },
  169. {
  170. "name": "name",
  171. "in": "query",
  172. "description": "The resource name (e.g. document.odt)",
  173. "required": true,
  174. "schema": {
  175. "type": "string"
  176. }
  177. },
  178. {
  179. "name": "description",
  180. "in": "query",
  181. "description": "Share description",
  182. "schema": {
  183. "type": "string",
  184. "nullable": true
  185. }
  186. },
  187. {
  188. "name": "providerId",
  189. "in": "query",
  190. "description": "Resource UID on the provider side",
  191. "required": true,
  192. "schema": {
  193. "type": "string"
  194. }
  195. },
  196. {
  197. "name": "owner",
  198. "in": "query",
  199. "description": "Provider specific UID of the user who owns the resource",
  200. "required": true,
  201. "schema": {
  202. "type": "string"
  203. }
  204. },
  205. {
  206. "name": "ownerDisplayName",
  207. "in": "query",
  208. "description": "Display name of the user who shared the item",
  209. "schema": {
  210. "type": "string",
  211. "nullable": true
  212. }
  213. },
  214. {
  215. "name": "sharedBy",
  216. "in": "query",
  217. "description": "Provider specific UID of the user who shared the resource",
  218. "schema": {
  219. "type": "string",
  220. "nullable": true
  221. }
  222. },
  223. {
  224. "name": "sharedByDisplayName",
  225. "in": "query",
  226. "description": "Display name of the user who shared the resource",
  227. "schema": {
  228. "type": "string",
  229. "nullable": true
  230. }
  231. },
  232. {
  233. "name": "protocol",
  234. "in": "query",
  235. "description": "e,.g. ['name' => 'webdav', 'options' => ['username' => 'john', 'permissions' => 31]]",
  236. "required": true,
  237. "schema": {
  238. "type": "string"
  239. }
  240. },
  241. {
  242. "name": "shareType",
  243. "in": "query",
  244. "description": "'group' or 'user' share",
  245. "required": true,
  246. "schema": {
  247. "type": "string"
  248. }
  249. },
  250. {
  251. "name": "resourceType",
  252. "in": "query",
  253. "description": "'file', 'calendar',...",
  254. "required": true,
  255. "schema": {
  256. "type": "string"
  257. }
  258. }
  259. ],
  260. "responses": {
  261. "201": {
  262. "description": "The notification was successfully received. The display name of the recipient might be returned in the body",
  263. "content": {
  264. "application/json": {
  265. "schema": {
  266. "$ref": "#/components/schemas/AddShare"
  267. }
  268. }
  269. }
  270. },
  271. "400": {
  272. "description": "Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing",
  273. "content": {
  274. "application/json": {
  275. "schema": {
  276. "$ref": "#/components/schemas/ValidationError"
  277. }
  278. }
  279. }
  280. },
  281. "501": {
  282. "description": "Share type or the resource type is not supported",
  283. "content": {
  284. "application/json": {
  285. "schema": {
  286. "$ref": "#/components/schemas/Error"
  287. }
  288. }
  289. }
  290. }
  291. }
  292. }
  293. },
  294. "/index.php/ocm/notifications": {
  295. "post": {
  296. "operationId": "request_handler-receive-notification",
  297. "summary": "Send a notification about an existing share",
  298. "tags": [
  299. "request_handler"
  300. ],
  301. "security": [
  302. {},
  303. {
  304. "bearer_auth": []
  305. },
  306. {
  307. "basic_auth": []
  308. }
  309. ],
  310. "parameters": [
  311. {
  312. "name": "notificationType",
  313. "in": "query",
  314. "description": "Notification type, e.g. SHARE_ACCEPTED",
  315. "required": true,
  316. "schema": {
  317. "type": "string"
  318. }
  319. },
  320. {
  321. "name": "resourceType",
  322. "in": "query",
  323. "description": "calendar, file, contact,...",
  324. "required": true,
  325. "schema": {
  326. "type": "string"
  327. }
  328. },
  329. {
  330. "name": "providerId",
  331. "in": "query",
  332. "description": "ID of the share",
  333. "schema": {
  334. "type": "string",
  335. "nullable": true
  336. }
  337. },
  338. {
  339. "name": "notification",
  340. "in": "query",
  341. "description": "The actual payload of the notification",
  342. "schema": {
  343. "type": "string",
  344. "nullable": true
  345. }
  346. }
  347. ],
  348. "responses": {
  349. "201": {
  350. "description": "The notification was successfully received",
  351. "content": {
  352. "application/json": {
  353. "schema": {
  354. "type": "object",
  355. "additionalProperties": {
  356. "type": "object"
  357. }
  358. }
  359. }
  360. }
  361. },
  362. "400": {
  363. "description": "Bad request due to invalid parameters, e.g. when `type` is invalid or missing",
  364. "content": {
  365. "application/json": {
  366. "schema": {
  367. "$ref": "#/components/schemas/ValidationError"
  368. }
  369. }
  370. }
  371. },
  372. "403": {
  373. "description": "Getting resource is not allowed",
  374. "content": {
  375. "application/json": {
  376. "schema": {
  377. "$ref": "#/components/schemas/Error"
  378. }
  379. }
  380. }
  381. },
  382. "501": {
  383. "description": "The resource type is not supported",
  384. "content": {
  385. "application/json": {
  386. "schema": {
  387. "$ref": "#/components/schemas/Error"
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. }
  395. },
  396. "tags": [
  397. {
  398. "name": "request_handler",
  399. "description": "Open-Cloud-Mesh-API"
  400. }
  401. ]
  402. }