Re: [ovirt-users] Details of the host

2015-01-26 Thread Juan Hernández
On 01/24/2015 03:31 PM, ChandraShekar Shastri wrote:
> Thanks Juan,
> 
> Can I login into the ovirt-engine url using the encrypted password. If
> it is possible what are the encryption method that it allows.
> 
> Please share the code if you have it handy.
> 
> Thanks,
> Chandrashekar
> 

The Python SDK only supports "Basic" authentication. Version 3.6 will
also support Kerberos authentication. There are no plans at the moment
to support any other authentication mechanism in the Python SDK.

> On Fri, Jan 23, 2015 at 1:46 PM, Juan Hernández  > wrote:
> 
> On 01/21/2015 02:27 PM, ChandraShekar Shastri wrote:
> > Hi All,
> >
> > I want to get the details of the Host without activating is there
> a way
> > to do it.
> > I want to query the RHEV-Manager and would like to get the details of
> > MAC address without activating it.
> >
> > Do you have the script to do this.
> >
> > Thanks,
> > Chandrashekar
> >
> 
> Assuming that the host has already been added to the system then you can
> get the details with a Python script like this:
> 
> #!/usr/bin/python
> 
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
> 
> api = API(
>   url='https://ovirt.example.com/ovirt-engine/api',
>   username='admin@internal',
>   password='**',
>   insecure=True
> )
> 
> host = api.hosts.get(name="myhost")
> nics = host.nics.list()
> for nic in nics:
> print("%s: %s" % (nic.get_name(), nic.get_mac().get_address()))
> 
> api.disconnect()
> 
> This will print something like this:
> 
> eth0: 52:54:00:9d:a7:26
> 
> If the host hasn't been added you can add it, without activating it:
> 
> #!/usr/bin/python
> 
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
> 
> api = API(
>   url='https://rhevm35.example.com/ovirt-engine/api',
>   username='admin@internal',
>   password='**',
>   insecure=True,
> )
> 
> api.hosts.add(
>   host = params.Host(
> name="myhost",
> address="myhost.example.com ",
> root_password="**"
>   )
> )
> 
> api.disconnect()
> 
> --
> Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
> 3ºD, 28016 Madrid, Spain
> Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat
> S.L.
> 
> 
> 
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Details of the host

2015-01-24 Thread ChandraShekar Shastri
Thanks Juan,

Can I login into the ovirt-engine url using the encrypted password. If it
is possible what are the encryption method that it allows.

Please share the code if you have it handy.

Thanks,
Chandrashekar

On Fri, Jan 23, 2015 at 1:46 PM, Juan Hernández  wrote:

> On 01/21/2015 02:27 PM, ChandraShekar Shastri wrote:
> > Hi All,
> >
> > I want to get the details of the Host without activating is there a way
> > to do it.
> > I want to query the RHEV-Manager and would like to get the details of
> > MAC address without activating it.
> >
> > Do you have the script to do this.
> >
> > Thanks,
> > Chandrashekar
> >
>
> Assuming that the host has already been added to the system then you can
> get the details with a Python script like this:
>
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> api = API(
>   url='https://ovirt.example.com/ovirt-engine/api',
>   username='admin@internal',
>   password='**',
>   insecure=True
> )
>
> host = api.hosts.get(name="myhost")
> nics = host.nics.list()
> for nic in nics:
> print("%s: %s" % (nic.get_name(), nic.get_mac().get_address()))
>
> api.disconnect()
>
> This will print something like this:
>
> eth0: 52:54:00:9d:a7:26
>
> If the host hasn't been added you can add it, without activating it:
>
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> api = API(
>   url='https://rhevm35.example.com/ovirt-engine/api',
>   username='admin@internal',
>   password='**',
>   insecure=True,
> )
>
> api.hosts.add(
>   host = params.Host(
> name="myhost",
> address="myhost.example.com",
> root_password="**"
>   )
> )
>
> api.disconnect()
>
> --
> Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
> 3ºD, 28016 Madrid, Spain
> Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Details of the host

