from ovirtsdk.api import API
from ovirtsdk.xml import params
try:
api = API(url="https://HOST",
username="USER@DOMAIN",
password="PASS",
ca_file="ca.crt")
n_list = api.networks.list()
for n in n_list:
print "%s (%s)" % (n.get_name(), n.get_id())
api.disconnect()
except Exception as ex:
print "Unexpected error: %s" % ex
from ovirtsdk.api import API
from ovirtsdk.xml import params
try:
api = API(url="https://HOST",
username="USER@DOMAIN",
password="PASS",
ca_file="ca.crt")
n_list = api.networks.list()
for n in n_list:
print "%s (%s)" % (n.get_name(), n.get_id())
api.disconnect()
except Exception as ex:
print "Unexpected error: %s" % ex
Copy to ClipboardCopied!Toggle word wrapToggle overflow
在只存在默认管理网络的环境中,示例输出:
ovirtmgmt (00000000-0000-0000-0000-000000000009)
ovirtmgmt (00000000-0000-0000-0000-000000000009)
Copy to ClipboardCopied!Toggle word wrapToggle overflow