class OvirtSDK4::AffinityLabelService

Constants

GET
REMOVE
UPDATE

Public Instance Methods

get(opts = {}) click to toggle source

Retrieves the details of a label.

@param opts [Hash] Additional options.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [AffinityLabel]

# File lib/ovirtsdk4/services.rb, line 1829
def get(opts = {})
  internal_get(GET, opts)
end
hosts_service() click to toggle source

List all hosts with this label.

@return [AffinityLabelHostsService] A reference to `hosts` service.

# File lib/ovirtsdk4/services.rb, line 1889
def hosts_service
  @hosts_service ||= AffinityLabelHostsService.new(self, 'hosts')
end
remove(opts = {}) click to toggle source

Removes a label from the system and clears all assignments of the removed label.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

# File lib/ovirtsdk4/services.rb, line 1853
def remove(opts = {})
  internal_remove(REMOVE, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 1909
def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'hosts'
    return hosts_service
  end
  if path.start_with?('hosts/')
    return hosts_service.service(path[6..-1])
  end
  if path == 'vms'
    return vms_service
  end
  if path.start_with?('vms/')
    return vms_service.service(path[4..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end
update(label, opts = {}) click to toggle source

Updates a label. This call will update all metadata, such as the name or description.

@param label [AffinityLabel] The `label` to update. @param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [AffinityLabel]

# File lib/ovirtsdk4/services.rb, line 1880
def update(label, opts = {})
  internal_update(label, AffinityLabel, UPDATE, opts)
end
vms_service() click to toggle source

List all virtual machines with this label.

@return [AffinityLabelVmsService] A reference to `vms` service.

# File lib/ovirtsdk4/services.rb, line 1898
def vms_service
  @vms_service ||= AffinityLabelVmsService.new(self, 'vms')
end