Show Table of Contents
2.7. Example: Listing the ISO Files in an ISO Storage Domain
The
API class provides access to a storage domain collection, named storagedomains. This collection in turn contains a files collection that describes the files in a storage domain.
Example 2.6. Listing the ISO Files in an ISO Storage Domain
This Python example prints a list of the ISO files in each ISO storage domain in the Red Hat Virtualization environment:
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")
storage_domains = api.storagedomains.list()
for storage_domain in storage_domains:
if(storage_domain.get_type() == "iso"):
print(storage_domain.get_name() + ":\n")
files = storage_domain.files.list()
for file in files:
print(" %s" % file.get_name())
print()
api.disconnect()
except Exception as ex:
print "Unexpected error: %s" % ex

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.