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:



930
931
932
# File 'lib/ovirtsdk4/services.rb', line 930

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:



1000
1001
1002
# File 'lib/ovirtsdk4/services.rb', line 1000

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:



1011
1012
1013
# File 'lib/ovirtsdk4/services.rb', line 1011

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.



960
961
962
# File 'lib/ovirtsdk4/services.rb', line 960

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:



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/ovirtsdk4/services.rb', line 1044

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:



989
990
991
# File 'lib/ovirtsdk4/services.rb', line 989

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:



1022
1023
1024
# File 'lib/ovirtsdk4/services.rb', line 1022

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:



1033
1034
1035
# File 'lib/ovirtsdk4/services.rb', line 1033

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