openapi.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. "requestBody": {
  155. "required": true,
  156. "content": {
  157. "application/json": {
  158. "schema": {
  159. "type": "object",
  160. "required": [
  161. "shareWith",
  162. "name",
  163. "providerId",
  164. "owner",
  165. "protocol",
  166. "shareType",
  167. "resourceType"
  168. ],
  169. "properties": {
  170. "shareWith": {
  171. "type": "string",
  172. "description": "The user who the share will be shared with"
  173. },
  174. "name": {
  175. "type": "string",
  176. "description": "The resource name (e.g. document.odt)"
  177. },
  178. "description": {
  179. "type": "string",
  180. "nullable": true,
  181. "description": "Share description"
  182. },
  183. "providerId": {
  184. "type": "string",
  185. "description": "Resource UID on the provider side"
  186. },
  187. "owner": {
  188. "type": "string",
  189. "description": "Provider specific UID of the user who owns the resource"
  190. },
  191. "ownerDisplayName": {
  192. "type": "string",
  193. "nullable": true,
  194. "description": "Display name of the user who shared the item"
  195. },
  196. "sharedBy": {
  197. "type": "string",
  198. "nullable": true,
  199. "description": "Provider specific UID of the user who shared the resource"
  200. },
  201. "sharedByDisplayName": {
  202. "type": "string",
  203. "nullable": true,
  204. "description": "Display name of the user who shared the resource"
  205. },
  206. "protocol": {
  207. "type": "object",
  208. "description": "e,.g. ['name' => 'webdav', 'options' => ['username' => 'john', 'permissions' => 31]]",
  209. "required": [
  210. "name",
  211. "options"
  212. ],
  213. "properties": {
  214. "name": {
  215. "type": "array",
  216. "items": {
  217. "type": "string"
  218. }
  219. },
  220. "options": {
  221. "type": "object",
  222. "additionalProperties": {
  223. "type": "object"
  224. }
  225. }
  226. }
  227. },
  228. "shareType": {
  229. "type": "string",
  230. "description": "'group' or 'user' share"
  231. },
  232. "resourceType": {
  233. "type": "string",
  234. "description": "'file', 'calendar',..."
  235. }
  236. }
  237. }
  238. }
  239. }
  240. },
  241. "responses": {
  242. "201": {
  243. "description": "The notification was successfully received. The display name of the recipient might be returned in the body",
  244. "content": {
  245. "application/json": {
  246. "schema": {
  247. "$ref": "#/components/schemas/AddShare"
  248. }
  249. }
  250. }
  251. },
  252. "400": {
  253. "description": "Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing",
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "$ref": "#/components/schemas/ValidationError"
  258. }
  259. }
  260. }
  261. },
  262. "501": {
  263. "description": "Share type or the resource type is not supported",
  264. "content": {
  265. "application/json": {
  266. "schema": {
  267. "$ref": "#/components/schemas/Error"
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. },
  275. "/index.php/ocm/notifications": {
  276. "post": {
  277. "operationId": "request_handler-receive-notification",
  278. "summary": "Send a notification about an existing share",
  279. "tags": [
  280. "request_handler"
  281. ],
  282. "security": [
  283. {},
  284. {
  285. "bearer_auth": []
  286. },
  287. {
  288. "basic_auth": []
  289. }
  290. ],
  291. "requestBody": {
  292. "required": true,
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "type": "object",
  297. "required": [
  298. "notificationType",
  299. "resourceType"
  300. ],
  301. "properties": {
  302. "notificationType": {
  303. "type": "string",
  304. "description": "Notification type, e.g. SHARE_ACCEPTED"
  305. },
  306. "resourceType": {
  307. "type": "string",
  308. "description": "calendar, file, contact,..."
  309. },
  310. "providerId": {
  311. "type": "string",
  312. "nullable": true,
  313. "description": "ID of the share"
  314. },
  315. "notification": {
  316. "type": "object",
  317. "nullable": true,
  318. "description": "The actual payload of the notification",
  319. "additionalProperties": {
  320. "type": "object"
  321. }
  322. }
  323. }
  324. }
  325. }
  326. }
  327. },
  328. "responses": {
  329. "201": {
  330. "description": "The notification was successfully received",
  331. "content": {
  332. "application/json": {
  333. "schema": {
  334. "type": "object",
  335. "additionalProperties": {
  336. "type": "object"
  337. }
  338. }
  339. }
  340. }
  341. },
  342. "400": {
  343. "description": "Bad request due to invalid parameters, e.g. when `type` is invalid or missing",
  344. "content": {
  345. "application/json": {
  346. "schema": {
  347. "$ref": "#/components/schemas/ValidationError"
  348. }
  349. }
  350. }
  351. },
  352. "403": {
  353. "description": "Getting resource is not allowed",
  354. "content": {
  355. "application/json": {
  356. "schema": {
  357. "$ref": "#/components/schemas/Error"
  358. }
  359. }
  360. }
  361. },
  362. "501": {
  363. "description": "The resource type is not supported",
  364. "content": {
  365. "application/json": {
  366. "schema": {
  367. "$ref": "#/components/schemas/Error"
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. }
  375. },
  376. "tags": [
  377. {
  378. "name": "request_handler",
  379. "description": "Open-Cloud-Mesh-API"
  380. }
  381. ]
  382. }