[katello-devel] Merged sync status cli/api

Bryan Kearney bkearney at redhat.com
Mon Aug 29 15:16:22 UTC 2011


On 08/29/2011 11:11 AM, Jason L Connor wrote:
> On Mon, 2011-08-29 at 08:50 -0400, Bryan Kearney wrote:
>> On 08/29/2011 04:00 AM, Tomas Strachota wrote:
>>> On 29/08/11 09:07, Dmitri Dolguikh wrote:
>>>> Hey Tomas,
>>>>
>>>> I think it would be a bit more restful if resource url mirrored the
>>>> model for synchronization: We have a sync resource, which supports
>>>> various types of sub-resources. I think a better way to show that would
>>>> be: /sync/{repositories, products, providers}.
>>>>
>>>> What do you think?
>>>> -d
>>>>
>>>
>>> I was inspired by pulp's routes and thought of it as of action for the
>>> repo/product/provider resources. I have no strong opinion about that. I
>>> like the idea that you start new synchronization eg by route:
>>>
>>> POST /repositories/ID/sync/
>>>
>>> rather than
>>>
>>> POST /sync/repositories/ID/
>>>
>>> We have ids only for repo synces. Product and provider synces are
>>> handled as list of it's repo synchronizations. We can't have any route
>>> like /sync/ID/... and therefore I chose the other way.
>>>
>>> But I'm a rest newbie so if it breaks any of the rest-best-practices
>>> rules, I have nothing against changing it;)
>>>
>>> T.
>>
>>
>> I think best practice is to try and avoid action resources, and go with
>> the making true resources like sync. However.. at some point.. it does
>> seem to break down.
>>
>> - bk
>
> REST is kinda murky on actions. It seems to follow the pattern
> of /<collection>/<individual resource>/. I'm more or less the one the
> extended this idea in Pulp to:
> /<collection>/<individual resource>/<action on that resource>/
>
> I like the /repositories/<id>/sync/ better then /sync/<repository>/
> because I can't think of the action 'sync' as a collection of resources.
>
>
<ACADEMIA>

I think the goal is if an action results in a "thing" then you should 
try and model the thing as a resource. So... you dont do /person/marry 
you do /marriage

</ACADEMIA>

Having said that, sync is a tough one as the result of a "synced" is 
kinda odd :)
-
- bk




More information about the katello-devel mailing list