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.
2179 2180 2181 |
# File 'lib/ovirtsdk4/services.rb', line 2179 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.
2210 2211 2212 |
# File 'lib/ovirtsdk4/services.rb', line 2210 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 |
# File 'lib/ovirtsdk4/services.rb', line 2233 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.
2222 2223 2224 |
# File 'lib/ovirtsdk4/services.rb', line 2222 def vm_service(id) AffinityLabelVmService.new(self, id) end |