Method: OvirtSDK4::StorageDomainTemplateService#service

Defined in:
lib/ovirtsdk4/services.rb

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
# File 'lib/ovirtsdk4/services.rb', line 23420

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'disks'
    return disks_service
  end
  if path.start_with?('disks/')
    return disks_service.service(path[6..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end