<div dir="ltr"><div><br></div>Hi Ken<div><br></div><div>Thanks for your response and pointers !  <div><br></div><div>What you suggest is certainly one option.  <div><div><div><br></div><div>If there are any examples of using the C API's please point me to the same. 'am trying to search for them too.<br><div><br></div><div>Thanks!</div><div>Vinod  </div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 4, 2019 at 8:57 AM Ken Gaillot <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, 2019-02-03 at 08:44 -0800, Vinod Chegu wrote:<br>
> Hello,<br>
> <br>
> 'am new to this forum and am looking for some pointers. <br>
> <br>
> Are there any Python based examples (in some github repo etc) that<br>
> show the usage of Pacemaker/Corosync APIs for creation and management<br>
> (add/delete/list/[un]maintenance, monitor alerts) of cluster of Linux<br>
> nodes?<br>
> <br>
> Thanks !<br>
> VC<br>
<br>
Hi Vinod,<br>
<br>
There is currently no Python API, though that is on the long-term wish<br>
list.<br>
<br>
Corosync and Pacemaker each have C APIs, but those are likely much<br>
lower level than you're interested in. For cluster creation etc., the<br>
command-line tools are the primary way to interact with the cluster, so<br>
using those with subprocess.call() would be one way to go.<br>
<br>
The higher-level tools crm shell and pcs provide an easier interface to<br>
both corosync and pacemaker, so you may want to pick one of them<br>
instead, at the cost of creating an additional dependency for your<br>
tool.<br>
<br>
For alerts, you can have pacemaker call a Python script with<br>
interesting info passed as environment variables. See:<br>
<br>
<a href="http://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#idm140330787858944" rel="noreferrer" target="_blank">http://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#idm140330787858944</a><br>
-- <br>
Ken Gaillot <<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>><br>
<br>
_______________________________________________<br>
Developers mailing list<br>
<a href="mailto:Developers@clusterlabs.org" target="_blank">Developers@clusterlabs.org</a><br>
<a href="https://lists.clusterlabs.org/mailman/listinfo/developers" rel="noreferrer" target="_blank">https://lists.clusterlabs.org/mailman/listinfo/developers</a><br>
</blockquote></div>