Class: OvirtSDK4::ExternalProviderCertificatesService

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

Instance Method Summary (collapse)

Instance Method Details

- (ExternalProviderCertificateService) certificate_service(id)

Locates the certificate service.

Parameters:

  • id (String)

    The identifier of the certificate.

Returns:



7743
7744
7745
# File 'lib/ovirtsdk4/services.rb', line 7743

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

- (Array<Certificate>) 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 certificates to return. If not specified all the certificates are returned.

Returns:



7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
# File 'lib/ovirtsdk4/services.rb', line 7714

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 CertificateReader.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.



7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
# File 'lib/ovirtsdk4/services.rb', line 7754

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

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


7770
7771
7772
# File 'lib/ovirtsdk4/services.rb', line 7770

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