3.4. 列出逻辑网络
此 Ruby 示例列出了逻辑网络。
# Get the reference to the root of the services tree:
system_service = connection.system_service
# Get the reference to the service that manages the
# collection of networks:
nws_service = system_service.networks_service
# Retrieve the list of clusters and for each one
# print its name:
nws = nws_service.list
nws.each do |nw|
puts nw.name
end
在只有一个默认管理网络的环境中,示例输出:
ovirtmgmt
如需更多信息,请参阅 http://www.rubydoc.info/gems/ovirt-engine-sdk/OvirtSDK4/NetworksService:list。