On 20/10/11 3:02 AM, Russell Bryant wrote:
On 10/19/2011 08:30 AM, Radek Novacek wrote:
> The following patch introduces systemd support for Resources API in
> services agent. To be honest, I'm not quite satisfied with the
> resources interface. I think we should define the difference between
> services and resources API more clearly.
I already had, hence the comments above each class in the schema.
The services API is just a dumbed down version of the resources API for
/people/ and only deals with system services.
The resources API is for /applications/ that know what they're doing.
>
> As far as I understand it, services API should provide basic access to
> system services using preferred way on given system (upstart for
> Fedora< 15, systemd for Fedora>= 15, sysvinit, windows services,
> etc.). Current list of methods seems OK.
>
> But I'm not sure about resources API. What is the purpose for having
> it this way? It partially overlaps with services API, but doesn't
> provide some functions like 'status'.
As Russell said, status() is just invoke() with action="status"
It should have at least defined
> concepts like standard/provider/agent somewhere. The
requirements
> comes from other project (pacemaker?), right? Do we have it written
> down somewhere? IMHO we should rethink the concept now, before it will
> be too late. Or at least document it better, because now it's not
> clear how to use it.
Andrew may be able to better address your concerns, since he wrote it.
status is supported, through the invoke method and setting the action to
"status". The invoke method of the Resources API is kind of a catch-all
to perform any action. I'm not sure why it was built as a catch-all like
this. Maybe the list of possible actions is undefined for OCF resource
agents?
Well its a long-ish list, we add more on occasion and really matahari
doesn't need to care.
There is there really very little value in
define $action(args) { invoke("$action", ...); }
for every possible value of $action.
To be honest, the API is exactly what we want in clustering.
It is the evolution of what we had in the lrmd.
Some additional documentation that explains the Resources API would
probably help out the situation.