stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirmal Fernando <nirmal070...@gmail.com>
Subject Re: Making Stratos REST API restfull
Date Thu, 20 Nov 2014 06:15:18 GMT
+1 for GET /tenants/{tenantDomain}

On Thu, Nov 20, 2014 at 5:44 AM, Udara Liyanage <udara@wso2.com> wrote:

>
> Hi,
>
> We have the following REST API method which IMO should be
> removed/deprecated. IMO it is not the RESTfull way of doing. Client should
> determine the availability of domain by sending a GET /tenants/{domains}
> and determine the availability by looking at the response of it.
> Further this should be GET, not POST
>
> @POST
> @Path("tenant/availability/{tenantDomain}")
> @Consumes("application/json")
> @AuthorizationAction("/permission/protected/manage/modify/tenants")
> @SuperTenantService(true)
> public Response isDomainAvailable(@PathParam("tenantDomain") String
> tenantDomain) throws RestAPIException {
>     boolean available;
>     try {
>         available = CommonUtil.isDomainNameAvailable(tenantDomain);
>     } catch (Exception e) {
>         String msg = "Error in checking domain " + tenantDomain + " is
> available";
>         log.error(msg, e);
>         throw new RestAPIException(msg);
>     }
>     // return a boolean
>     return Response.ok(available).build();
> }
>
>
> WDYT?
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Mime
View raw message