Class: Fog::Compute::Hyperv::Servers

Inherits:
Hyperv::Collection show all
Defined in:
lib/fog/hyperv/models/compute/servers.rb

Instance Method Summary collapse

Methods inherited from Hyperv::Collection

#all, #create, get_method, #new, requires?

Instance Method Details

#get(identity, filters = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/fog/hyperv/models/compute/servers.rb', line 18

def get(identity, filters = {})
  guid = identity =~ /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/

  search = {}
  search[:id] = identity if guid
  search[:name] = identity unless guid

  super search.merge(filters)
end

#search_attributesObject



11
12
13
14
15
16
# File 'lib/fog/hyperv/models/compute/servers.rb', line 11

def search_attributes
  attrs = super
  attrs[:computer_name] = cluster.nodes.map { |n| n[:name] } if cluster
  attrs.delete :cluster
  attrs
end