Class: OvirtSDK4::KatelloErrataService

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

Direct Known Subclasses

EngineKatelloErrataService

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:



11874
11875
11876
# File 'lib/ovirtsdk4/services.rb', line 11874

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:



11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
# File 'lib/ovirtsdk4/services.rb', line 11845

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.



11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
# File 'lib/ovirtsdk4/services.rb', line 11885

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)


11901
11902
11903
# File 'lib/ovirtsdk4/services.rb', line 11901

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