<p dir="ltr"><br>
Il 29/Mar/2016 20:12, &quot;Nir Soffer&quot; &lt;<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>&gt; ha scritto:<br>
&gt;<br>
&gt; On Tue, Mar 29, 2016 at 9:09 PM, Sandro Bonazzola &lt;<a href="mailto:sbonazzo@redhat.com">sbonazzo@redhat.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Il 29/Mar/2016 20:02, &quot;Nir Soffer&quot; &lt;<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>&gt; ha scritto:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Hi all,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; In the Vdsm call, we discussed a way to expose vdsm errors to its clients<br>
&gt; &gt;&gt; (e.g, engine, hosted engine agent/setup).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; The idea is to have a vdsmapi package, holding:<br>
&gt; &gt;&gt; - errors.py - all public errors<br>
&gt; &gt;&gt; - events.py - all events sent by vdsm<br>
&gt; &gt;&gt; - client.py - library for communicating with vdsm<br>
&gt; &gt;&gt; - schema.py - the client will use this to autogenerate online help and<br>
&gt; &gt;&gt; validate messages<br>
&gt; &gt;&gt; - schema.yaml - we probably need several files (gluster, events, etc.)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; This will allow other projects talking with vdsm to do:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;     from vdsmapi import client, errors<br>
&gt; &gt;&gt;     ...<br>
&gt; &gt;&gt;     try:<br>
&gt; &gt;&gt;         client.list(vmId=&quot;xxxyyy&quot;)<br>
&gt; &gt;&gt;     except errors.NoSuchVM:<br>
&gt; &gt;&gt;         ...<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; (this is a fake example, the real api may be different)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Engine can build-require vdsmapi, and generate java module with the<br>
&gt; &gt;&gt; public errors from<br>
&gt; &gt;&gt; vdsmapi/errors.py module, instead of keeping this hardcoded in engine,<br>
&gt; &gt;&gt; and updating<br>
&gt; &gt;&gt; it every time vdsm adds new public error.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Vdsm will use this package when building response to clients.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Edi was concerned about sharing the errors module, so maybe we need a<br>
&gt; &gt;&gt; package:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; vdsmapi/<br>
&gt; &gt;&gt;     errors/<br>
&gt; &gt;&gt;         network.py<br>
&gt; &gt;&gt;         virt.py<br>
&gt; &gt;&gt;         storage.py<br>
&gt; &gt;&gt;         gluster.py<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; We can still expose all the errors via errors/__init__.py, so clients<br>
&gt; &gt;&gt; do not have to care about<br>
&gt; &gt;&gt; the area of the application the error come from.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thoughts?<br>
&gt; &gt;<br>
&gt; &gt; For which version is this proposal targeted? 4.1?<br>
&gt;<br>
&gt; This is not targeted to any version yet, but I would be happy if we can do this<br>
&gt; for next release.</p>
<p dir="ltr">I don&#39;t see it fitting 4.0 scope but I agree it would be nice to have in 4.1.</p>
<p dir="ltr">&gt;<br>
&gt; Nir<br>
</p>