You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Dimuthu Leelarathne <di...@wso2.com> on 2014/08/28 09:28:25 UTC

Retrieving ClusterId after sending Subscription

Hi all,

Our aPaaS product - App Factory uses Apache Stratos to deploy applications.
Here is our requirement,


   - A a developer click on deploy a PHP application. We send a PHP
   cartridge subscription request to Stratos.
   - The PHP cartridge is spawned and application is deployed.
   - Then we we want to show the URL to access this PHP application in the
   UI. So we started looking at how to get the IP from Apache Stratos in order
   to show in the UI.

Initial idea was to use the same methods as Stratos UI does. Stratos UI
gets tenants subscriptions (when the user logs in) and from that
information get the Cluster ID and construct the access URL. But this
cannot be done at our end because we don’t have the tenant
username/password (password is hashed). So there are two options,

   - Introduce OAuth mechanism to access Apache Stratos REST API
   - Or give us a way to get the ClusterId upon subscription


If we have the clusterId there are several ways to do it (polling or
register a event listener and filter the correct even using the clusterId
to correlate)

So would it be possible to get the ClusterId from the REST end point when
we send the Subscription request?

thanks,
dimuthu

-- 
Dimuthu Leelarathne
Architect & Product Lead of App Factory

WSO2, Inc. (http://wso2.com)
email: dimuthul@wso2.com
Mobile : 0773661935

Lean . Enterprise . Middleware

Re: Retrieving ClusterId after sending Subscription

Posted by Nirmal Fernando <ni...@gmail.com>.
+1 Dimuthu. Please send a PR over :-)


On Thu, Aug 28, 2014 at 6:36 PM, Dimuthu Leelarathne <di...@wso2.com>
wrote:

> Hi All,
>
> We actually don't need username/password because we are using Mutual SSL
> and authentication is skipped. So the real problem is there is no one API
> to get the cluster Id. cartridge/info/{subscriptionAlias} returns the
> LB's cluster Id but not the instance (our dev setup doesn't have the LB).
> We need LB cluster ID and member cluster ID both.  Since Stratos can
> be deployed without a LB it is a valid use case.
>
> Stratos UI does several calls to get this and we don't have a straight
> forward method to do this. Therefore I would like to propose to add member
> clusterID also to method-  getCartridgeInfo(@PathParam("subscriptionAlias")
> String subscriptionAlias)  in StratosAdmin.
>
> Any objections?
>
> thanks,
> dimuthu
>
>
>
>
> On Thu, Aug 28, 2014 at 12:58 PM, Dimuthu Leelarathne <di...@wso2.com>
> wrote:
>
>> Hi all,
>>
>> Our aPaaS product - App Factory uses Apache Stratos to deploy
>> applications. Here is our requirement,
>>
>>
>>    - A a developer click on deploy a PHP application. We send a PHP
>>    cartridge subscription request to Stratos.
>>    - The PHP cartridge is spawned and application is deployed.
>>    - Then we we want to show the URL to access this PHP application in
>>    the UI. So we started looking at how to get the IP from Apache Stratos in
>>    order to show in the UI.
>>
>> Initial idea was to use the same methods as Stratos UI does. Stratos UI
>> gets tenants subscriptions (when the user logs in) and from that
>> information get the Cluster ID and construct the access URL. But this
>> cannot be done at our end because we don’t have the tenant
>> username/password (password is hashed). So there are two options,
>>
>>    - Introduce OAuth mechanism to access Apache Stratos REST API
>>    - Or give us a way to get the ClusterId upon subscription
>>
>>
>> If we have the clusterId there are several ways to do it (polling or
>> register a event listener and filter the correct even using the clusterId
>> to correlate)
>>
>> So would it be possible to get the ClusterId from the REST end point when
>> we send the Subscription request?
>>
>> thanks,
>> dimuthu
>>
>> --
>> Dimuthu Leelarathne
>> Architect & Product Lead of App Factory
>>
>> WSO2, Inc. (http://wso2.com)
>> email: dimuthul@wso2.com
>> Mobile : 0773661935
>>
>> Lean . Enterprise . Middleware
>>
>
>
>
> --
> Dimuthu Leelarathne
> Architect & Product Lead of App Factory
>
> WSO2, Inc. (http://wso2.com)
> email: dimuthul@wso2.com
> Mobile : 0773661935
>
> Lean . Enterprise . Middleware
>



-- 
Best Regards,
Nirmal

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

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

Re: Retrieving ClusterId after sending Subscription

Posted by Dimuthu Leelarathne <di...@wso2.com>.
Hi All,

We actually don't need username/password because we are using Mutual SSL
and authentication is skipped. So the real problem is there is no one API
to get the cluster Id. cartridge/info/{subscriptionAlias} returns the LB's
cluster Id but not the instance (our dev setup doesn't have the LB). We
need LB cluster ID and member cluster ID both.  Since Stratos can
be deployed without a LB it is a valid use case.

Stratos UI does several calls to get this and we don't have a straight
forward method to do this. Therefore I would like to propose to add member
clusterID also to method-  getCartridgeInfo(@PathParam("subscriptionAlias")
String subscriptionAlias)  in StratosAdmin.

Any objections?

thanks,
dimuthu




On Thu, Aug 28, 2014 at 12:58 PM, Dimuthu Leelarathne <di...@wso2.com>
wrote:

> Hi all,
>
> Our aPaaS product - App Factory uses Apache Stratos to deploy
> applications. Here is our requirement,
>
>
>    - A a developer click on deploy a PHP application. We send a PHP
>    cartridge subscription request to Stratos.
>    - The PHP cartridge is spawned and application is deployed.
>    - Then we we want to show the URL to access this PHP application in
>    the UI. So we started looking at how to get the IP from Apache Stratos in
>    order to show in the UI.
>
> Initial idea was to use the same methods as Stratos UI does. Stratos UI
> gets tenants subscriptions (when the user logs in) and from that
> information get the Cluster ID and construct the access URL. But this
> cannot be done at our end because we don’t have the tenant
> username/password (password is hashed). So there are two options,
>
>    - Introduce OAuth mechanism to access Apache Stratos REST API
>    - Or give us a way to get the ClusterId upon subscription
>
>
> If we have the clusterId there are several ways to do it (polling or
> register a event listener and filter the correct even using the clusterId
> to correlate)
>
> So would it be possible to get the ClusterId from the REST end point when
> we send the Subscription request?
>
> thanks,
> dimuthu
>
> --
> Dimuthu Leelarathne
> Architect & Product Lead of App Factory
>
> WSO2, Inc. (http://wso2.com)
> email: dimuthul@wso2.com
> Mobile : 0773661935
>
> Lean . Enterprise . Middleware
>



-- 
Dimuthu Leelarathne
Architect & Product Lead of App Factory

WSO2, Inc. (http://wso2.com)
email: dimuthul@wso2.com
Mobile : 0773661935

Lean . Enterprise . Middleware