openapi.json 15 KB

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