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

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

Instance Attribute Summary

Attributes inherited from Hyperv::ComputerCollection

#cluster, #computer

Instance Method Summary collapse

Methods inherited from Hyperv::ComputerCollection

#new, requires_computer

Methods inherited from Hyperv::Collection

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

Instance Method Details

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



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

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