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.
2280 2281 2282 |
# File 'lib/ovirtsdk4/services.rb', line 2280 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AffinityLabelService
Link to a single label details.
2325 2326 2327 |
# File 'lib/ovirtsdk4/services.rb', line 2325 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.
2314 2315 2316 |
# File 'lib/ovirtsdk4/services.rb', line 2314 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 |
# File 'lib/ovirtsdk4/services.rb', line 2336 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 |