3.6. ISO 스토리지 도메인에 ISO 파일 나열
이 Ruby 예제에서는 ISO 스토리지 도메인인 myiso 에 있는 ISO 파일을 나열합니다.
# 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
자세한 내용은 FilesService:list 를 참조하십시오.
ISO 스토리지 도메인의 이름을 모르는 경우 이 Ruby 예제에서는 모든 ISO 스토리지 도메인을 검색합니다.
# Find the ISO storage domain:
iso_sds = sds_service.list.select { |sd| sd.type == OvirtSDK4::StorageDomainType::ISO }
자세한 내용은 StorageDomainsService:list 를 참조하십시오.