[ClusterLabs] Antw: Coming in pacemaker 2.0.2: XML output from tools

Christopher Lumens clumens at redhat.com
Thu Apr 18 11:07:39 EDT 2019


> As XML is only as good as ist structure, would you present the structure of
> such XML output?

If you enjoy reading XML that describes XML, you can check out the schema here:

https://github.com/ClusterLabs/pacemaker/blob/master/xml/api/stonith_admin-1.0.rng

Also note command-output-1.0.rng in the same directory.

However, I'll understand if you find that a little hard to follow.  I didn't really
enjoy writing it either.  Here's a couple examples of the XML output.  You can see
the command lines used to generate them in the request= attribute up top.  I've
also condensed the output a little bit to make it take up less space in an email.
What you see on the screen will have more spaces and newlines.  Note that this is
not the complete set of outputs from stonith_admin.

<pacemaker-result api-version="0.1" request="stonith_admin -I --output-as xml">
  <list name="Installed fence devices" count="4">
    <item name="device">fence_legacy</item>
    <item name="device">fence_virt</item>
    <item name="device">fence_virtd</item>
    <item name="device">fence_xvm</item>
  </list>
  <status code="0">OK</status>
</pacemaker-result>

<pacemaker-result api-version="0.1" request="stonith_admin -h test03 --output-as xml">
  <last-fenced target="test03" when="Fri Apr 12 14:11:11 2019"/>
  <status code="0">OK</status>
</pacemaker-result>

<pacemaker-result api-version="0.1" request="stonith_admin -l test03 --output-as xml">
  <list name="Registered fence devices" count="1">
    <item name="device">cluster-fencing</item>
  </list>
  <status code="0">OK</status>
</pacemaker-result>

<pacemaker-result api-version="0.1" request="stonith_admin -H * --output-as xml">
  <list name="Fencing history" count="1">
    <stonith-event status="done" delegate="test02" action="turning off" target="test03" client="stonith_admin.9056" origin="test01" when="Fri Apr 12 14:09:12 2019\n"/>                     
  </list>
  <status code="0">OK</status>
</pacemaker-result>

> Will textual status messages be replaced with status codes then? I feel that
> is important to process outpout independent of any localization.

I have no plans to completely replace status messages with status codes.
However, stonith_admin at least should currently be doing a pretty good
job of returning status codes for most every problem.  There's a pretty
good set defined already:

https://github.com/ClusterLabs/pacemaker/blob/master/include/crm/common/results.h#L83

We can always add more if necessary.

- Chris


More information about the Users mailing list