Class: OvirtSDK4::VmHostDeviceService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::VmHostDeviceService
- 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.
-
- (Object) remove(opts = {})
Deletes 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.
25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092 25093 25094 25095 25096 |
# File 'lib/ovirtsdk4/services.rb', line 25081 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 |
- (Object) remove(opts = {})
Deletes the object managed by this service.
25105 25106 25107 25108 25109 25110 25111 25112 25113 25114 25115 25116 25117 |
# File 'lib/ovirtsdk4/services.rb', line 25105 def remove(opts = {}) query = {} value = opts[:async] unless value.nil? value = Writer.render_boolean(value) query['async'] = value end request = Request.new(:method => :DELETE, :path => @path, :query => query) response = @connection.send(request) unless response.code == 200 check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
25126 25127 25128 25129 25130 25131 |
# File 'lib/ovirtsdk4/services.rb', line 25126 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.
25138 25139 25140 |
# File 'lib/ovirtsdk4/services.rb', line 25138 def to_s return "#<#{VmHostDeviceService}:#{@path}>" end |