Hi Akila,

Thanks for the suggestion. I will have a look at it.

*Get properties for a cluster*

GET application/webapp/cluster/php/cluster/properties
{
  "properties": [
    {
      "key": "password",
      "values": "password"
    },
    {
      "key": "host",
      "values": "metadata.stratos.com"
    },
    {
      "key": "dependencies",
      "values": [
        "mongoCluster",
        "mysqlCluster"
      ]
    }
  ]
}

*Add properties of a cluster*

POST -d @props application/webapp/cluster/php/properties

{
  "properties": [
    {
      "key": "host",
      "values": "metadata.stratos.com"
    },
    {
      "key": "dependencies",
      "values": [
        "mongoCluster",
        "mysqlCluster"
      ]
    },
        {
      "key": "password",
      "values": "password"
    }
  ]
}

On Thu, Sep 18, 2014 at 4:47 PM, Gayan Gunarathne <[email protected]> wrote:

> +1 for this as above we are sending all the available properties/values,
> not just the ones want to update. So we can use PUT and get that state
> idempotent behavior for meta data.
>
> On Thu, Sep 18, 2014 at 1:55 PM, Shiroshica Kulatilake <[email protected]>
> wrote:
>
>>
>>
>> On Thu, Sep 18, 2014 at 1:51 PM, Akila Ravihansa Perera <
>> [email protected]> wrote:
>>
>>> Hi Udara,
>>>
>>> IMHO, since we are explicitly naming the URL objects when adding
>>> dependencies and properties (<app_id> <cluster_id> <property name>)
>>> it's better to use PUT operation instead of POST.
>>>
>>> PUT operation is idempotent while POST is not. So when creating named
>>> resources we should use PUT since repetitive requests will not have
>>> any effect.
>>>
>>> IMO, we should change our REST API to adhere to RESTful design.
>>>
>>
>> +1 to this
>>
>>>
>>> wdyt?
>>>
>>> Thanks.
>>>
>>> On Wed, Sep 17, 2014 at 5:04 PM, Udara Liyanage <[email protected]> wrote:
>>> >
>>> > Hi,
>>> >
>>> > Thanks for the suggestion. My basic idea was to get the ideas of the
>>> > workflow and requires REST API s.
>>> >
>>> > Touched, not typed. Erroneous words are a feature, not a typo.
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> Software Engineer, WSO2
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Shiroshica Kulatilake
>>
>> Architect,
>> WSO2, Inc. http://wso2.com/
>> Phone: +94 776523867
>>
>
>
>
> --
> Best Regards,
>
> Gayan Gunarathne
> Technical Lead
> WSO2 Inc. (http://wso2.com)
> email  : [email protected]  | mobile : +94 766819985
>
>



-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Reply via email to