Skip to content

Instantly share code, notes, and snippets.

@apahim
Created June 27, 2014 13:13
Show Gist options
  • Save apahim/779578fd3c6c190c65fc to your computer and use it in GitHub Desktop.
Save apahim/779578fd3c6c190c65fc to your computer and use it in GitHub Desktop.
from ovirtsdk.xml import params
from ovirtsdk.api import API
ENGINE_SERVER = "https://rhevm34.pahim.org"
ENGINE_USER = "admin@internal"
ENGINE_PASS = "admin"
ENGINE_CERT = "/etc/pki/ovirt-engine/ca.pem"
def Connect(url,username,password,ca_file):
global api
api = API(url = url,
username = username,
password = password,
ca_file = ca_file)
def Disconnect():
api.disconnect()
Connect(ENGINE_SERVER, ENGINE_USER, ENGINE_PASS, ENGINE_CERT)
for host in api.hosts.list():
print host.name
Disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment