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.
1895 1896 1897 |
# File 'lib/ovirtsdk4/services.rb', line 1895 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.
1938 1939 1940 |
# File 'lib/ovirtsdk4/services.rb', line 1938 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.
1926 1927 1928 |
# File 'lib/ovirtsdk4/services.rb', line 1926 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 |
# File 'lib/ovirtsdk4/services.rb', line 1949 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 |