+1 for Raj's suggestion.

Also, how about in "updateX" operations if the updated object is returned
instead of the boolean? That will make the programming in client side easy,
otherwise it will need to do another "getX" call to retrieve the updated
object ?

Thanks,
Sajith

On Fri, Sep 26, 2014 at 2:44 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
wrote:

> Hi,
>
> One KubernetesHost is associated with only one KubernetesGroup. Hence
> ideally KubernetesHost class should have a reference to KubernetesGroup. I
> mean KubernetesHost should have a KubernetesGroupId filed.
>
> There are some advantages of doing this.
>
>    1. We need to pass only KubernetesHost object when calling
>    addKubernetesHost() method. Currently we are passing both KubernetesGroupId
>    and KubernetesHost object.
>    2. removeKubernetesHost() method will become more efficient. I could
>    see that you are looping through all Kubernetes Groups in-order to identify
>    which Group has the given host. Then you are removing the host from that
>    group. If you store the  KubernetesGroupId in the KubernetesHost object,
>    then no need to loop through all the KubernetesGroups. Of course we need to
>    pass the KubernetesHost object to the removeKubernetesHost() method.
>    3. updateKubernetesHost() would work faster because of the same reason
>    as above.
>
> It will improve the performance.
>
> wdyt?
>
> Thanks.
>
> On Fri, Sep 26, 2014 at 2:23 PM, Akila Ravihansa Perera <
> raviha...@wso2.com> wrote:
>
>> Hi Nirmal,
>>
>> >>
>> >> Thanks for bringing that up.
>> >>
>> >> Since Kubernetes Group ID is given in the request body itself,
>> >
>> >
>> > Are we adding it in request body or in the request path?
>>
>> When deploying a new KubernetesGroup we are specifying the groupId in
>> the request body itself. We are basically serializing the
>> KubernetesGroup object which contains the groupId field.
>>
>> But when deploying a Kubernetes host, we are passing Kubernetes
>> groupId in the request path.
>>
>>
>> >
>> >>
>> >> shouldn't we make it PUT? Here is a good discussion about this on
>> >> StackOverflow [1].
>> >>
>> >> [1] http://stackoverflow.com/questions/630453/put-vs-post-in-rest
>> >>
>> >> On Fri, Sep 26, 2014 at 1:20 PM, Nirmal Fernando <
>> nirmal070...@gmail.com>
>> >> wrote:
>> >> >
>> >> > On Fri, Sep 26, 2014 at 1:17 PM, Akila Ravihansa Perera
>> >> > <raviha...@wso2.com>
>> >> > wrote:
>> >> >>
>> >> >> Thanks everyone for joining the call. Really sorry about the
>> technical
>> >> >> glitches we had to face during the Hangout.
>> >> >>
>> >> >> Here are the meeting notes;
>> >> >>
>> >> >> 1. Clean up the REST API. Change the REST APIs to adhere to RESTful
>> >> >> design
>> >> >> (not only limited to Kubernetes host registration)
>> >> >>
>> >> >> For eg -
>> >> >>
>> >> >> Deploying a new Kubernetes host -
>> >> >> PUT /kubernetes/group/{kubernetesGroupId}/host
>> >> >>
>> >> >>
>> >> >> Deploying a new Kubernetes group -
>> >> >> PUT /kubernetes/group/
>> >> >
>> >> >
>> >> > These should be POST IMO.
>> >> >>
>> >> >>
>> >> >> 2. Remove boolean return types in AutoScalerService interface
>> >> >>
>> >> >>
>> >> >> Adding to that what I could not discuss:
>> >> >>
>> >> >> 1. Shall we rename KubernetesGroup -> KubernetesCluster to make the
>> >> >> naming
>> >> >> consistent?
>> >> >
>> >> >
>> >> > +1
>> >> >>
>> >> >>
>> >> >>
>> >> >> Thanks.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Best Regards,
>> >> > Nirmal
>> >> >
>> >> > Nirmal Fernando.
>> >> > PPMC Member & Committer of Apache Stratos,
>> >> > Senior Software Engineer, WSO2 Inc.
>> >> >
>> >> > Blog: http://nirmalfdo.blogspot.com/
>> >>
>> >>
>> >>
>> >> --
>> >> Akila Ravihansa Perera
>> >> Software Engineer, WSO2
>> >>
>> >> Blog: http://ravihansa3000.blogspot.com
>> >
>> >
>> >
>> >
>> > --
>> > Best Regards,
>> > Nirmal
>> >
>> > Nirmal Fernando.
>> > PPMC Member & Committer of Apache Stratos,
>> > Senior Software Engineer, WSO2 Inc.
>> >
>> > Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> Software Engineer, WSO2
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>



-- 
*Sajith Kariyawasam*


*Committer and PMC member, Apache Stratos,WSO2 Inc., http://wso2.com
<http://wso2.com>AMIE (SL)Mobile: +94772269575*

Reply via email to