Class: Fog::Hyperv::Compute::NetworkAdapters

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

Instance Method Summary collapse

Methods inherited from Fog::Hyperv::Collection

#all, get_method, #initialize, #new, requires, requires?

Constructor Details

This class inherits a constructor from Fog::Hyperv::Collection

Instance Method Details

#get(identifier, **filters) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fog/hyperv/compute/models/network_adapters.rb', line 12

def get(identifier, **filters)
  id = identifier if identifier =~ /\Amicrosoft:#{Fog::Hyperv::GUID}\\#{Fog::Hyperv::GUID}\z/i
  name = identifier unless id

  id = nil if id&.empty?
  name = nil if name&.empty?

  raise ArgumentError, 'Must provide a name or combined GUID' if id.nil? && name.nil?

  super(name:, _by_id: id, **filters)
end