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.
2169 2170 2171 |
# File 'lib/ovirtsdk4/services.rb', line 2169 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.
2200 2201 2202 |
# File 'lib/ovirtsdk4/services.rb', line 2200 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 |
# File 'lib/ovirtsdk4/services.rb', line 2223 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.
2212 2213 2214 |
# File 'lib/ovirtsdk4/services.rb', line 2212 def vm_service(id) AffinityLabelVmService.new(self, id) end |