Difference between revisions of "Home Library REST API"

From Gcube Wiki
Jump to: navigation, search
(Created page with "= Overview = The Home Library REST interface is a = Key features = Users can use the token to access to REST interface. They can access just their own files and the folders...")
 
Line 41: Line 41:
 
<source lang="java">
 
<source lang="java">
 
HL_webapp/rest/CreateFolder?name=myFolder&description=myDescription&parentPath=/Home/valentina.marioli/Workspace/MyDocs/
 
HL_webapp/rest/CreateFolder?name=myFolder&description=myDescription&parentPath=/Home/valentina.marioli/Workspace/MyDocs/
 +
</source>
 +
 +
=== List the content of a folder ===
 +
To list the content of a folder:
 +
<source lang="java">
 +
HL_webapp/rest/ListFolder?absPath=$path
 +
</source>
 +
 +
Where:
 +
* '''absPath''': the absolute path of the folder to list.
 +
 +
Example:
 +
 +
<source lang="java">
 +
HL_webapp/rest/ListFolder?absPath=/Home/valentina.marioli/Workspace/MySpecialFolders/gcube-devNext-NextNext/
 
</source>
 
</source>
  
Line 72: Line 87:
 
Where:
 
Where:
 
* '''absPath''': the absolute path of the file/folder to remove.
 
* '''absPath''': the absolute path of the file/folder to remove.
 
 
=== List the content of a folder ===
 
To list the content of a folder:
 
<source lang="java">
 
HL_webapp/rest/ListFolder?absPath=$path
 
</source>
 
 
Where:
 
* '''absPath''': the absolute path of the folder to list.
 
 
Example:
 
 
<source lang="java">
 
HL_webapp/rest/ListFolder?absPath=/Home/valentina.marioli/Workspace/MySpecialFolders/gcube-devNext-NextNext/
 
</source>
 

Revision as of 11:53, 18 October 2016

Overview

The Home Library REST interface is a

Key features

Users can use the token to access to REST interface. They can access just their own files and the folders shared with them.

Home Library REST interface supports the following operations:

  • Create Folder: to create a folder in the given parent path;
  • List: to list the content of a folder;
  • Upload file: to upload a file in a folder;
  • Remove files and folders: to remove a file or a folder (including subfolders).

Use cases

Users can:

  • use the browser to call API Methods
  • implement a Client in different languages

Design

Architecture

API

Get started

Home Library REST is available from gCube 4.1.

Create Folder

To create a new folder:

HL_webapp/rest/CreateFolder?name=$name&description=$desc&parentPath=$path

Where:

  • name: the name of the new folder.
  • description: the description for the new folder.
  • parentPath: the position where you want to save the folder.

Example:

HL_webapp/rest/CreateFolder?name=myFolder&description=myDescription&parentPath=/Home/valentina.marioli/Workspace/MyDocs/

List the content of a folder

To list the content of a folder:

HL_webapp/rest/ListFolder?absPath=$path

Where:

  • absPath: the absolute path of the folder to list.

Example:

HL_webapp/rest/ListFolder?absPath=/Home/valentina.marioli/Workspace/MySpecialFolders/gcube-devNext-NextNext/

Upload File

To upload a file, if it does not already exist:

HL_webapp/rest/Upload?name=$name&description=$description&parentPath=$path

Where:

  • name: the file to upload
  • description: a description for the file
  • parentPath: the position where you want to save the file.

If you want to skip mimetype and size detect steps because you already know them, you can pass them as parameter:

HL_webapp/rest/Upload?name=$name&description=$description&parentPath=$path&mimetype=$mimetype&size=$size

You have to attach the file as mutipart content of your request.


Delete File or folder

To remove a file or a folder:

HL_webapp/rest/Delete?absPath=$path

Where:

  • absPath: the absolute path of the file/folder to remove.