Class: OvirtSDK4::WeightsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(weight, opts = {}) ⇒ Weight
Add a weight to a specified user defined scheduling policy.
-
#list(opts = {}) ⇒ Array<Weight>
Returns the list of weights.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#weight_service(id) ⇒ WeightService
Locates the
weight
service.
Methods inherited from Service
Instance Method Details
#add(weight, opts = {}) ⇒ Weight
Add a weight to a specified user defined scheduling policy.
33247 33248 33249 |
# File 'lib/ovirtsdk4/services.rb', line 33247 def add(weight, opts = {}) internal_add(weight, Weight, ADD, opts) end |
#list(opts = {}) ⇒ Array<Weight>
Returns the list of weights.
The order of the returned list of weights isn’t guaranteed.
33284 33285 33286 |
# File 'lib/ovirtsdk4/services.rb', line 33284 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
33306 33307 33308 33309 33310 33311 33312 33313 33314 33315 |
# File 'lib/ovirtsdk4/services.rb', line 33306 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return weight_service(path) end return weight_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
#weight_service(id) ⇒ WeightService
Locates the weight
service.
33295 33296 33297 |
# File 'lib/ovirtsdk4/services.rb', line 33295 def weight_service(id) WeightService.new(self, id) end |