<div dir="ltr">Hello there,<div><br></div><div>I am trying to add a VmPool to oVirt using the python ovirtSDK4 with following lines:</div><div><br></div><div>I am omitting the import packages lines and connection lines.</div><div><br></div><div><br></div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">system_service = connection.system_service()
</span><br>
<br><span style="color:rgb(0,0,0)">vm_pools_service = system_service.vm_pools_service()
</span><br>
<br><span style="color:rgb(0,0,0)">templates_service = system_service.templates_service()
</span><br>
<br><span style="color:rgb(0,0,0)">clusters_service = system_service.clusters_service()
</span><br>
<br><span style="color:rgb(0,0,0)">tplist = templates_service.list(search=</span><span style="color:rgb(175,95,0)">'name=prueba'</span><span style="color:rgb(0,0,0)">)
</span><br>
<br><span style="color:rgb(0,0,0)">tpl=</span><span style="color:rgb(0,135,0)">None</span><span style="color:rgb(0,0,0)">
</span><br><span style="color:rgb(0,0,0)">biggest=-</span><span style="color:rgb(0,135,0)">1</span><span style="color:rgb(0,0,0)">
</span><br><span style="font-weight:bold;color:rgb(0,135,0)">for</span><span style="color:rgb(0,0,0)"> t </span><span style="font-weight:bold;color:rgb(175,0,255)">in</span><span style="color:rgb(0,0,0)"> tplist:
</span><br><span style="color:rgb(0,0,0)"> ver = t.version
</span><br><span style="color:rgb(0,135,0)"> </span><span style="font-weight:bold;color:rgb(0,135,0)">if</span><span style="color:rgb(0,0,0)"> ver.version_number > biggest:
</span><br><font color="#008700"> </font><span style="color:rgb(0,0,0)">biggest = ver.version_number
</span><br><font color="#008700"> </font><span style="color:rgb(0,0,0)">tid = <a href="http://t.id">t.id</a>
</span><br><font color="#008700"> </font><span style="color:rgb(0,0,0)">tpl = t</span><span style="color:rgb(0,135,0)"> </span><span style="color:rgb(0,0,0)"> </span><br>
<br><span style="color:rgb(0,0,0)">c = </span><span style="color:rgb(0,135,0)">None</span><span style="color:rgb(0,0,0)">
</span><br><span style="font-weight:bold;color:rgb(0,135,0)">for</span><span style="color:rgb(0,0,0)"> cluster </span><span style="font-weight:bold;color:rgb(175,0,255)">in</span><span style="color:rgb(0,0,0)"> clusters_service.list():
</span><br><span style="color:rgb(0,135,0)"> </span><span style="font-weight:bold;color:rgb(0,135,0)">if</span><span style="color:rgb(0,0,0)"> <a href="http://cluster.name">cluster.name</a> == </span><span style="color:rgb(175,95,0)">'Pruebacluster'</span><span style="color:rgb(0,0,0)">:
</span><br><font color="#008700"> </font><span style="color:rgb(0,0,0)">c = cluster
</span><br><br><span style="color:rgb(0,0,0)">pool = ovirtsdk4.types.VmPool(name=</span><span style="color:rgb(175,95,0)">'PRUEBA'</span><span style="color:rgb(0,0,0)">,size=</span><span style="color:rgb(0,135,0)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,135,0)">type</span><span style="color:rgb(0,0,0)">=ovirtsdk4.types.VmPoolType(</span><span style="color:rgb(175,95,0)">'manual'</span><span style="color:rgb(0,0,0)">),template=tpl,cluster=c) </span></span></div><div><span style="font-family:monospace">vm_pools_service.add(pool=pool)</span><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><br></span></div><div><br></div><div><br></div><div><span style="font-family:monospace">I am getting the following error:</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)"> Fault reason is "Request syntactically incorrect.". Fault detail is "For correct usage, see: <a href="https://ovirt.example.com/ovirt-engine/api/">https://ovirt.example.com/ovirt-engine/api/</a></span>v4/model#services/vm-pools/methods/add". HTTP response code is 400.<br></span></div><div><br></div><div><font face="monospace">I am a newbie in using this version of the API, suppose this is quite easy problem.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">Thanks for all the answers to come,</font></div><div>Manuel</div></div>