Sha256: d44a5e3b25041d2d02d27069b692eceae50e41c0c01f609169ebd90c1e9cf8ed
Contents?: true
Size: 777 Bytes
Versions: 29
Compression:
Stored size: 777 Bytes
Contents
module Fog module Compute class Vsphere class Real def list_hosts(filters = {}) cluster = get_raw_cluster(filters[:cluster], filters[:datacenter]) cluster.host.map {|host| host_attributes(host, filters)} end protected def host_attributes(host, filters) { datacenter: filters[:datacenter], cluster: filters[:cluster], name: host[:name], vm_ids: host[:vm].map {|vm| vm.config.instanceUuid } } end end class Mock def list_hosts(filters = {}) self.data[:hosts].values.select {|r| r[:datacenter] == filters[:datacenter] && r[:cluster] == filters[:cluster]} end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems