Hi Udara,

I'm not a REST expert, generally in a POST request we put data in the body
itself.

For an example, POST
/metadata/application/<app_id>/cluster/<cluster_id>/properties can be
changed to POST /metadata/application/cluster/, and then put the <app_id>
and <cluster_id> in the request body itself. Shall we check which method is
the best practice?

On Wed, Sep 17, 2014 at 2:41 PM, Udara Liyanage <[email protected]> wrote:

>
> Metadata service with service grouping
>
> Current implementation of metadata service only allows posting
> username,password,hostname to metadata service. This works for MySQL,
> however this might not be the case all the time. A cluster have multiple
> dependent clusters. For instance SugarCRM depends on MySQL and PHP. So
> SugarCRM cluster depends on both MySQL cluster and PHP cluster. Details
> exposed by MySQL and PHP varies. MySQL publishes its username,password,ip
> where as PHP might publishes some other infromation such as hostIp. So it
> is better to have them as generic key value pairs.
>
> AutoScaler publishes
> dependencies of a cluster
> properties of all clusters
> to metadata service using metadata APIs. Cartridge agent within instances
> can retrive the properties using metadata API. Below I listed done draft
> REST APIs of metadata.
>
> Please note that API endpoint are not yet finalized.
>
> *Get all dependencies of a cluster*
> GET /metadata/application/<app_id>/cluster/<cluster_id>/dependencies
> c1, c2,c3
>
> *Get properties of a cluster*
> GET /metadata/application/<app_id>/cluster/<cluster_id>/properties
> username=udara, hostip=192.268.16.90,password=password
>
> *Get a specific property of a cluster*
> GET /metadata/application/<app_id>/cluster/<cluster_id>/properties/host
> 192.168.12.34
>
> GET /metadata/application/<app_id>/cluster/<cluster_id>/properties/password
> temp123
>
> *Add dependencies*
>
> POST /metadata/application/<app_id>/cluster<cluster_id>/dependencies
>    "dependencies":[
> {cluster=c1,dependson=c2},
> {cluster=c1,dependson=c3},
> {cluster=c2,dependson=c4}
>    ]
>
> *Add properties*
>
> POST /metadata/application/<app_id>/cluster/<cluster_id>/properties
>
>    "properties":[
> {name=host,value=192.168.12.34},
> {name=username,value=udara},
> {name=password,value=temp123}
>    ]
>
> *Add a property*
>
> POST
> /metadata/application/<app_id>/cluster/<cluster_id>/properties/username
> udara
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048* <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Reply via email to