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.

Returns:



20603
20604
20605
# File 'lib/ovirtsdk4/services.rb', line 20603

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

#filters_serviceFiltersService

Locates the filters service.

Returns:



20612
20613
20614
# File 'lib/ovirtsdk4/services.rb', line 20612

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

#get(opts = {}) ⇒ SchedulingPolicy

Returns the representation of the object managed by this service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

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.

Returns:



20540
20541
20542
# File 'lib/ovirtsdk4/services.rb', line 20540

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

#remove(opts = {}) ⇒ Object

Deletes the object managed by this service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

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.



20565
20566
20567
# File 'lib/ovirtsdk4/services.rb', line 20565

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

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
# File 'lib/ovirtsdk4/services.rb', line 20632

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.

Parameters:

  • policy (SchedulingPolicy)

    The policy to update.

  • opts (Hash) (defaults to: {})

    Additional options.

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.

Returns:



20594
20595
20596
# File 'lib/ovirtsdk4/services.rb', line 20594

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

#weights_serviceWeightsService

Locates the weights service.

Returns:



20621
20622
20623
# File 'lib/ovirtsdk4/services.rb', line 20621

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