Class: OvirtSDK4::SchedulingPolicyService

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

#balances_serviceBalancesService

Locates the balances service.



20327
20328
20329
# File 'lib/ovirtsdk4/services.rb', line 20327

def balances_service
  @balances_service ||= BalancesService.new(self, 'balances')
end

#filters_serviceFiltersService

Locates the filters service.



20336
20337
20338
# File 'lib/ovirtsdk4/services.rb', line 20336

def filters_service
  @filters_service ||= FiltersService.new(self, 'filters')
end

#get(opts = {}) ⇒ SchedulingPolicy

Returns the representation of the object managed by this service.

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.

  • :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.



20264
20265
20266
# File 'lib/ovirtsdk4/services.rb', line 20264

def get(opts = {})
  internal_get(GET, opts)
end

#remove(opts = {}) ⇒ Object

Deletes the object managed by this service.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :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.



20289
20290
20291
# File 'lib/ovirtsdk4/services.rb', line 20289

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Raises:



20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
# File 'lib/ovirtsdk4/services.rb', line 20356

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'balances'
    return balances_service
  end
  if path.start_with?('balances/')
    return balances_service.service(path[9..-1])
  end
  if path == 'filters'
    return filters_service
  end
  if path.start_with?('filters/')
    return filters_service.service(path[8..-1])
  end
  if path == 'weights'
    return weights_service
  end
  if path.start_with?('weights/')
    return weights_service.service(path[8..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#update(policy, opts = {}) ⇒ SchedulingPolicy

Update the specified user defined scheduling policy in the system.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :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.



20318
20319
20320
# File 'lib/ovirtsdk4/services.rb', line 20318

def update(policy, opts = {})
  internal_update(policy, SchedulingPolicy, UPDATE, opts)
end

#weights_serviceWeightsService

Locates the weights service.



20345
20346
20347
# File 'lib/ovirtsdk4/services.rb', line 20345

def weights_service
  @weights_service ||= WeightsService.new(self, 'weights')
end