<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 2, 2022 at 7:06 PM 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 Wed, 2022-02-02 at 18:46 +0100, Lentes, Bernd wrote:<br>
> Hi,<br>
> <br>
> i need to write some scripts for our cluster. Until now i wrote bash<br>
> scripts.<br>
> But i like to learn python. Is there a package for pacemaker ?<br>
> What i found is: <a href="https://pypi.org/project/pacemaker/" rel="noreferrer" target="_blank">https://pypi.org/project/pacemaker/</a> and i'm not sure<br>
> what that is.<br>
> <br>
> Thanks.<br>
> <br>
> Bernd<br>
<br>
Not currently (that's an unrelated project I wasn't aware of). It is a<br>
goal to make one, but time hasn't been available.<br>
<br>
We're taking a big step towards it by creating a high-level C API for<br>
Pacemaker that's essentially equivalent to how the command-line tools<br>
work. It will be much easier to wrap this API in Python. There are<br>
already high-level API equivalents of crmadmin and crm_simulate, and<br>
the crm_mon equivalent is expected in the next release.<br>
<br>
In the meantime, the easiest approach is probably just to use the<br>
subprocess module to execute the Pacemaker command-line tools to do<br>
what you want.<br></blockquote><div>You might as well use pcs, crmsh or cts as a source of</div><div>inspiration as they are all 3 written in python.</div><div>AFAIK none of those offers a (stable) python API (yet) though.</div><div><br></div><div>Klaus</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Ken Gaillot <<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>><br>
<br>
_______________________________________________<br>
Manage your subscription:<br>
<a href="https://lists.clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.clusterlabs.org/mailman/listinfo/users</a><br>
<br>
ClusterLabs home: <a href="https://www.clusterlabs.org/" rel="noreferrer" target="_blank">https://www.clusterlabs.org/</a><br>
<br>
</blockquote></div></div>