stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirmal Fernando <nirmal070...@gmail.com>
Subject Re: Designing the REST API
Date Wed, 06 Nov 2013 02:07:40 GMT
Hi Pradeep,

Thanks for bringing this up.
On Nov 4, 2013 10:02 PM, "Pradeep Fernando" <pradeepfn@gmail.com> wrote:
>
> Hi devs,
>
> I recently worked on porting tenant mgt operations to REST API. Below is
the API i came up with.
>
> Main operations,
>
> - addTenant
> - deleteTenant
We need to carefully support this operation since upon this event, we need
to remove all existing subscriptions etc.

> - updateTenant
We should not allow changing tenant domain IMO, but a set of selected
attributes.

> - getTenant
> - search tenants by a String
> - activateTenant
> - deactivateTenant
>  - getCompleteTenantList
Is there any reason why this is not 'getAllTenants'?
>
>
>
> API i came up with,
>
> Considered tenant as a resource,
> the below string is formatted as , operation, HTTPMethod, REST endpoint,
payload
>
> - addTenant  , POST, /admin/tenant, tenantInfoBean as a JSON payload
> - deleteTenant, DELETE, /admin/tenant/{tenantDomain}
> - updateTenant, PUT, /admin/tenant, tenantInfoBean as a JSON payload
Don't we need tenant domain at the end? That would make it easy to
authorize?

> - getTenant, GET, /admin/tenant/{tenantDomain}
>

I'm bit confused on the admin context you have used here. For an example to
add a tenant you have to be in super tenant mode and to update a tenant IMO
you need to be in tenant admin mode.

But I'm not sure whether that should exhibit in the url.

> The other operations are kind of utility operations. I could not
co-relate them to any resource.
>
> - search tenants by a String, GET, /admin/tenant/search/{searchString}
> - activateTenant , POST, /admin/tenant/activate/{tenantDomain}
> - deactivateTenant, POST, /admin/tenant/deactivate/{tenantDomain}
>  - getCompleteTenantList, GET, /admin/tenant/list
>
>
> I used POST method in tenant activate/deactivate operations, because it
modifies the tenant aspect...
> IMHO we do not need versioning info in our REST API endpoints. There will
be one stratos controller for a given setup and I do not see a use case for
maintaining two different version of the same admin API..
>
+1
>
> I have attached the patch for above implementation, to the JIRA [1]
>
> The above API is open for discussion and i can change the current impl if
required..
>
> [1] https://issues.apache.org/jira/browse/STRATOS-152
>
>
>
> On Fri, Oct 4, 2013 at 11:07 PM, Pradeep Fernando <pradeepfn@gmail.com>
wrote:
>>
>> Hi All,
>>
>> This thread is to discuss about the admin services required by Stratos
Controller and its API definitions.
>>
>> your thoughts/suggestions are highly appreciated.
>>
>> thanks,
>> --Pradeep
>
>
>
>
> --
> Pradeep Fernando.
> http://pradeepfernando.blogspot.com/

Mime
View raw message