Difference between revisions of "SStorageRest"

From Gcube Wiki
Jump to: navigation, search
(Maven artifacts)
(Usage examples)
Line 50: Line 50:
  
 
To insert (create) a new record in the system, we might use:
 
To insert (create) a new record in the system, we might use:
POST n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx
+
* POST n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx
  
 
To read a object with  ID# 33245:
 
To read a object with  ID# 33245:
GET http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources/33245?gcube-token=xxxxxxxx The same URI would be used for PUT and DELETE, to update and delete, respectively.
+
* GET http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources/33245?gcube-token=xxxxxxxx The same URI would be used for PUT and DELETE, to update and delete, respectively.
  
 
Here are proposed URIs for products:
 
Here are proposed URIs for products:
POST http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx for creating a new object.
+
* POST http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx for creating a new object.
  
GET|PUT|DELETE http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources/33245?gcube-token=xxxxxxxx
+
* GET|PUT|DELETE http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources/33245?gcube-token=xxxxxxxx
 
for reading, updating, deleting object with id 66432, respectively.
 
for reading, updating, deleting object with id 66432, respectively.
  
 
For deleting all the objects in the collection:
 
For deleting all the objects in the collection:
  
DELETE http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx
+
* DELETE http://n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx
  
 
= Deployment =
 
= Deployment =

Revision as of 17:53, 21 December 2017


Overview

A RESTful service providing functions for create, update, read a json object on MongoDB

Key features

The core of the service is java based. It offers a interface for performing CRUD operation through a remote backend over JSON object:

  • Create
  • Read
  • Update
  • Delete


Design and Architecture

The architecture implements a multiton pattern. The records are collected in two separated collection: the first one is a collection dedicated to a single SmartApps, the second One is a collection that collects all the records of all the smartApplications.

Access Mode

The endppoint of the service could be discovered by IS-Collector service. Now it is deployed under SmartArea VO. For accessing to the service it's needed to use the ic-client library in the following way:

 

Supported Operations

  • create: implemented by http POST method;
  • read : implemented by http GET method;
  • update: implemented by http PUT method;
  • delete: implemented by http DELETE method.

Getting-Started

Maven artifacts

it is downloadable by the following nexus server: http://maven.research-infrastructures.eu/nexus

<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-service-rest</artifactId>

Usage examples

To insert (create) a new record in the system, we might use:

  • POST n039.smart-applications.area.pi.cnr.it:8080/storage/rest/resources?gcube-token=xxxxxxxx

To read a object with ID# 33245:

Here are proposed URIs for products:

for reading, updating, deleting object with id 66432, respectively.

For deleting all the objects in the collection:

Deployment