Skip to content

RestGFSCategory

stockiNail edited this page May 24, 2017 · 8 revisions

Global file system services category

The GFS services give you the capability to manage files and folders on global file system.

Getting list of files

Provides a collection of files by a filter, currently located a specific folder.

Request
Parameter Value
URL /gfs/list/{type}?item=&pathName=
Method GET
Path type parameter is mandatory and defined on which file system you are seaching the files.
The valid values could be data, library, source, class, binary
Query item parameter is mandatory and contains the relative path of the folder.
pathName parameter is optional and the path name when you have more than 1 file systems for DATA.
Content-Type application/json
Accept-Type application/json
Body none
Response
Status code Description
200 OK - Returns a list of GFS files
400 Bad Request - The type passed as path parameter is not correct or the item is not valid
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Getting the content of a file

Provides the content of a specific file.

Request
Parameter Value
URL /gfs/get/{type}?item=&pathName=
Method GET
Path type parameter is mandatory and defined on which file system you are seaching the files.
The valid values could be data, library, source, class, binary
Query item parameter is mandatory and contains the relative path of the folder.
pathName parameter is optional and the path name when you have more than 1 file systems for DATA.
Content-Type application/json
Accept-Type application/octet-stream
Body none
Response
Status code Description
200 OK - Returns the content of file
400 Bad Request - The type passed as path parameter is not correct or the item is not valid
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Putting a file

You can upload a file into GFS.

Request
Parameter Value
URL /gfs/put/{type}/{fileCode}?item=&lastUpdate=&lastUpdate=completed=
Method POST
Path type parameter is mandatory and defined on which file system you are seaching the files.
The valid values could be library, source, class, binary
fileCode parameter is mandatory and a single ID to use to save the chunks when several calls must be done.
Query item parameter is mandatory and contains the relative path of the folder.
lastUpdate parameter is optional and it is used to set the modified time on destination file.
completed parameter is mandatory and it must be a boolean: true means this is last call, otherwise false.
Content-Type application/octet-stream
Accept-Type text/plain
Body the content of the file to upload (a bytes array)
Response
Status code Description
200 OK - Returns true if it was able to updalod the file, otherwise false.
The TEXT format is:
"true" or "false"
204 No Content - the request doesn't contain any content to upload
400 Bad Request - The type passed as path parameter is not correct or the item is not valid
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Delete a file

You can delete a file on GFS.

Request
Parameter Value
URL /gfs/delete/{type}?item=&pathName=
Method DELETE
Path type parameter is mandatory and defined on which file system you are seaching the files.
The valid values could be data, library, source, class, binary
Query item parameter is mandatory and contains the relative path of the folder.
pathName parameter is optional and the path name when you have more than 1 file systems for DATA.
Content-Type application/json
Accept-Type text/plain
Body none
Response
Status code Description
200 OK - Returns true if it was able to delete the file, otherwise false.
The TEXT format is:
"true" or "false"
400 Bad Request - The type passed as path parameter is not correct or the item is not valid
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Body format

This section described the JSON format of the BODY parameters to use in the requests and the BODY responses.

Files

It's a collection of GFS files information:

[ file1,..., fileN]
GFS file

A GFS file is described by the following JSON format:

{
  "name" : "name of file",
  "longName" : "relative path of file, with name of file",
  "dataPathName" : "data path name",
  "length" : length of file (Integer),
  "lastModified" : last modified UTC (Long),
  "directory" : if the file represents a directory (Boolean)
}
Clone this wiki locally