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.
1883 1884 1885 |
# File 'lib/ovirtsdk4/services.rb', line 1883 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.
1926 1927 1928 |
# File 'lib/ovirtsdk4/services.rb', line 1926 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.
1914 1915 1916 |
# File 'lib/ovirtsdk4/services.rb', line 1914 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 |
# File 'lib/ovirtsdk4/services.rb', line 1937 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 |