Class: OvirtSDK4::FilterService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::FilterService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Filter) 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
- (Filter) get(opts = {})
Returns the representation of the object managed by this service.
8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 |
# File 'lib/ovirtsdk4/services.rb', line 8204 def get(opts = {}) query = {} value = opts[:filter] unless value.nil? value = Writer.render_boolean(value) query['filter'] = 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 FilterReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 |
# File 'lib/ovirtsdk4/services.rb', line 8233 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.
8254 8255 8256 8257 8258 8259 |
# File 'lib/ovirtsdk4/services.rb', line 8254 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.
8266 8267 8268 |
# File 'lib/ovirtsdk4/services.rb', line 8266 def to_s return "#<#{FilterService}:#{@path}>" end |