Class: OvirtSDK4::AffinityGroupService

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

#get(opts = {}) ⇒ AffinityGroup

Retrieve the affinity group details.

<affinity_group id="00000000-0000-0000-0000-000000000000">
  <name>AF_GROUP_001</name>
  <cluster id="00000000-0000-0000-0000-000000000000"/>
  <positive>true</positive>
  <enforcing>true</enforcing>
</affinity_group>

Parameters:

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

    Additional options.

Options Hash (opts):

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


912
913
914
# File 'lib/ovirtsdk4/services.rb', line 912

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

#host_labels_serviceAffinityGroupHostLabelsService

Returns a reference to the service that manages the list of all host labels attached to this affinity group.

Returns:


982
983
984
# File 'lib/ovirtsdk4/services.rb', line 982

def host_labels_service
  @host_labels_service ||= AffinityGroupHostLabelsService.new(self, 'hostlabels')
end

#hosts_serviceAffinityGroupHostsService

Returns a reference to the service that manages the list of all hosts attached to this affinity group.

Returns:


993
994
995
# File 'lib/ovirtsdk4/services.rb', line 993

def hosts_service
  @hosts_service ||= AffinityGroupHostsService.new(self, 'hosts')
end

#remove(opts = {}) ⇒ Object

Remove the affinity group.

DELETE /ovirt-engine/api/clusters/000-000/affinitygroups/123-456

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the removal 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.


942
943
944
# File 'lib/ovirtsdk4/services.rb', line 942

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:


1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/ovirtsdk4/services.rb', line 1026

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'hostlabels'
    return host_labels_service
  end
  if path.start_with?('hostlabels/')
    return host_labels_service.service(path[11..-1])
  end
  if path == 'hosts'
    return hosts_service
  end
  if path.start_with?('hosts/')
    return hosts_service.service(path[6..-1])
  end
  if path == 'vmlabels'
    return vm_labels_service
  end
  if path.start_with?('vmlabels/')
    return vm_labels_service.service(path[9..-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(group, opts = {}) ⇒ AffinityGroup

Update the affinity group.

Parameters:

  • group (AffinityGroup)

    The affinity group.

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


971
972
973
# File 'lib/ovirtsdk4/services.rb', line 971

def update(group, opts = {})
  internal_update(group, AffinityGroup, UPDATE, opts)
end

#vm_labels_serviceAffinityGroupVmLabelsService

Returns a reference to the service that manages the list of all virtual machine labels attached to this affinity group.

Returns:


1004
1005
1006
# File 'lib/ovirtsdk4/services.rb', line 1004

def vm_labels_service
  @vm_labels_service ||= AffinityGroupVmLabelsService.new(self, 'vmlabels')
end

#vms_serviceAffinityGroupVmsService

Returns a reference to the service that manages the list of all virtual machines attached to this affinity group.

Returns:


1015
1016
1017
# File 'lib/ovirtsdk4/services.rb', line 1015

def vms_service
  @vms_service ||= AffinityGroupVmsService.new(self, 'vms')
end