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.
1880 1881 1882 |
# File 'lib/ovirtsdk4/services.rb', line 1880 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.
1923 1924 1925 |
# File 'lib/ovirtsdk4/services.rb', line 1923 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.
1911 1912 1913 |
# File 'lib/ovirtsdk4/services.rb', line 1911 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 |
# File 'lib/ovirtsdk4/services.rb', line 1934 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 |