Issue #1484 has been updated by Luke Kanies.

Assigned to changed from Luke Kanies to Sonny Cook

I agree it's a bit complicated.  We're working on unifying the resource types, 
but for now, the Puppet::Type class has all of the behaviour, but they're not 
modeled well for easy serialization.  Thus, we always want to pass 
Puppet::Resource instances around, but will usually convert them to 
Puppet::Type instances in the end.

You should consider this interface to be an API for the RAL, which means it 
interfaces with Puppet::Type, but it speaks Puppet::Resource.

So, for instance, if someone is doing Puppet::Resource.find, you'll need to 
come up with a URL key that will identify the resource (e.g., 
Puppet::Resource.find("/file/etc/passwd"), or 
Puppet::Resource.find("/user/foo")), and then create a 'ral' terminus type.

This terminus type will know how to query the state of resources (basically, 
when find or search is called, it will create appropriate Puppet::Type 
instances, query their state, and convert the results into Puppet::Resource 
instances) and modify them (by turning Puppet::Resource instances into 
Puppet::Type instances, sticking them in a catalog, and applying it).

You can also look at ralsh for more examples, including modern usage (which the 
current resource interface is not).

Is that sufficient?
----------------------------------------
Refactor #1484: The 'resource' handler needs to be refactored to use the 
Indirector and REST
http://projects.reductivelabs.com/issues/1484

Author: Luke Kanies
Status: Accepted
Priority: High
Assigned to: Sonny Cook
Category: plumbing
Target version: Rowlf
Affected version: 0.24.7
Branch: 


Currently, there's an xmlrpc Resource handler that can provide information on 
resources and modify them.

This class needs to be refactored entirely to use the Indirector instead of 
being tied to XMLRPC.  Most likely, the bits that talk to the RAL need to moved 
to a terminus type, and then we need a new Resource class that provides a 
simple model for resources.  Hopefully, this class can be a model for how to 
integrate all of the different Resource models we have.

Once the class exists, it needs to be able to use REST for communication.  
Backward compatibility isn't important here, because we'll just keep the xmlrpc 
handler around.  I think the only code that uses this class is the 'ralsh' 
executable.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to