Class: OvirtSDK4::MeasurableService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Direct Known Subclasses

DiskService, GlusterBrickService, GlusterVolumeService, HostNicService, HostNumaNodeService, HostService, StepService, VmDiskService, VmNicService, VmService

Instance Method Summary (collapse)

Instance Method Details

- (Service) service(path)

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:

  • (Error)


12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
# File 'lib/ovirtsdk4/services.rb', line 12239

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

- (StatisticsService) statistics_service

Locates the statistics service.

Returns:



12228
12229
12230
# File 'lib/ovirtsdk4/services.rb', line 12228

def statistics_service
  return StatisticsService.new(@connection, "#{@path}/statistics")
end

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


12257
12258
12259
# File 'lib/ovirtsdk4/services.rb', line 12257

def to_s
  return "#<#{MeasurableService}:#{@path}>"
end