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>
930 931 932 |
# File 'lib/ovirtsdk4/services.rb', line 930 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.
1000 1001 1002 |
# File 'lib/ovirtsdk4/services.rb', line 1000 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.
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
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.
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.
989 990 991 |
# File 'lib/ovirtsdk4/services.rb', line 989 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.
1022 1023 1024 |
# File 'lib/ovirtsdk4/services.rb', line 1022 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.
1033 1034 1035 |
# File 'lib/ovirtsdk4/services.rb', line 1033 def vms_service @vms_service ||= AffinityGroupVmsService.new(self, 'vms') end |