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.
2444 2445 2446 |
# File 'lib/ovirtsdk4/services.rb', line 2444 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.
2487 2488 2489 |
# File 'lib/ovirtsdk4/services.rb', line 2487 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.
2475 2476 2477 |
# File 'lib/ovirtsdk4/services.rb', line 2475 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 |
# File 'lib/ovirtsdk4/services.rb', line 2498 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 |