You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Imesh Gunaratne <im...@apache.org> on 2014/04/29 06:29:56 UTC

[Discuss] Domain Mappings for Subscriptions

Hi,

Currently tenants cannot map custom domain names to subscriptions. The only
possibility is to use hostnames generated by Stratos Manager for accessing
applications deployed in Stratos via the load balancers.

Therefore I thought it would be a great value addition to implement a new
functionality to map domain names to subscriptions as described below.
Please add your thoughts.

*Functional Design:*

Subscription domains will be managed by Stratos Manager together with the
subscription information. Once domains are added to a given subscription, a
new event (SubscriptionDomainsAddedEvent [serviceName, tenantId,
clusterIds, domains]) will be published to the "tenant" topic and it will
be received by the load balancer. Load balancer will update its internal
cluster map with the given information. Similarly when domains are removed,
a new event (SubscriptionDomainsRemovedEvent [serviceName, tenantId,
clusterIds, domains]) will be published to the "tenant" topic and load
balancer will update its cluster map accordingly.

*New REST API methods:*

1. Add subscription domains:
Send a POST request to the following URL with tenant credentials to add
subscription domains:

POST  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
{
  "domains": [
     "some.oragnization1.org" ,
     "some.oragnization2.org" ,
     "some.oragnization3.org"
  ]
}

2. Get subscription domains:
Send a GET get request to the following URL with tenant credentials to get
existing subscription domains:

GET  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/

3. Remove subscription domains:
Send a DELETE request to the following URL with tenant credentials to
remove a given list of domain names:

DELETE  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
{
  "domains": [
     "some.oragnization1.org"
  ]
}


Thanks

-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
Hi All,

I have improved this feature by allowing the end user to add application
contexts (a string containing application name, version, etc) together with
the domain names:

A sample scenario:
- Consider a Tomcat cartridge (single tenant or multi-tenant).
- A given server instance would contain a collection of applications.
- User would map a domain name to a subscription.
- This would generate a mapping as follows (sample):
https://some.organization.org/ -> http://lb-host:lb-port/
- Since this server contains multiple applications, the end user might need
to access his application as follows:
https://some.organization.org/application-name/version/file-path
- However if we consider "application-name/version" as the application
context, we could allow the domain mapping to include it together with the
domain name.
- The resulting would allow the user to map domain names as follows:
some.organization.org/file-path -> http://lb-host:lb-port
/application-name/version/file-path

Updated API methods:
1. Add subscription domains:
Send a POST request to the following URL with tenant credentials to add
subscription domains:

POST  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
{
  "domainName": "some.oragnization1.org",
  "applicationContext" : "application-name-version-etc"
}

2. Get subscription domains:
Send a GET get request to the following URL with tenant credentials to get
existing subscription domains:

GET  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/

3. Remove subscription domains:
Send a DELETE request to the following URL with tenant credentials to
remove a given list of domain names:

DELETE  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
{
  "domainName": "some.oragnization1.org"
}

Thanks


On Wed, May 7, 2014 at 3:23 AM, Nirmal Fernando <ni...@gmail.com>wrote:

