[Pacemaker] Newcomer's question - API?

Tim Ward Tim.Ward at ipaccess.com
Wed Nov 2 05:22:38 EDT 2011

Thanks all for the help so far.

> One wonders why you want to write something from scratch in Java,

Well, we don't, of course. The ideal would be to use an existing,
documented, non-GPL, interface library. As we have not yet identified
any such thing we have been considering other options, one of which is
to reverse engineer the protocol and write something from scratch - this
is obviously possible, but also obviously tedious, and is thus a
back-stop fallback option, albeit not an attractive one, if we can't
find a better approach.

> So you may as well just invoke cibadmin, 
> crm_resource, crm_attribute directly.  I think it's safe to 
> assume those interfaces are stable.  At a higher level, "crm 
> configure ..." should also be considered pretty stable; we 
> know people use it in scripts so we try not to break it (and 
> BTW, I use all this stuff in Hawk[1]).

I appreciate that an option is to call the command line interface from
Java, but that gives the problem of parsing the textual output or
otherwise determining whether the command worked, and if not why not, so
as to be able to code useful error handling.

I have not yet found documentation of the output format or return codes
of these commands. So the worry is that if we write a parser to
interpret the output as observed by experiment (a) we'll miss some error
cases that we didn't manage to provoke during our experiments and (b)
the text output format from the commands might change in a new version.

Of course if a Java parser for the output already exists somewhere
(non-GPL) that could be extremely helpful.


So it looks like we currently have a choice of reverse engineering an
undocumented protocol and hoping it remains stable (or even in
existence!) over new versions, or reverse engineering some
human-readable text output from a human-targeted CLI and hoping that
remains stable over new versions, which is clearly not an ideal position
to be in.

We must have missed something ... ... ... ???

Tim Ward
Brett Ward Limited - www.brettward.co.uk  

This message contains confidential information and may be privileged. If you are not the intended recipient, please notify the sender and delete the message immediately.

ip.access Ltd, registration number 3400157, Building 2020, 
Cambourne Business Park, Cambourne, Cambridge CB23 6DW, United Kingdom

More information about the Pacemaker mailing list