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.
2187 2188 2189 |
# File 'lib/ovirtsdk4/services.rb', line 2187 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.
2218 2219 2220 |
# File 'lib/ovirtsdk4/services.rb', line 2218 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 |
# File 'lib/ovirtsdk4/services.rb', line 2241 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.
2230 2231 2232 |
# File 'lib/ovirtsdk4/services.rb', line 2230 def vm_service(id) AffinityLabelVmService.new(self, id) end |