Class: OvirtSDK4::AffinityGroupService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ AffinityGroup
Retrieve the affinity group details.
-
#host_labels_service ⇒ AffinityGroupHostLabelsService
Returns a reference to the service that manages the list of all host labels attached to this affinity group.
-
#hosts_service ⇒ AffinityGroupHostsService
Returns a reference to the service that manages the list of all hosts attached to this affinity group.
-
#remove(opts = {}) ⇒ Object
Remove the affinity group.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#update(group, opts = {}) ⇒ AffinityGroup
Update the affinity group.
-
#vm_labels_service ⇒ AffinityGroupVmLabelsService
Returns a reference to the service that manages the list of all virtual machine labels attached to this affinity group.
-
#vms_service ⇒ AffinityGroupVmsService
Returns a reference to the service that manages the list of all virtual machines attached to this affinity group.
Methods inherited from Service
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>
929 930 931 |
# File 'lib/ovirtsdk4/services.rb', line 929 def get(opts = {}) internal_get(GET, opts) end |
#host_labels_service ⇒ AffinityGroupHostLabelsService
Returns a reference to the service that manages the list of all host labels attached to this affinity group.
998 999 1000 |
# File 'lib/ovirtsdk4/services.rb', line 998 def host_labels_service @host_labels_service ||= AffinityGroupHostLabelsService.new(self, 'hostlabels') end |
#hosts_service ⇒ AffinityGroupHostsService
Returns a reference to the service that manages the list of all hosts attached to this affinity group.
1009 1010 1011 |
# File 'lib/ovirtsdk4/services.rb', line 1009 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 HTTP/1.1
958 959 960 |
# File 'lib/ovirtsdk4/services.rb', line 958 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1042 1043 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 |
# File 'lib/ovirtsdk4/services.rb', line 1042 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.
987 988 989 |
# File 'lib/ovirtsdk4/services.rb', line 987 def update(group, opts = {}) internal_update(group, AffinityGroup, UPDATE, opts) end |
#vm_labels_service ⇒ AffinityGroupVmLabelsService
Returns a reference to the service that manages the list of all virtual machine labels attached to this affinity group.
1020 1021 1022 |
# File 'lib/ovirtsdk4/services.rb', line 1020 def vm_labels_service @vm_labels_service ||= AffinityGroupVmLabelsService.new(self, 'vmlabels') end |
#vms_service ⇒ AffinityGroupVmsService
Returns a reference to the service that manages the list of all virtual machines attached to this affinity group.
1031 1032 1033 |
# File 'lib/ovirtsdk4/services.rb', line 1031 def vms_service @vms_service ||= AffinityGroupVmsService.new(self, 'vms') end |