Class: OvirtSDK4::BalancesService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#add(balance, opts = {}) ⇒ Balance

Add a balance module to a specified user defined scheduling policy.

Options Hash (opts):

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



4241
4242
4243
# File 'lib/ovirtsdk4/services.rb', line 4241

def add(balance, opts = {})
  internal_add(balance, Balance, ADD, opts)
end

#balance_service(id) ⇒ BalanceService

Locates the balance service.



4289
4290
4291
# File 'lib/ovirtsdk4/services.rb', line 4289

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.

Options Hash (opts):

  • :filter (Boolean)

    Indicates if the results should be filtered according to the permissions of the user.

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :max (Integer)

    Sets the maximum number of balances to return. If not specified all the balances are returned.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



4278
4279
4280
# File 'lib/ovirtsdk4/services.rb', line 4278

def list(opts = {})
  internal_get(LIST, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.



4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
# File 'lib/ovirtsdk4/services.rb', line 4300

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