Class: OvirtSDK4::HostNumaNodeService

Inherits:
MeasurableService show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary (collapse)

Instance Method Details

- (NumaNode) get(opts = {})

Returns the representation of the object managed by this service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Returns:



29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
# File 'lib/ovirtsdk4/services.rb', line 29360

def get(opts = {})
  query = {}
  request = Request.new(:method => :GET, :path => @path, :query => query)
  response = @connection.send(request)
  case response.code
  when 200
    begin
      reader = XmlReader.new(response.body)
      return NumaNodeReader.read_one(reader)
    ensure
      reader.close
    end
  else
    check_fault(response)
  end
end

- (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)


29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
# File 'lib/ovirtsdk4/services.rb', line 29392

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:



29381
29382
29383
# File 'lib/ovirtsdk4/services.rb', line 29381

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

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


29410
29411
29412
# File 'lib/ovirtsdk4/services.rb', line 29410

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