Class: OvirtSDK4::AffinityLabelVmsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(vm, opts = {}) ⇒ Vm
Add a label to a vm.
-
#list(opts = {}) ⇒ Array<Vm>
List all virtual machines with the label.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#vm_service(id) ⇒ AffinityLabelVmService
A link to the specific label-vm assignment to allow label removal.
Methods inherited from Service
Instance Method Details
#add(vm, opts = {}) ⇒ Vm
Add a label to a vm.
1608 1609 1610 |
# File 'lib/ovirtsdk4/services.rb', line 1608 def add(vm, opts = {}) internal_add(vm, Vm, ADD, opts) end |
#list(opts = {}) ⇒ Array<Vm>
List all virtual machines with the label.
The order of the returned virtual machines isn’t guaranteed.
1639 1640 1641 |
# File 'lib/ovirtsdk4/services.rb', line 1639 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 |
# File 'lib/ovirtsdk4/services.rb', line 1662 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return vm_service(path) end return vm_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
#vm_service(id) ⇒ AffinityLabelVmService
A link to the specific label-vm assignment to allow label removal.
1651 1652 1653 |
# File 'lib/ovirtsdk4/services.rb', line 1651 def vm_service(id) AffinityLabelVmService.new(self, id) end |