<div dir="ltr">Thanks Juan,<div><br></div><div>Can I login into the ovirt-engine url using the encrypted password. If it is possible what are the encryption method that it allows.</div><div><br></div><div>Please share the code if you have it handy.</div><div><br></div><div>Thanks,</div><div>Chandrashekar</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 1:46 PM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 01/21/2015 02:27 PM, ChandraShekar Shastri wrote:<br>
> Hi All,<br>
><br>
> I want to get the details of the Host without activating is there a way<br>
> to do it.<br>
> I want to query the RHEV-Manager and would like to get the details of<br>
> MAC address without activating it.<br>
><br>
> Do you have the script to do this.<br>
><br>
> Thanks,<br>
> Chandrashekar<br>
><br>
<br>
</div></div>Assuming that the host has already been added to the system then you can<br>
get the details with a Python script like this:<br>
<br>
#!/usr/bin/python<br>
<br>
from ovirtsdk.api import API<br>
from ovirtsdk.xml import params<br>
<br>
api = API(<br>
url='<a href="https://ovirt.example.com/ovirt-engine/api" target="_blank">https://ovirt.example.com/ovirt-engine/api</a>',<br>
username='admin@internal',<br>
password='******',<br>
insecure=True<br>
)<br>
<br>
host = api.hosts.get(name="myhost")<br>
nics = host.nics.list()<br>
for nic in nics:<br>
print("%s: %s" % (nic.get_name(), nic.get_mac().get_address()))<br>
<br>
api.disconnect()<br>
<br>
This will print something like this:<br>
<br>
eth0: 52:54:00:9d:a7:26<br>
<br>
If the host hasn't been added you can add it, without activating it:<br>
<br>
#!/usr/bin/python<br>
<br>
from ovirtsdk.api import API<br>
from ovirtsdk.xml import params<br>
<br>
api = API(<br>
url='<a href="https://rhevm35.example.com/ovirt-engine/api" target="_blank">https://rhevm35.example.com/ovirt-engine/api</a>',<br>
username='admin@internal',<br>
password='******',<br>
insecure=True,<br>
)<br>
<br>
api.hosts.add(<br>
host = params.Host(<br>
name="myhost",<br>
address="<a href="http://myhost.example.com" target="_blank">myhost.example.com</a>",<br>
root_password="******"<br>
)<br>
)<br>
<br>
api.disconnect()<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta<br>
3ºD, 28016 Madrid, Spain<br>
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.<br>
</font></span></blockquote></div><br></div>