Class: OvirtSDK4::AssignedAffinityLabelsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(label, opts = {}) ⇒ AffinityLabel
Attaches a label to an entity.
-
#label_service(id) ⇒ AssignedAffinityLabelService
Link to the specific entity-label assignment to allow removal.
-
#list(opts = {}) ⇒ Array<AffinityLabel>
Lists all labels that are attached to an entity.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(label, opts = {}) ⇒ AffinityLabel
Attaches a label to an entity.
2462 2463 2464 |
# File 'lib/ovirtsdk4/services.rb', line 2462 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AssignedAffinityLabelService
Link to the specific entity-label assignment to allow removal.
2505 2506 2507 |
# File 'lib/ovirtsdk4/services.rb', line 2505 def label_service(id) AssignedAffinityLabelService.new(self, id) end |
#list(opts = {}) ⇒ Array<AffinityLabel>
Lists all labels that are attached to an entity.
The order of the returned entities isn’t guaranteed.
2493 2494 2495 |
# File 'lib/ovirtsdk4/services.rb', line 2493 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 |
# File 'lib/ovirtsdk4/services.rb', line 2516 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 |