Class: OvirtSDK4::ClusterLevelService

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

Instance Method Summary (collapse)

Instance Method Details

- (ClusterLevel) get(opts = {})

Provides the information about the capabilities of the specific cluster level managed by this service.

Parameters:

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

    Additional options.

Returns:



4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
# File 'lib/ovirtsdk4/services.rb', line 4266

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 ClusterLevelReader.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)


4290
4291
4292
4293
4294
4295
# File 'lib/ovirtsdk4/services.rb', line 4290

def service(path)
  if path.nil? || path == ''
    return self
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


4302
4303
4304
# File 'lib/ovirtsdk4/services.rb', line 4302

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