openapi.json 17 KB

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