Class: OvirtSDK4::ExternalProviderService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::ExternalProviderService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Direct Known Subclasses
ExternalHostProviderService, OpenstackImageProviderService, OpenstackNetworkProviderService, OpenstackVolumeProviderService
Instance Method Summary (collapse)
-
- (ExternalProviderCertificatesService) certificates_service
Locates the
certificates
service. -
- (Object) import_certificates(opts = {})
Executes the
import_certificates
method. -
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (Object) test_connectivity(opts = {})
Executes the
test_connectivity
method. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (ExternalProviderCertificatesService) certificates_service
Locates the certificates
service.
7589 7590 7591 |
# File 'lib/ovirtsdk4/services.rb', line 7589 def certificates_service return ExternalProviderCertificatesService.new(@connection, "#{@path}/certificates") end |
- (Object) import_certificates(opts = {})
Executes the import_certificates
method.
7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 |
# File 'lib/ovirtsdk4/services.rb', line 7542 def import_certificates(opts = {}) action = Action.new(opts) writer = XmlWriter.new(nil, true) ActionWriter.write_one(action, writer) body = writer.string writer.close request = Request.new({ :method => :POST, :path => "#{@path}/importcertificates", :body => body, }) response = @connection.send(request) case response.code when 200 action = check_action(response) else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 |
# File 'lib/ovirtsdk4/services.rb', line 7600 def service(path) if path.nil? || path == '' return self end if path == 'certificates' return certificates_service end if path.start_with?('certificates/') return certificates_service.service(path[13..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (Object) test_connectivity(opts = {})
Executes the test_connectivity
method.
7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 |
# File 'lib/ovirtsdk4/services.rb', line 7565 def test_connectivity(opts = {}) action = Action.new(opts) writer = XmlWriter.new(nil, true) ActionWriter.write_one(action, writer) body = writer.string writer.close request = Request.new({ :method => :POST, :path => "#{@path}/testconnectivity", :body => body, }) response = @connection.send(request) case response.code when 200 action = check_action(response) else check_fault(response) end end |
- (String) to_s
Returns an string representation of this service.
7618 7619 7620 |
# File 'lib/ovirtsdk4/services.rb', line 7618 def to_s return "#<#{ExternalProviderService}:#{@path}>" end |