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.
1713 1714 1715 |
# File 'lib/ovirtsdk4/services.rb', line 1713 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AffinityLabelService
Link to a single label details.
1758 1759 1760 |
# File 'lib/ovirtsdk4/services.rb', line 1758 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.
1747 1748 1749 |
# File 'lib/ovirtsdk4/services.rb', line 1747 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 |
# File 'lib/ovirtsdk4/services.rb', line 1769 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 |