Class: OvirtSDK4::HostDeviceService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::HostDeviceService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (HostDevice) 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
- (HostDevice) get(opts = {})
Returns the representation of the object managed by this service.
9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 |
# File 'lib/ovirtsdk4/services.rb', line 9501 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 HostDeviceReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
9525 9526 9527 9528 9529 9530 |
# File 'lib/ovirtsdk4/services.rb', line 9525 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.
9537 9538 9539 |
# File 'lib/ovirtsdk4/services.rb', line 9537 def to_s return "#<#{HostDeviceService}:#{@path}>" end |