[Gluster-devel] Gluster REST - Management REST APIs for Glusterd 1.0

Luis Pabon lpabon at redhat.com
Mon Jan 4 15:26:53 UTC 2016


I highly encourage the projects to have almost 100% equal APIs (including returned JSON objects, errors, etc).  Asking clients to change their code due to a change in the server would most likely be received in a negative way.  On the other hand, if the v1 and v2 servers use the same API, there is no need to change the client.

Let me see if I can describe it in another way.  Changing the API is normally done due to a feature change, and not due to a change in the implementation of the API.


- Luis

----- Original Message -----
From: "Aravinda" <avishwan at redhat.com>
To: "Vijay Bellur" <vbellur at redhat.com>, "Gluster Devel" <gluster-devel at gluster.org>
Sent: Monday, December 28, 2015 2:57:58 AM
Subject: Re: [Gluster-devel] Gluster REST - Management REST APIs for	Glusterd 1.0


regards
Aravinda

On 12/28/2015 01:01 PM, Vijay Bellur wrote:
> On 12/21/2015 05:51 AM, Aravinda wrote:
>> Hi,
>>
>> In the past I submitted a feature([1] and [2]) to provide REST interface
>> to Gluster
>> CLI commands. I abandoned the patch because Glusterd 2.0 had plan to
>> include REST API support natively. Now I started again since other
>> projects like "skyrings"[3] is looking for REST API support for
>> Gluster.
>>
>> Created a gist[4] to discuss the REST API formats, Please review and let
>> me know your thoughts. Document is still in WIP, will update the
>> document by next week.
>>
>
> Are these APIs in sync with the ones in review for glusterd 2.0? Even 
> with api versioning, I would like us to have the APIs similar to 2.0 
> as much as possible.

I am trying to keep the APIs in sync with glusterd 2.0 for easy 
migration. But have some confusions while choosing the HTTP method for 
some URLs.
For example: Volume Creation.

Glusterd 2.0 uses volume name as part of body instead of part of URL 
since volume id is unique identifier and which can be used to perform 
other volume operations like start/stop.
But in Glusterd 1.0 operations based on ID is not possible using CLIs so 
two calls per request.

POST /volumes/:id/start

In Glusterd 1.0,
     Get Volname from Gluster Volume info
     Use that Volname to construct Gluster CLI(gluster volume start :name)

In Glusterd 2.0,
     May be directly possible to perform action using id.

To avoid this extra processing, I used Volume name as part of URL since 
Volume name is unique identifier per Cluster and these REST APIs are for 
single cluster management.

In Glusterd 1.0
     PUT /volumes/:name

In Glusterd 2.0
     POST /volumes

Once I submit the draft of REST API doc, we can discuss about these issues.


>
> Thanks,
> Vijay
>
>> [1]
>> http://www.gluster.org/community/documentation/index.php/Features/rest-api 
>>
>> [2] http://review.gluster.org/#/c/7860/
>> [3] https://github.com/skyrings/
>> [4] https://gist.github.com/aravindavk/6961564b4b1d966b8845
>>
>

_______________________________________________
Gluster-devel mailing list
Gluster-devel at gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel


More information about the Gluster-devel mailing list