> Cool.. thanks Imesh. I am gonna try this feature.
>
>
> On Wed, May 7, 2014 at 12:36 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> A good question, tenant has a data structure like below:
>>
>> Tenant -> Subscription -> Subscription Domain
>>
>> Since tenant information is published to tenant topic periodically,
>> subscription domain information included in that.
>>
>>
>>
>> On Tue, May 6, 2014 at 9:27 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Imesh,
>>>
>>> Thanks for the reply. How would LB withstand a re-start? How it gets to
>>> know about the existing domain mappings?
>>>
>>>
>>> On Tue, May 6, 2014 at 8:28 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> No, domain mappings are persisted with the cartridge subscriptions (as
>>>> an aggregate to subscription) in SM.
>>>>
>>>>
>>>>
>>>> On Tue, May 6, 2014 at 7:00 PM, Nirmal Fernando <nirmal070125@gmail.com
>>>> > wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> Are you persisting these domain mappings in the topology?
>>>>>
>>>>>
>>>>> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> As I found HTTP DELETE requests do not include a message body,
>>>>>> therefore I have updated the subscription domain remove method as follows:
>>>>>>
>>>>>> *Remove subscription domains:*
>>>>>> *Send a DELETE request to the following URL with tenant credentials
>>>>>> to remove a domain:*
>>>>>>
>>>>>> *DELETE
>>>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>>>>>> <http://some.oragnization1.org/>*
>>>>>>
>>>>>> In-addition I have added a new method to validate domain names. This
>>>>>> method will return false if the given domain is already registered with a
>>>>>> subscription or true if it is valid for registration.
>>>>>>
>>>>>> *GET
>>>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>>>>>> <http://some.oragnization1.org/>/is-valid*
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>
>>>>>>> Yes I think it will not cause any problems to request-in-flight
>>>>>>> (RIF) stats. The RIF stat collector was implemented to track requests
>>>>>>> in-flight count on each cluster:
>>>>>>>
>>>>>>>     // Map<ClusterId, Integer>
>>>>>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>>>>>
>>>>>>>
>>>>>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <
>>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi Imesh,
>>>>>>>>
>>>>>>>> Sorry, I meant for the cluster. But I can't remember how we
>>>>>>>> implemented the request-in-flight stats collector. So, what I wanted to get
>>>>>>>> verified is even a user send a request from a mapped domain, we would still
>>>>>>>> collect stats for the corresponding cluster.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>>
>>>>>>>>> Hi Nirmal,
>>>>>>>>>
>>>>>>>>> Can you please explain this requirement further? I'm not sure why
>>>>>>>>> we need to track request-in-flight against domain names.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Imesh,
>>>>>>>>>>
>>>>>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <
>>>>>>>>>> imesh@apache.org> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Currently tenants cannot map custom domain names to
>>>>>>>>>>> subscriptions. The only possibility is to use hostnames generated by
>>>>>>>>>>> Stratos Manager for accessing applications deployed in Stratos via the load
>>>>>>>>>>> balancers.
>>>>>>>>>>>
>>>>>>>>>>> Therefore I thought it would be a great value addition to
>>>>>>>>>>> implement a new functionality to map domain names to subscriptions as
>>>>>>>>>>> described below. Please add your thoughts.
>>>>>>>>>>>
>>>>>>>>>>> *Functional Design:*
>>>>>>>>>>>
>>>>>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>>>>>
>>>>>>>>>>> *New REST API methods:*
>>>>>>>>>>>
>>>>>>>>>>> 1. Add subscription domains:
>>>>>>>>>>> Send a POST request to the following URL with tenant credentials
>>>>>>>>>>> to add subscription domains:
>>>>>>>>>>>
>>>>>>>>>>> POST  https://sm-ip:sm-port
>>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>>> {
>>>>>>>>>>>   "domains": [
>>>>>>>>>>>      "some.oragnization1.org" ,
>>>>>>>>>>>      "some.oragnization2.org" ,
>>>>>>>>>>>      "some.oragnization3.org"
>>>>>>>>>>>   ]
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> 2. Get subscription domains:
>>>>>>>>>>> Send a GET get request to the following URL with tenant
>>>>>>>>>>> credentials to get existing subscription domains:
>>>>>>>>>>>
>>>>>>>>>>> GET  https://sm-ip:sm-port
>>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>>>
>>>>>>>>>>> 3. Remove subscription domains:
>>>>>>>>>>> Send a DELETE request to the following URL with tenant
>>>>>>>>>>> credentials to remove a given list of domain names:
>>>>>>>>>>>
>>>>>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>>> {
>>>>>>>>>>>   "domains": [
>>>>>>>>>>>      "some.oragnization1.org"
>>>>>>>>>>>   ]
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Imesh Gunaratne
>>>>>>>>>>>
>>>>>>>>>>> Technical Lead, WSO2
>>>>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Best Regards,
>>>>>>>>>> Nirmal
>>>>>>>>>>
>>>>>>>>>> Nirmal Fernando.
>>>>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>>>>
>>>>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Imesh Gunaratne
>>>>>>>>>
>>>>>>>>> Technical Lead, WSO2
>>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Best Regards,
>>>>>>>> Nirmal
>>>>>>>>
>>>>>>>> Nirmal Fernando.
>>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>>
>>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Technical Lead, WSO2
>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Cool.. thanks Imesh. I am gonna try this feature.


On Wed, May 7, 2014 at 12:36 AM, Imesh Gunaratne <im...@apache.org> wrote:

> A good question, tenant has a data structure like below:
>
> Tenant -> Subscription -> Subscription Domain
>
> Since tenant information is published to tenant topic periodically,
> subscription domain information included in that.
>
>
>
> On Tue, May 6, 2014 at 9:27 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Imesh,
>>
>> Thanks for the reply. How would LB withstand a re-start? How it gets to
>> know about the existing domain mappings?
>>
>>
>> On Tue, May 6, 2014 at 8:28 PM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>>> No, domain mappings are persisted with the cartridge subscriptions (as
>>> an aggregate to subscription) in SM.
>>>
>>>
>>>
>>> On Tue, May 6, 2014 at 7:00 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> Are you persisting these domain mappings in the topology?
>>>>
>>>>
>>>> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> As I found HTTP DELETE requests do not include a message body,
>>>>> therefore I have updated the subscription domain remove method as follows:
>>>>>
>>>>> *Remove subscription domains:*
>>>>> *Send a DELETE request to the following URL with tenant credentials to
>>>>> remove a domain:*
>>>>>
>>>>> *DELETE
>>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>>>>> <http://some.oragnization1.org/>*
>>>>>
>>>>> In-addition I have added a new method to validate domain names. This
>>>>> method will return false if the given domain is already registered with a
>>>>> subscription or true if it is valid for registration.
>>>>>
>>>>> *GET
>>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>>>>> <http://some.oragnization1.org/>/is-valid*
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>>>>> stats. The RIF stat collector was implemented to track requests in-flight
>>>>>> count on each cluster:
>>>>>>
>>>>>>     // Map<ClusterId, Integer>
>>>>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>>>>
>>>>>>
>>>>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <
>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Imesh,
>>>>>>>
>>>>>>> Sorry, I meant for the cluster. But I can't remember how we
>>>>>>> implemented the request-in-flight stats collector. So, what I wanted to get
>>>>>>> verified is even a user send a request from a mapped domain, we would still
>>>>>>> collect stats for the corresponding cluster.
>>>>>>>
>>>>>>>
>>>>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>
>>>>>>>> Hi Nirmal,
>>>>>>>>
>>>>>>>> Can you please explain this requirement further? I'm not sure why
>>>>>>>> we need to track request-in-flight against domain names.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Imesh,
>>>>>>>>>
>>>>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <imesh@apache.org
>>>>>>>>> > wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Currently tenants cannot map custom domain names to
>>>>>>>>>> subscriptions. The only possibility is to use hostnames generated by
>>>>>>>>>> Stratos Manager for accessing applications deployed in Stratos via the load
>>>>>>>>>> balancers.
>>>>>>>>>>
>>>>>>>>>> Therefore I thought it would be a great value addition to
>>>>>>>>>> implement a new functionality to map domain names to subscriptions as
>>>>>>>>>> described below. Please add your thoughts.
>>>>>>>>>>
>>>>>>>>>> *Functional Design:*
>>>>>>>>>>
>>>>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>>>>
>>>>>>>>>> *New REST API methods:*
>>>>>>>>>>
>>>>>>>>>> 1. Add subscription domains:
>>>>>>>>>> Send a POST request to the following URL with tenant credentials
>>>>>>>>>> to add subscription domains:
>>>>>>>>>>
>>>>>>>>>> POST  https://sm-ip:sm-port
>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>> {
>>>>>>>>>>   "domains": [
>>>>>>>>>>      "some.oragnization1.org" ,
>>>>>>>>>>      "some.oragnization2.org" ,
>>>>>>>>>>      "some.oragnization3.org"
>>>>>>>>>>   ]
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> 2. Get subscription domains:
>>>>>>>>>> Send a GET get request to the following URL with tenant
>>>>>>>>>> credentials to get existing subscription domains:
>>>>>>>>>>
>>>>>>>>>> GET  https://sm-ip:sm-port
>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>>
>>>>>>>>>> 3. Remove subscription domains:
>>>>>>>>>> Send a DELETE request to the following URL with tenant
>>>>>>>>>> credentials to remove a given list of domain names:
>>>>>>>>>>
>>>>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>> {
>>>>>>>>>>   "domains": [
>>>>>>>>>>      "some.oragnization1.org"
>>>>>>>>>>   ]
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Imesh Gunaratne
>>>>>>>>>>
>>>>>>>>>> Technical Lead, WSO2
>>>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Best Regards,
>>>>>>>>> Nirmal
>>>>>>>>>
>>>>>>>>> Nirmal Fernando.
>>>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>>>
>>>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Imesh Gunaratne
>>>>>>>>
>>>>>>>> Technical Lead, WSO2
>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best Regards,
>>>>>>> Nirmal
>>>>>>>
>>>>>>> Nirmal Fernando.
>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>
>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PPMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
A good question, tenant has a data structure like below:

Tenant -> Subscription -> Subscription Domain

Since tenant information is published to tenant topic periodically,
subscription domain information included in that.



On Tue, May 6, 2014 at 9:27 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Imesh,
>
> Thanks for the reply. How would LB withstand a re-start? How it gets to
> know about the existing domain mappings?
>
>
> On Tue, May 6, 2014 at 8:28 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> No, domain mappings are persisted with the cartridge subscriptions (as an
>> aggregate to subscription) in SM.
>>
>>
>>
>> On Tue, May 6, 2014 at 7:00 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Imesh,
>>>
>>> Are you persisting these domain mappings in the topology?
>>>
>>>
>>> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> As I found HTTP DELETE requests do not include a message body,
>>>> therefore I have updated the subscription domain remove method as follows:
>>>>
>>>> *Remove subscription domains:*
>>>> *Send a DELETE request to the following URL with tenant credentials to
>>>> remove a domain:*
>>>>
>>>> *DELETE
>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>>>> <http://some.oragnization1.org/>*
>>>>
>>>> In-addition I have added a new method to validate domain names. This
>>>> method will return false if the given domain is already registered with a
>>>> subscription or true if it is valid for registration.
>>>>
>>>> *GET
>>>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>>>> <http://some.oragnization1.org/>/is-valid*
>>>>
>>>> Thanks
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>>>> stats. The RIF stat collector was implemented to track requests in-flight
>>>>> count on each cluster:
>>>>>
>>>>>     // Map<ClusterId, Integer>
>>>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <
>>>>> nirmal070125@gmail.com> wrote:
>>>>>
>>>>>> Hi Imesh,
>>>>>>
>>>>>> Sorry, I meant for the cluster. But I can't remember how we
>>>>>> implemented the request-in-flight stats collector. So, what I wanted to get
>>>>>> verified is even a user send a request from a mapped domain, we would still
>>>>>> collect stats for the corresponding cluster.
>>>>>>
>>>>>>
>>>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>
>>>>>>> Hi Nirmal,
>>>>>>>
>>>>>>> Can you please explain this requirement further? I'm not sure why we
>>>>>>> need to track request-in-flight against domain names.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi Imesh,
>>>>>>>>
>>>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>>>>
>>>>>>>>> Therefore I thought it would be a great value addition to
>>>>>>>>> implement a new functionality to map domain names to subscriptions as
>>>>>>>>> described below. Please add your thoughts.
>>>>>>>>>
>>>>>>>>> *Functional Design:*
>>>>>>>>>
>>>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>>>
>>>>>>>>> *New REST API methods:*
>>>>>>>>>
>>>>>>>>> 1. Add subscription domains:
>>>>>>>>> Send a POST request to the following URL with tenant credentials
>>>>>>>>> to add subscription domains:
>>>>>>>>>
>>>>>>>>> POST  https://sm-ip:sm-port
>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>> {
>>>>>>>>>   "domains": [
>>>>>>>>>      "some.oragnization1.org" ,
>>>>>>>>>      "some.oragnization2.org" ,
>>>>>>>>>      "some.oragnization3.org"
>>>>>>>>>   ]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> 2. Get subscription domains:
>>>>>>>>> Send a GET get request to the following URL with tenant
>>>>>>>>> credentials to get existing subscription domains:
>>>>>>>>>
>>>>>>>>> GET  https://sm-ip:sm-port
>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>>
>>>>>>>>> 3. Remove subscription domains:
>>>>>>>>> Send a DELETE request to the following URL with tenant credentials
>>>>>>>>> to remove a given list of domain names:
>>>>>>>>>
>>>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>> {
>>>>>>>>>   "domains": [
>>>>>>>>>      "some.oragnization1.org"
>>>>>>>>>   ]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Imesh Gunaratne
>>>>>>>>>
>>>>>>>>> Technical Lead, WSO2
>>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Best Regards,
>>>>>>>> Nirmal
>>>>>>>>
>>>>>>>> Nirmal Fernando.
>>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>>
>>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Technical Lead, WSO2
>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best Regards,
>>>>>> Nirmal
>>>>>>
>>>>>> Nirmal Fernando.
>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>
>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PPMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Imesh,

Thanks for the reply. How would LB withstand a re-start? How it gets to
know about the existing domain mappings?


On Tue, May 6, 2014 at 8:28 PM, Imesh Gunaratne <im...@apache.org> wrote:

> No, domain mappings are persisted with the cartridge subscriptions (as an
> aggregate to subscription) in SM.
>
>
>
> On Tue, May 6, 2014 at 7:00 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Imesh,
>>
>> Are you persisting these domain mappings in the topology?
>>
>>
>> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> As I found HTTP DELETE requests do not include a message body, therefore
>>> I have updated the subscription domain remove method as follows:
>>>
>>> *Remove subscription domains:*
>>> *Send a DELETE request to the following URL with tenant credentials to
>>> remove a domain:*
>>>
>>> *DELETE
>>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>>> <http://some.oragnization1.org/>*
>>>
>>> In-addition I have added a new method to validate domain names. This
>>> method will return false if the given domain is already registered with a
>>> subscription or true if it is valid for registration.
>>>
>>> *GET
>>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>>> <http://some.oragnization1.org/>/is-valid*
>>>
>>> Thanks
>>>
>>>
>>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>>> stats. The RIF stat collector was implemented to track requests in-flight
>>>> count on each cluster:
>>>>
>>>>     // Map<ClusterId, Integer>
>>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <
>>>> nirmal070125@gmail.com> wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> Sorry, I meant for the cluster. But I can't remember how we
>>>>> implemented the request-in-flight stats collector. So, what I wanted to get
>>>>> verified is even a user send a request from a mapped domain, we would still
>>>>> collect stats for the corresponding cluster.
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> Hi Nirmal,
>>>>>>
>>>>>> Can you please explain this requirement further? I'm not sure why we
>>>>>> need to track request-in-flight against domain names.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Imesh,
>>>>>>>
>>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>>>
>>>>>>>> Therefore I thought it would be a great value addition to implement
>>>>>>>> a new functionality to map domain names to subscriptions as described
>>>>>>>> below. Please add your thoughts.
>>>>>>>>
>>>>>>>> *Functional Design:*
>>>>>>>>
>>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>>
>>>>>>>> *New REST API methods:*
>>>>>>>>
>>>>>>>> 1. Add subscription domains:
>>>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>>>> add subscription domains:
>>>>>>>>
>>>>>>>> POST  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>> {
>>>>>>>>   "domains": [
>>>>>>>>      "some.oragnization1.org" ,
>>>>>>>>      "some.oragnization2.org" ,
>>>>>>>>      "some.oragnization3.org"
>>>>>>>>   ]
>>>>>>>> }
>>>>>>>>
>>>>>>>> 2. Get subscription domains:
>>>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>>>> to get existing subscription domains:
>>>>>>>>
>>>>>>>> GET  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>
>>>>>>>> 3. Remove subscription domains:
>>>>>>>> Send a DELETE request to the following URL with tenant credentials
>>>>>>>> to remove a given list of domain names:
>>>>>>>>
>>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>> {
>>>>>>>>   "domains": [
>>>>>>>>      "some.oragnization1.org"
>>>>>>>>   ]
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> --
>>>>>>>> Imesh Gunaratne
>>>>>>>>
>>>>>>>> Technical Lead, WSO2
>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best Regards,
>>>>>>> Nirmal
>>>>>>>
>>>>>>> Nirmal Fernando.
>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>
>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
No, domain mappings are persisted with the cartridge subscriptions (as an
aggregate to subscription) in SM.



On Tue, May 6, 2014 at 7:00 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Imesh,
>
> Are you persisting these domain mappings in the topology?
>
>
> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> As I found HTTP DELETE requests do not include a message body, therefore
>> I have updated the subscription domain remove method as follows:
>>
>> *Remove subscription domains:*
>> *Send a DELETE request to the following URL with tenant credentials to
>> remove a domain:*
>>
>> *DELETE
>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>> <http://some.oragnization1.org/>*
>>
>> In-addition I have added a new method to validate domain names. This
>> method will return false if the given domain is already registered with a
>> subscription or true if it is valid for registration.
>>
>> *GET
>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>> <http://some.oragnization1.org/>/is-valid*
>>
>> Thanks
>>
>>
>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>> stats. The RIF stat collector was implemented to track requests in-flight
>>> count on each cluster:
>>>
>>>     // Map<ClusterId, Integer>
>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>
>>>
>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> Sorry, I meant for the cluster. But I can't remember how we implemented
>>>> the request-in-flight stats collector. So, what I wanted to get verified is
>>>> even a user send a request from a mapped domain, we would still collect
>>>> stats for the corresponding cluster.
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> Hi Nirmal,
>>>>>
>>>>> Can you please explain this requirement further? I'm not sure why we
>>>>> need to track request-in-flight against domain names.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>> nirmal070125@gmail.com> wrote:
>>>>>
>>>>>> Hi Imesh,
>>>>>>
>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>
>>>>>>
>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>>
>>>>>>> Therefore I thought it would be a great value addition to implement
>>>>>>> a new functionality to map domain names to subscriptions as described
>>>>>>> below. Please add your thoughts.
>>>>>>>
>>>>>>> *Functional Design:*
>>>>>>>
>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>
>>>>>>> *New REST API methods:*
>>>>>>>
>>>>>>> 1. Add subscription domains:
>>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>>> add subscription domains:
>>>>>>>
>>>>>>> POST  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>> {
>>>>>>>   "domains": [
>>>>>>>      "some.oragnization1.org" ,
>>>>>>>      "some.oragnization2.org" ,
>>>>>>>      "some.oragnization3.org"
>>>>>>>   ]
>>>>>>> }
>>>>>>>
>>>>>>> 2. Get subscription domains:
>>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>>> to get existing subscription domains:
>>>>>>>
>>>>>>> GET  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>
>>>>>>> 3. Remove subscription domains:
>>>>>>> Send a DELETE request to the following URL with tenant credentials
>>>>>>> to remove a given list of domain names:
>>>>>>>
>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>> {
>>>>>>>   "domains": [
>>>>>>>      "some.oragnization1.org"
>>>>>>>   ]
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Technical Lead, WSO2
>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best Regards,
>>>>>> Nirmal
>>>>>>
>>>>>> Nirmal Fernando.
>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>
>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PPMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Imesh,

Are you persisting these domain mappings in the topology?


On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org> wrote:

> As I found HTTP DELETE requests do not include a message body, therefore I
> have updated the subscription domain remove method as follows:
>
> *Remove subscription domains:*
> *Send a DELETE request to the following URL with tenant credentials to
> remove a domain:*
>
> *DELETE
>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
> <http://some.oragnization1.org/>*
>
> In-addition I have added a new method to validate domain names. This
> method will return false if the given domain is already registered with a
> subscription or true if it is valid for registration.
>
> *GET
>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
> <http://some.oragnization1.org/>/is-valid*
>
> Thanks
>
>
> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Yes I think it will not cause any problems to request-in-flight (RIF)
>> stats. The RIF stat collector was implemented to track requests in-flight
>> count on each cluster:
>>
>>     // Map<ClusterId, Integer>
>>     private Map<String, Integer> clusterIdRequestCountMap;
>>
>>
>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Imesh,
>>>
>>> Sorry, I meant for the cluster. But I can't remember how we implemented
>>> the request-in-flight stats collector. So, what I wanted to get verified is
>>> even a user send a request from a mapped domain, we would still collect
>>> stats for the corresponding cluster.
>>>
>>>
>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> Hi Nirmal,
>>>>
>>>> Can you please explain this requirement further? I'm not sure why we
>>>> need to track request-in-flight against domain names.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <nirmal070125@gmail.com
>>>> > wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> We also need to support request in-flight stats for domain maaped
>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>
>>>>>
>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>
>>>>>> Therefore I thought it would be a great value addition to implement a
>>>>>> new functionality to map domain names to subscriptions as described below.
>>>>>> Please add your thoughts.
>>>>>>
>>>>>> *Functional Design:*
>>>>>>
>>>>>> Subscription domains will be managed by Stratos Manager together with
>>>>>> the subscription information. Once domains are added to a given
>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>> load balancer will update its cluster map accordingly.
>>>>>>
>>>>>> *New REST API methods:*
>>>>>>
>>>>>> 1. Add subscription domains:
>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>> add subscription domains:
>>>>>>
>>>>>> POST  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>> {
>>>>>>   "domains": [
>>>>>>      "some.oragnization1.org" ,
>>>>>>      "some.oragnization2.org" ,
>>>>>>      "some.oragnization3.org"
>>>>>>   ]
>>>>>> }
>>>>>>
>>>>>> 2. Get subscription domains:
>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>> to get existing subscription domains:
>>>>>>
>>>>>> GET  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>
>>>>>> 3. Remove subscription domains:
>>>>>> Send a DELETE request to the following URL with tenant credentials to
>>>>>> remove a given list of domain names:
>>>>>>
>>>>>> DELETE  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>> {
>>>>>>   "domains": [
>>>>>>      "some.oragnization1.org"
>>>>>>   ]
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
I did following improvements to this implementation;

1. Made domain -> domains, since domains represents a collection of
resources.
2. Implemented the capability to perform bulk domain name upload.
3. Implemented the single domain retrieval operation (in replacement for
validity operation).
4. Implemented test cases in the Stratos Manager to test the REST
functionality.


*Here's the new API:*


*1. Add subscription domains:*
Send a POST request to the following URL with tenant credentials to add
subscription domains:

POST  https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/

* If you want to map a single domain:





*{    "domains": {        "domainName": "stratos.gov
<http://stratos.gov>",        "applicationContext": "abc"    }}*

* If you want to map a collection of domains:











*{    "domains": [        {            "domainName": "stratos.com
<http://stratos.com>"        },        {             "domainName":
"stratos.org <http://stratos.org>",            "applicationContext":
"abc"        }    ]}*

*Sample Curl request:*

*curl -X POST -H "Content-Type: application/json" -d @request.json -k -v -u
admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/
<https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/>*


*2. Get All subscription domains:*

Send a GET get request to the following URL with tenant credentials to get
existing subscription domains:

GET  https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/



*Sample Curl request:**curl -X GET -H "Content-Type: application/json" -k
-v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains
<https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains>*




*Sample response:**{"domains":[{"domainName":"*
*stratos.com"},{"domainName":"**stratos.org","applicationContext":"abc"}]}*


*3. Get a subscription domain/Validate a subscription domain:*
Send a GET get request to the following URL with tenant credentials and
with the domain name to get existing subscription domain/ to check the
validity of the domain.

GET  https://sm-ip:sm-port/stratos/
admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}



*Sample Curl request:**curl -X GET -H "Content-Type: application/json" -k
-v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/
<https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/>*
*stratos.com*



*Sample response:*
* If the domain exists:

*200 OK{"domains":{"domainName":"**stratos.com"}}*

* If the domain does not exist:


*404 Not Found*
*{"Error":{ "errorCode": " 404", "errorMessage": " Could not find a
subscription [domain] **stratos.com for Cartridge [type] php and [alias]
nirmal"}*


*4. Remove subscription domains:*
Send a DELETE request to the following URL with tenant credentials to
remove a given domain

DELETE  https://sm-ip:sm-port
/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}



*Sample Curl request:**curl -X DELETE -H "Content-Type: application/json"
-k -v -u admin:admin
https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/
<https://localhost:9443/stratos/admin/cartridge/php/subscription/nirmal/domains/>*
*stratos.com *



On Wed, May 7, 2014 at 10:03 AM, Nirmal Fernando <ni...@gmail.com>wrote:

> Ok, got the point, why we need a new operation. But IMO we should have
> something like:
>
>
>
> *GET
>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
> <http://some.oragnization1.org/> *
> and if the domain is not a valid one, we should return an error, if it's a
> valid one we should send 200 OK.
>
> We shouldn't use verbs in REST APIs.
>
>
> On Wed, May 7, 2014 at 9:16 AM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>>
>> Hi Imesh,
>>
>> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> As I found HTTP DELETE requests do not include a message body, therefore
>>> I have updated the subscription domain remove method as follows:
>>>
>>> *Remove subscription domains:*
>>> *Send a DELETE request to the following URL with tenant credentials to
>>> remove a domain:*
>>>
>>> *DELETE
>>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>>> <http://some.oragnization1.org/>*
>>>
>>> In-addition I have added a new method to validate domain names. This
>>> method will return false if the given domain is already registered with a
>>> subscription or true if it is valid for registration.
>>>
>>> *GET
>>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>>> <http://some.oragnization1.org/>/is-valid*
>>>
>>
>> Why we would need a such a operation? Can't we simply do the GET and
>> throw an error, if it's not valid? This operation seems not a good REST
>> design.
>>
>>
>>>
>>> Thanks
>>>
>>>
>>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>>> stats. The RIF stat collector was implemented to track requests in-flight
>>>> count on each cluster:
>>>>
>>>>     // Map<ClusterId, Integer>
>>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <
>>>> nirmal070125@gmail.com> wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> Sorry, I meant for the cluster. But I can't remember how we
>>>>> implemented the request-in-flight stats collector. So, what I wanted to get
>>>>> verified is even a user send a request from a mapped domain, we would still
>>>>> collect stats for the corresponding cluster.
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> Hi Nirmal,
>>>>>>
>>>>>> Can you please explain this requirement further? I'm not sure why we
>>>>>> need to track request-in-flight against domain names.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>>> nirmal070125@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Imesh,
>>>>>>>
>>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>>>
>>>>>>>> Therefore I thought it would be a great value addition to implement
>>>>>>>> a new functionality to map domain names to subscriptions as described
>>>>>>>> below. Please add your thoughts.
>>>>>>>>
>>>>>>>> *Functional Design:*
>>>>>>>>
>>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>>
>>>>>>>> *New REST API methods:*
>>>>>>>>
>>>>>>>> 1. Add subscription domains:
>>>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>>>> add subscription domains:
>>>>>>>>
>>>>>>>> POST  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>> {
>>>>>>>>   "domains": [
>>>>>>>>      "some.oragnization1.org" ,
>>>>>>>>      "some.oragnization2.org" ,
>>>>>>>>      "some.oragnization3.org"
>>>>>>>>   ]
>>>>>>>> }
>>>>>>>>
>>>>>>>> 2. Get subscription domains:
>>>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>>>> to get existing subscription domains:
>>>>>>>>
>>>>>>>> GET  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>>
>>>>>>>> 3. Remove subscription domains:
>>>>>>>> Send a DELETE request to the following URL with tenant credentials
>>>>>>>> to remove a given list of domain names:
>>>>>>>>
>>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>> {
>>>>>>>>   "domains": [
>>>>>>>>      "some.oragnization1.org"
>>>>>>>>   ]
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> --
>>>>>>>> Imesh Gunaratne
>>>>>>>>
>>>>>>>> Technical Lead, WSO2
>>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Best Regards,
>>>>>>> Nirmal
>>>>>>>
>>>>>>> Nirmal Fernando.
>>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>>
>>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Ok, got the point, why we need a new operation. But IMO we should have
something like:



*GET
 https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
<http://some.oragnization1.org/>*
and if the domain is not a valid one, we should return an error, if it's a
valid one we should send 200 OK.

We shouldn't use verbs in REST APIs.


On Wed, May 7, 2014 at 9:16 AM, Nirmal Fernando <ni...@gmail.com>wrote:

>
> Hi Imesh,
>
> On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> As I found HTTP DELETE requests do not include a message body, therefore
>> I have updated the subscription domain remove method as follows:
>>
>> *Remove subscription domains:*
>> *Send a DELETE request to the following URL with tenant credentials to
>> remove a domain:*
>>
>> *DELETE
>>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
>> <http://some.oragnization1.org/>*
>>
>> In-addition I have added a new method to validate domain names. This
>> method will return false if the given domain is already registered with a
>> subscription or true if it is valid for registration.
>>
>> *GET
>>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
>> <http://some.oragnization1.org/>/is-valid*
>>
>
> Why we would need a such a operation? Can't we simply do the GET and throw
> an error, if it's not valid? This operation seems not a good REST design.
>
>
>>
>> Thanks
>>
>>
>> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> Yes I think it will not cause any problems to request-in-flight (RIF)
>>> stats. The RIF stat collector was implemented to track requests in-flight
>>> count on each cluster:
>>>
>>>     // Map<ClusterId, Integer>
>>>     private Map<String, Integer> clusterIdRequestCountMap;
>>>
>>>
>>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> Sorry, I meant for the cluster. But I can't remember how we implemented
>>>> the request-in-flight stats collector. So, what I wanted to get verified is
>>>> even a user send a request from a mapped domain, we would still collect
>>>> stats for the corresponding cluster.
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> Hi Nirmal,
>>>>>
>>>>> Can you please explain this requirement further? I'm not sure why we
>>>>> need to track request-in-flight against domain names.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <
>>>>> nirmal070125@gmail.com> wrote:
>>>>>
>>>>>> Hi Imesh,
>>>>>>
>>>>>> We also need to support request in-flight stats for domain maaped
>>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>>
>>>>>>
>>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>>
>>>>>>> Therefore I thought it would be a great value addition to implement
>>>>>>> a new functionality to map domain names to subscriptions as described
>>>>>>> below. Please add your thoughts.
>>>>>>>
>>>>>>> *Functional Design:*
>>>>>>>
>>>>>>> Subscription domains will be managed by Stratos Manager together
>>>>>>> with the subscription information. Once domains are added to a given
>>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>>> load balancer will update its cluster map accordingly.
>>>>>>>
>>>>>>> *New REST API methods:*
>>>>>>>
>>>>>>> 1. Add subscription domains:
>>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>>> add subscription domains:
>>>>>>>
>>>>>>> POST  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>> {
>>>>>>>   "domains": [
>>>>>>>      "some.oragnization1.org" ,
>>>>>>>      "some.oragnization2.org" ,
>>>>>>>      "some.oragnization3.org"
>>>>>>>   ]
>>>>>>> }
>>>>>>>
>>>>>>> 2. Get subscription domains:
>>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>>> to get existing subscription domains:
>>>>>>>
>>>>>>> GET  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>>
>>>>>>> 3. Remove subscription domains:
>>>>>>> Send a DELETE request to the following URL with tenant credentials
>>>>>>> to remove a given list of domain names:
>>>>>>>
>>>>>>> DELETE  https://sm-ip:sm-port
>>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>> {
>>>>>>>   "domains": [
>>>>>>>      "some.oragnization1.org"
>>>>>>>   ]
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Technical Lead, WSO2
>>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best Regards,
>>>>>> Nirmal
>>>>>>
>>>>>> Nirmal Fernando.
>>>>>> PPMC Member & Committer of Apache Stratos,
>>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>>
>>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PPMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Imesh,

On Sun, May 4, 2014 at 10:48 PM, Imesh Gunaratne <im...@apache.org> wrote:

> As I found HTTP DELETE requests do not include a message body, therefore I
> have updated the subscription domain remove method as follows:
>
> *Remove subscription domains:*
> *Send a DELETE request to the following URL with tenant credentials to
> remove a domain:*
>
> *DELETE
>  https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
> <http://some.oragnization1.org/>*
>
> In-addition I have added a new method to validate domain names. This
> method will return false if the given domain is already registered with a
> subscription or true if it is valid for registration.
>
> *GET
>  https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
> <http://some.oragnization1.org/>/is-valid*
>

Why we would need a such a operation? Can't we simply do the GET and throw
an error, if it's not valid? This operation seems not a good REST design.


>
> Thanks
>
>
> On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Yes I think it will not cause any problems to request-in-flight (RIF)
>> stats. The RIF stat collector was implemented to track requests in-flight
>> count on each cluster:
>>
>>     // Map<ClusterId, Integer>
>>     private Map<String, Integer> clusterIdRequestCountMap;
>>
>>
>> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Imesh,
>>>
>>> Sorry, I meant for the cluster. But I can't remember how we implemented
>>> the request-in-flight stats collector. So, what I wanted to get verified is
>>> even a user send a request from a mapped domain, we would still collect
>>> stats for the corresponding cluster.
>>>
>>>
>>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> Hi Nirmal,
>>>>
>>>> Can you please explain this requirement further? I'm not sure why we
>>>> need to track request-in-flight against domain names.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <nirmal070125@gmail.com
>>>> > wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> We also need to support request in-flight stats for domain maaped
>>>>> urls, in order to auto-scaling to work correctly. Do we have it covered?
>>>>>
>>>>>
>>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Currently tenants cannot map custom domain names to subscriptions.
>>>>>> The only possibility is to use hostnames generated by Stratos Manager for
>>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>>
>>>>>> Therefore I thought it would be a great value addition to implement a
>>>>>> new functionality to map domain names to subscriptions as described below.
>>>>>> Please add your thoughts.
>>>>>>
>>>>>> *Functional Design:*
>>>>>>
>>>>>> Subscription domains will be managed by Stratos Manager together with
>>>>>> the subscription information. Once domains are added to a given
>>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>> it will be received by the load balancer. Load balancer will update its
>>>>>> internal cluster map with the given information. Similarly when domains are
>>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>>> load balancer will update its cluster map accordingly.
>>>>>>
>>>>>> *New REST API methods:*
>>>>>>
>>>>>> 1. Add subscription domains:
>>>>>> Send a POST request to the following URL with tenant credentials to
>>>>>> add subscription domains:
>>>>>>
>>>>>> POST  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>> {
>>>>>>   "domains": [
>>>>>>      "some.oragnization1.org" ,
>>>>>>      "some.oragnization2.org" ,
>>>>>>      "some.oragnization3.org"
>>>>>>   ]
>>>>>> }
>>>>>>
>>>>>> 2. Get subscription domains:
>>>>>> Send a GET get request to the following URL with tenant credentials
>>>>>> to get existing subscription domains:
>>>>>>
>>>>>> GET  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>>
>>>>>> 3. Remove subscription domains:
>>>>>> Send a DELETE request to the following URL with tenant credentials to
>>>>>> remove a given list of domain names:
>>>>>>
>>>>>> DELETE  https://sm-ip:sm-port
>>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>> {
>>>>>>   "domains": [
>>>>>>      "some.oragnization1.org"
>>>>>>   ]
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PPMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Nirmal
>>>>>
>>>>> Nirmal Fernando.
>>>>> PPMC Member & Committer of Apache Stratos,
>>>>> Senior Software Engineer, WSO2 Inc.
>>>>>
>>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
As I found HTTP DELETE requests do not include a message body, therefore I
have updated the subscription domain remove method as follows:

*Remove subscription domains:*
*Send a DELETE request to the following URL with tenant credentials to
remove a domain:*

*DELETE
 https://sm-ip:sm-port/stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/some.oragnization1.org
<http://some.oragnization1.org/>*

In-addition I have added a new method to validate domain names. This method
will return false if the given domain is already registered with a
subscription or true if it is valid for registration.

*GET
 https://sm-ip:sm-port/stratos/admin/cartridge/subscription/domain/some.oragnization1.org
<http://some.oragnization1.org/>/is-valid*

Thanks


On Fri, May 2, 2014 at 10:55 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Yes I think it will not cause any problems to request-in-flight (RIF)
> stats. The RIF stat collector was implemented to track requests in-flight
> count on each cluster:
>
>     // Map<ClusterId, Integer>
>     private Map<String, Integer> clusterIdRequestCountMap;
>
>
> On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Imesh,
>>
>> Sorry, I meant for the cluster. But I can't remember how we implemented
>> the request-in-flight stats collector. So, what I wanted to get verified is
>> even a user send a request from a mapped domain, we would still collect
>> stats for the corresponding cluster.
>>
>>
>> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> Hi Nirmal,
>>>
>>> Can you please explain this requirement further? I'm not sure why we
>>> need to track request-in-flight against domain names.
>>>
>>> Thanks
>>>
>>>
>>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> We also need to support request in-flight stats for domain maaped urls,
>>>> in order to auto-scaling to work correctly. Do we have it covered?
>>>>
>>>>
>>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Currently tenants cannot map custom domain names to subscriptions. The
>>>>> only possibility is to use hostnames generated by Stratos Manager for
>>>>> accessing applications deployed in Stratos via the load balancers.
>>>>>
>>>>> Therefore I thought it would be a great value addition to implement a
>>>>> new functionality to map domain names to subscriptions as described below.
>>>>> Please add your thoughts.
>>>>>
>>>>> *Functional Design:*
>>>>>
>>>>> Subscription domains will be managed by Stratos Manager together with
>>>>> the subscription information. Once domains are added to a given
>>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>> it will be received by the load balancer. Load balancer will update its
>>>>> internal cluster map with the given information. Similarly when domains are
>>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>>> load balancer will update its cluster map accordingly.
>>>>>
>>>>> *New REST API methods:*
>>>>>
>>>>> 1. Add subscription domains:
>>>>> Send a POST request to the following URL with tenant credentials to
>>>>> add subscription domains:
>>>>>
>>>>> POST  https://sm-ip:sm-port
>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>> {
>>>>>   "domains": [
>>>>>      "some.oragnization1.org" ,
>>>>>      "some.oragnization2.org" ,
>>>>>      "some.oragnization3.org"
>>>>>   ]
>>>>> }
>>>>>
>>>>> 2. Get subscription domains:
>>>>> Send a GET get request to the following URL with tenant credentials to
>>>>> get existing subscription domains:
>>>>>
>>>>> GET  https://sm-ip:sm-port
>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>>
>>>>> 3. Remove subscription domains:
>>>>> Send a DELETE request to the following URL with tenant credentials to
>>>>> remove a given list of domain names:
>>>>>
>>>>> DELETE  https://sm-ip:sm-port
>>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>> {
>>>>>   "domains": [
>>>>>      "some.oragnization1.org"
>>>>>   ]
>>>>> }
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Technical Lead, WSO2
>>>>> Committer & PPMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
Yes I think it will not cause any problems to request-in-flight (RIF)
stats. The RIF stat collector was implemented to track requests in-flight
count on each cluster:

    // Map<ClusterId, Integer>
    private Map<String, Integer> clusterIdRequestCountMap;


On Fri, May 2, 2014 at 10:12 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Imesh,
>
> Sorry, I meant for the cluster. But I can't remember how we implemented
> the request-in-flight stats collector. So, what I wanted to get verified is
> even a user send a request from a mapped domain, we would still collect
> stats for the corresponding cluster.
>
>
> On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Nirmal,
>>
>> Can you please explain this requirement further? I'm not sure why we need
>> to track request-in-flight against domain names.
>>
>> Thanks
>>
>>
>> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Imesh,
>>>
>>> We also need to support request in-flight stats for domain maaped urls,
>>> in order to auto-scaling to work correctly. Do we have it covered?
>>>
>>>
>>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>>
>>>> Hi,
>>>>
>>>> Currently tenants cannot map custom domain names to subscriptions. The
>>>> only possibility is to use hostnames generated by Stratos Manager for
>>>> accessing applications deployed in Stratos via the load balancers.
>>>>
>>>> Therefore I thought it would be a great value addition to implement a
>>>> new functionality to map domain names to subscriptions as described below.
>>>> Please add your thoughts.
>>>>
>>>> *Functional Design:*
>>>>
>>>> Subscription domains will be managed by Stratos Manager together with
>>>> the subscription information. Once domains are added to a given
>>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>> it will be received by the load balancer. Load balancer will update its
>>>> internal cluster map with the given information. Similarly when domains are
>>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>>> load balancer will update its cluster map accordingly.
>>>>
>>>> *New REST API methods:*
>>>>
>>>> 1. Add subscription domains:
>>>> Send a POST request to the following URL with tenant credentials to add
>>>> subscription domains:
>>>>
>>>> POST  https://sm-ip:sm-port
>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>> {
>>>>   "domains": [
>>>>      "some.oragnization1.org" ,
>>>>      "some.oragnization2.org" ,
>>>>      "some.oragnization3.org"
>>>>   ]
>>>> }
>>>>
>>>> 2. Get subscription domains:
>>>> Send a GET get request to the following URL with tenant credentials to
>>>> get existing subscription domains:
>>>>
>>>> GET  https://sm-ip:sm-port
>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>>
>>>> 3. Remove subscription domains:
>>>> Send a DELETE request to the following URL with tenant credentials to
>>>> remove a given list of domain names:
>>>>
>>>> DELETE  https://sm-ip:sm-port
>>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>> {
>>>>   "domains": [
>>>>      "some.oragnization1.org"
>>>>   ]
>>>> }
>>>>
>>>>
>>>> Thanks
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PPMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Imesh,

Sorry, I meant for the cluster. But I can't remember how we implemented the
request-in-flight stats collector. So, what I wanted to get verified is
even a user send a request from a mapped domain, we would still collect
stats for the corresponding cluster.


On Fri, May 2, 2014 at 10:05 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Nirmal,
>
> Can you please explain this requirement further? I'm not sure why we need
> to track request-in-flight against domain names.
>
> Thanks
>
>
> On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Imesh,
>>
>> We also need to support request in-flight stats for domain maaped urls,
>> in order to auto-scaling to work correctly. Do we have it covered?
>>
>>
>> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> Hi,
>>>
>>> Currently tenants cannot map custom domain names to subscriptions. The
>>> only possibility is to use hostnames generated by Stratos Manager for
>>> accessing applications deployed in Stratos via the load balancers.
>>>
>>> Therefore I thought it would be a great value addition to implement a
>>> new functionality to map domain names to subscriptions as described below.
>>> Please add your thoughts.
>>>
>>> *Functional Design:*
>>>
>>> Subscription domains will be managed by Stratos Manager together with
>>> the subscription information. Once domains are added to a given
>>> subscription, a new event (SubscriptionDomainsAddedEvent [serviceName,
>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>> it will be received by the load balancer. Load balancer will update its
>>> internal cluster map with the given information. Similarly when domains are
>>> removed, a new event (SubscriptionDomainsRemovedEvent [serviceName,
>>> tenantId, clusterIds, domains]) will be published to the "tenant" topic and
>>> load balancer will update its cluster map accordingly.
>>>
>>> *New REST API methods:*
>>>
>>> 1. Add subscription domains:
>>> Send a POST request to the following URL with tenant credentials to add
>>> subscription domains:
>>>
>>> POST  https://sm-ip:sm-port
>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>> {
>>>   "domains": [
>>>      "some.oragnization1.org" ,
>>>      "some.oragnization2.org" ,
>>>      "some.oragnization3.org"
>>>   ]
>>> }
>>>
>>> 2. Get subscription domains:
>>> Send a GET get request to the following URL with tenant credentials to
>>> get existing subscription domains:
>>>
>>> GET  https://sm-ip:sm-port
>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>>
>>> 3. Remove subscription domains:
>>> Send a DELETE request to the following URL with tenant credentials to
>>> remove a given list of domain names:
>>>
>>> DELETE  https://sm-ip:sm-port
>>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>> {
>>>   "domains": [
>>>      "some.oragnization1.org"
>>>   ]
>>> }
>>>
>>>
>>> Thanks
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Nirmal,

Can you please explain this requirement further? I'm not sure why we need
to track request-in-flight against domain names.

Thanks


On Fri, May 2, 2014 at 9:34 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Imesh,
>
> We also need to support request in-flight stats for domain maaped urls, in
> order to auto-scaling to work correctly. Do we have it covered?
>
>
> On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi,
>>
>> Currently tenants cannot map custom domain names to subscriptions. The
>> only possibility is to use hostnames generated by Stratos Manager for
>> accessing applications deployed in Stratos via the load balancers.
>>
>> Therefore I thought it would be a great value addition to implement a new
>> functionality to map domain names to subscriptions as described below.
>> Please add your thoughts.
>>
>> *Functional Design:*
>>
>> Subscription domains will be managed by Stratos Manager together with the
>> subscription information. Once domains are added to a given subscription, a
>> new event (SubscriptionDomainsAddedEvent [serviceName, tenantId,
>> clusterIds, domains]) will be published to the "tenant" topic and it will
>> be received by the load balancer. Load balancer will update its internal
>> cluster map with the given information. Similarly when domains are removed,
>> a new event (SubscriptionDomainsRemovedEvent [serviceName, tenantId,
>> clusterIds, domains]) will be published to the "tenant" topic and load
>> balancer will update its cluster map accordingly.
>>
>> *New REST API methods:*
>>
>> 1. Add subscription domains:
>> Send a POST request to the following URL with tenant credentials to add
>> subscription domains:
>>
>> POST  https://sm-ip:sm-port
>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>> {
>>   "domains": [
>>      "some.oragnization1.org" ,
>>      "some.oragnization2.org" ,
>>      "some.oragnization3.org"
>>   ]
>> }
>>
>> 2. Get subscription domains:
>> Send a GET get request to the following URL with tenant credentials to
>> get existing subscription domains:
>>
>> GET  https://sm-ip:sm-port
>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>>
>> 3. Remove subscription domains:
>> Send a DELETE request to the following URL with tenant credentials to
>> remove a given list of domain names:
>>
>> DELETE  https://sm-ip:sm-port
>> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>> {
>>   "domains": [
>>      "some.oragnization1.org"
>>   ]
>> }
>>
>>
>> Thanks
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: [Discuss] Domain Mappings for Subscriptions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Imesh,

We also need to support request in-flight stats for domain maaped urls, in
order to auto-scaling to work correctly. Do we have it covered?


On Tue, Apr 29, 2014 at 9:59 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi,
>
> Currently tenants cannot map custom domain names to subscriptions. The
> only possibility is to use hostnames generated by Stratos Manager for
> accessing applications deployed in Stratos via the load balancers.
>
> Therefore I thought it would be a great value addition to implement a new
> functionality to map domain names to subscriptions as described below.
> Please add your thoughts.
>
> *Functional Design:*
>
> Subscription domains will be managed by Stratos Manager together with the
> subscription information. Once domains are added to a given subscription, a
> new event (SubscriptionDomainsAddedEvent [serviceName, tenantId,
> clusterIds, domains]) will be published to the "tenant" topic and it will
> be received by the load balancer. Load balancer will update its internal
> cluster map with the given information. Similarly when domains are removed,
> a new event (SubscriptionDomainsRemovedEvent [serviceName, tenantId,
> clusterIds, domains]) will be published to the "tenant" topic and load
> balancer will update its cluster map accordingly.
>
> *New REST API methods:*
>
> 1. Add subscription domains:
> Send a POST request to the following URL with tenant credentials to add
> subscription domains:
>
> POST  https://sm-ip:sm-port
> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
> {
>   "domains": [
>      "some.oragnization1.org" ,
>      "some.oragnization2.org" ,
>      "some.oragnization3.org"
>   ]
> }
>
> 2. Get subscription domains:
> Send a GET get request to the following URL with tenant credentials to get
> existing subscription domains:
>
> GET  https://sm-ip:sm-port
> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
>
> 3. Remove subscription domains:
> Send a DELETE request to the following URL with tenant credentials to
> remove a given list of domain names:
>
> DELETE  https://sm-ip:sm-port
> /stratos/admin/cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domain/
> {
>   "domains": [
>      "some.oragnization1.org"
>   ]
> }
>
>
> Thanks
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Best Regards,
Nirmal

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

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