Class: OvirtSDK4::BalancesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(balance, opts = {}) ⇒ Balance
Add a balance module to a specified user defined scheduling policy.
-
#balance_service(id) ⇒ BalanceService
Locates the
balance
service. -
#list(opts = {}) ⇒ Array<Balance>
Returns the list of balance modules used by the scheduling policy.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(balance, opts = {}) ⇒ Balance
Add a balance module to a specified user defined scheduling policy.
4264 4265 4266 |
# File 'lib/ovirtsdk4/services.rb', line 4264 def add(balance, opts = {}) internal_add(balance, Balance, ADD, opts) end |
#balance_service(id) ⇒ BalanceService
Locates the balance
service.
4312 4313 4314 |
# File 'lib/ovirtsdk4/services.rb', line 4312 def balance_service(id) BalanceService.new(self, id) end |
#list(opts = {}) ⇒ Array<Balance>
Returns the list of balance modules used by the scheduling policy.
The order of the returned balance modules isn’t guaranteed.
4301 4302 4303 |
# File 'lib/ovirtsdk4/services.rb', line 4301 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 |
# File 'lib/ovirtsdk4/services.rb', line 4323 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return balance_service(path) end return balance_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |