Class: OvirtSDK4::EngineKatelloErrataService

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

Instance Method Summary (collapse)

Instance Method Details

- (KatelloErratumService) katello_erratum_service(id)

Locates the katello_erratum service.

Parameters:

  • id (String)

    The identifier of the katello_erratum.

Returns:



27664
27665
27666
# File 'lib/ovirtsdk4/services.rb', line 27664

def katello_erratum_service(id)
  return KatelloErratumService.new(@connection, "#{@path}/#{id}")
end

- (Array<KatelloErratum>) list(opts = {})

Returns the representation of the object managed by this service.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :max (Integer)

    Sets the maximum number of errata to return. If not specified all the errata are returned.

Returns:



27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
# File 'lib/ovirtsdk4/services.rb', line 27635

def list(opts = {})
  query = {}
  value = opts[:max]
  unless value.nil?
    value = Writer.render_integer(value)
    query['max'] = value
  end
  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 KatelloErratumReader.read_many(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.



27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
# File 'lib/ovirtsdk4/services.rb', line 27675

def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return katello_erratum_service(path)
  end
  return katello_erratum_service(path[0..(index - 1)]).service(path[(index +1)..-1])
end

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


27691
27692
27693
# File 'lib/ovirtsdk4/services.rb', line 27691

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