Class: OvirtSDK4::AffinityLabelsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(label, opts = {}) ⇒ AffinityLabel
Creates a new label.
-
#label_service(id) ⇒ AffinityLabelService
Link to a single label details.
-
#list(opts = {}) ⇒ Array<AffinityLabel>
Lists all labels present in the system.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(label, opts = {}) ⇒ AffinityLabel
Creates a new label. The label is automatically attached to all entities mentioned in the vms or hosts lists.
2272 2273 2274 |
# File 'lib/ovirtsdk4/services.rb', line 2272 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AffinityLabelService
Link to a single label details.
2317 2318 2319 |
# File 'lib/ovirtsdk4/services.rb', line 2317 def label_service(id) AffinityLabelService.new(self, id) end |
#list(opts = {}) ⇒ Array<AffinityLabel>
Lists all labels present in the system.
The order of the returned labels isn’t guaranteed.
2306 2307 2308 |
# File 'lib/ovirtsdk4/services.rb', line 2306 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 |
# File 'lib/ovirtsdk4/services.rb', line 2328 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return label_service(path) end return label_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |