stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chamila De Alwis <chami...@wso2.com>
Subject Re: [Q?] Updating the Kubernetes-CoreOS Host via REST API?
Date Sun, 12 Apr 2015 21:02:20 GMT
Hi Mary,

Thanks for reporting this! I can't find the exact commit which might have
deleted the existing API method. However I noticed some irregularities in
the API methods related to Kubernetes Hosts.

As you have pointed out earlier for documentation, the terms, "minion" and
"host" seem to be used interchangeably. For example to add a Kubernetes
host the method is as follows.

@PUT
@Path("/kubernetesClusters/{kubernetesClusterId}/minion")
@Produces("application/json")
@Consumes("application/json")
@AuthorizationAction("/permission/admin/manage/addKubernetesHost")
public Response addKubernetesHost(


However the resource path for Kubernetes host removal is as follows. IMO we
should drop the usage of the term minion in the resource paths.

@DELETE
@Path("/kubernetesClusters/{kubernetesClusterId}/hosts/{hostId}")
@Produces("application/json")
@Consumes("application/json")
@AuthorizationAction("/permission/admin/manage/removeKubernetesHostCluster")
public Response removeKubernetesHostOfKubernetesCluster(


Furthermore, the first method, to add a Kubernetes host should be a POST
method AFAIU. A PUT/PATCH method is supposed to update an existing
resource, whereas here, the name of the method itself defeats the purpose.

To address the initial issue, the PUT method should be implemented with a
resource path of */kubernetesClusters/{kubernetesClusterId}/hosts/{hostId}* to
update the host. The existing method is a left over from the initial
implementation of API methods for Kubernetes.


Regards,
Chamila de Alwis
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com



On Tue, Apr 7, 2015 at 2:45 PM, Mariangela Hills <mariangela@wso2.com>
wrote:

> I have created a JIRA [1] regarding these issues.
>
> [1] https://issues.apache.org/jira/browse/STRATOS-1319
>
> Regards,
> Mariangela
>
>
>
>
> *--*
> Mariangela Hills
> Senior Technical Writer
>
> *WSO2, Inc.*lean.enterprise.middleware.
> m: +94 773 500185
> w: http://wso2.com
> <http://wso2.com/events/>
>
> On Tue, Apr 7, 2015 at 2:21 PM, Mariangela Hills <mariangela@wso2.com>
> wrote:
>
>> Hi Devs,
>>
>> Previously, the following resource was used to update the
>> Kubernetes-CoreOS Host via REST API:
>> PATCH kubernetesClusters/{kubernetesClusterId}/minion/{minionId}
>>
>> However, now the above resource path can not be found in the code base.
>> Instead, now the following resource path is available:
>> PUT /kubernetes/update/host
>>
>> I had to pass the "clusterId" property as well in the JSON that defined
>> the Kubernetes-CoreOS host.
>>
>> Q1 -
>> How come the following resource does not follow the REST API standard
>> format that has been used for all Stratos API resource paths?
>> /kubernetes/update/host
>>
>> Q2 -
>> Is it correct that the "clusterId" property has to be passed in the
>> Kubernetes-CoreOS host payload, when the "clusterId" property has not
>> been defined in the KubernetesHostBean?
>>
>> Regards,
>> Mariangela
>>
>>
>>
>>
>> *--*
>> Mariangela Hills
>> Senior Technical Writer
>>
>> *WSO2, Inc.*lean.enterprise.middleware.
>> m: +94 773 500185
>> w: http://wso2.com
>> <http://wso2.com/events/>
>>
>
>

Mime
View raw message