2015-01-23 Thread Sven Kieske
On 22/01/15 19:31, Donny Davis wrote:
> But if you just need the mac address, why not ssh into it and get it from ip 
> addr

if you can ssh, there is no need to parse "ip" output, just do cat:
cat /sys/class/net/$yourdevice/address

I don't think there is a way to get data from a host via api which is
not activated, but I might be wrong.


-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Details of the host

2015-01-23 Thread Juan Hernández
On 01/21/2015 02:27 PM, ChandraShekar Shastri wrote:
> Hi All,
> 
> I want to get the details of the Host without activating is there a way
> to do it. 
> I want to query the RHEV-Manager and would like to get the details of
> MAC address without activating it. 
> 
> Do you have the script to do this.
> 
> Thanks,
> Chandrashekar 
> 

Assuming that the host has already been added to the system then you can
get the details with a Python script like this:

#!/usr/bin/python

from ovirtsdk.api import API
from ovirtsdk.xml import params

api = API(
  url='https://ovirt.example.com/ovirt-engine/api',
  username='admin@internal',
  password='**',
  insecure=True
)

host = api.hosts.get(name="myhost")
nics = host.nics.list()
for nic in nics:
print("%s: %s" % (nic.get_name(), nic.get_mac().get_address()))

api.disconnect()

This will print something like this:

eth0: 52:54:00:9d:a7:26

If the host hasn't been added you can add it, without activating it:

#!/usr/bin/python

from ovirtsdk.api import API
from ovirtsdk.xml import params

api = API(
  url='https://rhevm35.example.com/ovirt-engine/api',
  username='admin@internal',
  password='**',
  insecure=True,
)

api.hosts.add(
  host = params.Host(
name="myhost",
address="myhost.example.com",
root_password="**"
  )
)

api.disconnect()

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Details of the host

2015-01-22 Thread ChandraShekar Shastri
Hi Donny,

We don't have the libraries like expect or pexpect or sshpass or any other
supported, to automate the process or logging into the machine and get the
details of it.

So, I just of thought of connecting RHEV-Manager using the REST API and get
the details of it.

Any suggestions would be really helpful.

Thanks,
Chandrashekar

On Fri, Jan 23, 2015 at 12:01 AM, Donny Davis  wrote:

> When you add a host you will be able to see the details, and then you can
> place the host in maintenance mode to ensure no VM’s are brought up on it.
>
>
>
> But if you just need the mac address, why not ssh into it and get it from
> ip addr
>
>
>
>
>
> Donny D
>
>
>
> *From:* users-boun...@ovirt.org [mailto:users-boun...@ovirt.org] *On
> Behalf Of *ChandraShekar Shastri
> *Sent:* Wednesday, January 21, 2015 6:28 AM
> *To:* users@ovirt.org
> *Subject:* [ovirt-users] Details of the host
>
>
>
> Hi All,
>
>
>
> I want to get the details of the Host without activating is there a way to
> do it.
>
> I want to query the RHEV-Manager and would like to get the details of MAC
> address without activating it.
>
>
>
> Do you have the script to do this.
>
>
>
> Thanks,
>
> Chandrashekar
>
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] Details of the host

2015-01-22 Thread Donny Davis
When you add a host you will be able to see the details, and then you can place 
the host in maintenance mode to ensure no VM’s are brought up on it.

 

But if you just need the mac address, why not ssh into it and get it from ip 
addr

 

 

Donny D

 

From: users-boun...@ovirt.org [mailto:users-boun...@ovirt.org] On Behalf Of 
ChandraShekar Shastri
Sent: Wednesday, January 21, 2015 6:28 AM
To: users@ovirt.org
Subject: [ovirt-users] Details of the host

 

Hi All,

 

I want to get the details of the Host without activating is there a way to do 
it. 

I want to query the RHEV-Manager and would like to get the details of MAC 
address without activating it. 

 

Do you have the script to do this.

 

Thanks,

Chandrashekar 

 

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users