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>
912 913 914 |
# File 'lib/ovirtsdk4/services.rb', line 912 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.
982 983 984 |
# File 'lib/ovirtsdk4/services.rb', line 982 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.
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
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.
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.
971 972 973 |
# File 'lib/ovirtsdk4/services.rb', line 971 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.
1004 1005 1006 |
# File 'lib/ovirtsdk4/services.rb', line 1004 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.
1015 1016 1017 |
# File 'lib/ovirtsdk4/services.rb', line 1015 def vms_service @vms_service ||= AffinityGroupVmsService.new(self, 'vms') end |