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.
1701 1702 1703 |
# File 'lib/ovirtsdk4/services.rb', line 1701 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AffinityLabelService
Link to a single label details.
1746 1747 1748 |
# File 'lib/ovirtsdk4/services.rb', line 1746 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.
1735 1736 1737 |
# File 'lib/ovirtsdk4/services.rb', line 1735 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 |
# File 'lib/ovirtsdk4/services.rb', line 1757 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 |