[katello-devel] ActiveResource as an alternative to custom RestClient-based Foreman api client

Bryan Kearney bkearney at redhat.com
Tue Sep 18 13:15:04 UTC 2012


On 09/17/2012 02:04 PM, Dmitri Dolguikh wrote:
> Hey everybody,
>
> I finished the spike on using ActiveResource as a replacement for
> RestClient, only for communication with Foreman, and only to orchestrate
> user creation/deletion in Foreman. See the results at [1].
>
> Some post-spike thoughts/observations:
>   - I monkey-patched ActiveResource to support OAuth, but the same can
> be achieved by subclassing ActiveResource::Base, which is the way to go.
>   - The amount of custom-code is *very* minimal and it's mostly to
> support OAuth.
>   - Not a fan of custom to_json, we could either use resource's schema
> (there are some drawbacks), or try using rabl [2] (like foreman folks do)
>   - Should we decide to adopt this, we can eventually move both
> candlepin and pulp to use ActiveResource. I think it will be possible to
> drop our lazy_attributes in the process with some work, if we adopt
> rails caching.
>
>
> Comments, concerns?
> -d
>
>
> [1] https://github.com/witlessbird/katello/tree/foreman-ar-spike
> [2] https://github.com/nesquena/rabl
>
>
Thanks for setting up the mtg tomrrow to discuss. Lets plan to walk out 
of that with a plan of how to finialize this, so we can merge the 
foreman architectures branch into master.

-- bk





More information about the katello-devel mailing list