openapi.json 16 KB

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