Class: OvirtSDK4::WeightService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::WeightService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Weight) 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
- (Weight) get(opts = {})
Returns the representation of the object managed by this service.
27232 27233 27234 27235 27236 27237 27238 27239 27240 27241 27242 27243 27244 27245 27246 27247 27248 27249 27250 27251 27252 |
# File 'lib/ovirtsdk4/services.rb', line 27232 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 WeightReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
27261 27262 27263 27264 27265 27266 27267 27268 27269 27270 27271 27272 27273 |
# File 'lib/ovirtsdk4/services.rb', line 27261 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.
27282 27283 27284 27285 27286 27287 |
# File 'lib/ovirtsdk4/services.rb', line 27282 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.
27294 27295 27296 |
# File 'lib/ovirtsdk4/services.rb', line 27294 def to_s return "#<#{WeightService}:#{@path}>" end |