Class: OvirtSDK4::ExternalHostService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::ExternalHostService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (ExternalHost) get(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (ExternalHost) get(opts = {})
Returns the representation of the object managed by this service.
7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 |
# File 'lib/ovirtsdk4/services.rb', line 7122 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 ExternalHostReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
7146 7147 7148 7149 7150 7151 |
# File 'lib/ovirtsdk4/services.rb', line 7146 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.
7158 7159 7160 |
# File 'lib/ovirtsdk4/services.rb', line 7158 def to_s return "#<#{ExternalHostService}:#{@path}>" end |