Class: Fog::Hyperv::Compute::Vhds

Inherits:
Fog::Hyperv::Collection show all
Defined in:
lib/fog/hyperv/compute/models/vhds.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)


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

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

  raise ArgumentError, 'Must provide a path or GUID' if (id.nil? || id.empty?) && (path.nil? || path.empty?)

  super(disk_identifier: id, path:, **filters)
end