You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/apps/federatedfilesharing/openapi.json

1035 lines
41 KiB
JSON

{
"openapi": "3.0.3",
"info": {
"title": "federatedfilesharing",
"version": "0.0.1",
"description": "Provide federated file sharing across servers",
"license": {
"name": "agpl"
}
},
"components": {
"securitySchemes": {
"basic_auth": {
"type": "http",
"scheme": "basic"
},
"bearer_auth": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode"
],
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
}
}
},
"paths": {
"/index.php/apps/federatedfilesharing/createFederatedShare": {
"post": {
"operationId": "mount_public_link-create-federated-share",
"summary": "send federated share to a user of a public link",
"tags": [
"mount_public_link"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "shareWith",
"in": "query",
"description": "Username to share with",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "token",
"in": "query",
"description": "Token of the share",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "password",
"in": "query",
"description": "Password of the share",
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": {
"200": {
"description": "Remote URL returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"remoteUrl"
],
"properties": {
"remoteUrl": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Creating share is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares": {
"post": {
"operationId": "request_handler-create-share",
"summary": "create a new share",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "remote",
"in": "query",
"description": "Address of the remote",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "name",
"in": "query",
"description": "Name of the shared resource",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "owner",
"in": "query",
"description": "Display name of the receiver",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "sharedBy",
"in": "query",
"description": "Display name of the sender",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "shareWith",
"in": "query",
"description": "ID of the user that receives the share",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "remoteId",
"in": "query",
"description": "ID of the remote",
"schema": {
"type": "integer",
"format": "int64",
"nullable": true
}
},
{
"name": "sharedByFederatedId",
"in": "query",
"description": "Federated ID of the sender",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "ownerFederatedId",
"in": "query",
"description": "Federated ID of the receiver",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/reshare": {
"post": {
"operationId": "request_handler-re-share",
"summary": "create re-share on behalf of another user",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "shareWith",
"in": "query",
"description": "ID of the user that receives the share",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "remoteId",
"in": "query",
"description": "ID of the remote",
"schema": {
"type": "integer",
"format": "int64",
"nullable": true,
"default": 0
}
},
{
"name": "id",
"in": "path",
"description": "ID of the share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Remote share returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"token",
"remoteId"
],
"properties": {
"token": {
"type": "string"
},
"remoteId": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Re-sharing is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/permissions": {
"post": {
"operationId": "request_handler-update-permissions",
"summary": "update share information to keep federated re-shares in sync",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "permissions",
"in": "query",
"description": "New permissions",
"schema": {
"type": "integer",
"format": "int64",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Permissions updated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"400": {
"description": "Updating permissions is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/accept": {
"post": {
"operationId": "request_handler-accept-share",
"summary": "accept server-to-server share",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the remote share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share accepted successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"500": {
"description": "",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/decline": {
"post": {
"operationId": "request_handler-decline-share",
"summary": "decline server-to-server share",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the remote share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share declined successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/unshare": {
"post": {
"operationId": "request_handler-unshare",
"summary": "remove server-to-server share if it was unshared by the owner",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share unshared successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/revoke": {
"post": {
"operationId": "request_handler-revoke",
"summary": "federated share was revoked, either by the owner or the re-sharer",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share revoked successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"400": {
"description": "Revoking the share is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/cloud/shares/{id}/move": {
"post": {
"operationId": "request_handler-move",
"summary": "change the owner of a server-to-server share",
"tags": [
"request_handler"
],
"security": [
{},
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"description": "Shared secret between servers",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "remote",
"in": "query",
"description": "Address of the remote",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "remote_id",
"in": "query",
"description": "ID of the remote",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "id",
"in": "path",
"description": "ID of the share",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Share moved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"remote",
"owner"
],
"properties": {
"remote": {
"type": "string"
},
"owner": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Moving share is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
}
},
"tags": [
{
"name": "mount_public_link",
"description": "Class MountPublicLinkController\nconvert public links to federated shares"
}
]
}