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

Dmitri Dolguikh dmitri at redhat.com
Mon Sep 17 18:04:26 UTC 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/katello-devel/attachments/20120917/68a02c71/attachment.htm>


More information about the katello-devel mailing list