Ce contenu n'est pas disponible dans la langue sélectionnée.
3.6. Listing ISO Files in the ISO Storage Domain
This Ruby example lists the ISO files in the ISO storage domain, myiso.
Get the reference to the root of the services tree:
Find the service that manages the collection of storage domains:
Find the ISO storage domain:
Find the service that manages the ISO storage domain:
Find the service that manages the collection of files available in the storage domain:
List the names of the files. Note that the name of the .iso file is contained
in the id attribute.
# Get the reference to the root of the services tree:
system_service = connection.system_service
# Find the service that manages the collection of storage domains:
sds_service = system_service.storage_domains_service
# Find the ISO storage domain:
sd = sds_service.list(search: 'name=myiso').first
# Find the service that manages the ISO storage domain:
sd_service = sds_service.storage_domain_service(sd.id)
# Find the service that manages the collection of files available in the storage domain:
files_service = sd_service.files_service
# List the names of the files. Note that the name of the .iso file is contained
# in the id attribute.
files = files_service.list
files.each do |file|
puts file.id
end
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.
Rendre l’open source plus inclusif
Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.
À propos de Red Hat
Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.