Class: OvirtSDK4::AffinityGroupHostLabelsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(label, opts = {}) ⇒ AffinityLabel
Adds a host label to the affinity group.
-
#label_service(id) ⇒ AffinityGroupHostLabelService
Access the service that manages the host label assignment to this affinity group.
-
#list(opts = {}) ⇒ Array<AffinityLabel>
List all host labels assigned to this affinity group.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(label, opts = {}) ⇒ AffinityLabel
Adds a host label to the affinity group.
For example, to add the label 789
to the affinity group 456
of cluster 123
,
send a request like this:
POST /ovirt-engine/api/clusters/123/affinitygroups/456/hostlabels
With the following body:
<affinity_label id="789"/>
1184 1185 1186 |
# File 'lib/ovirtsdk4/services.rb', line 1184 def add(label, opts = {}) internal_add(label, AffinityLabel, ADD, opts) end |
#label_service(id) ⇒ AffinityGroupHostLabelService
Access the service that manages the host label assignment to this affinity group.
1230 1231 1232 |
# File 'lib/ovirtsdk4/services.rb', line 1230 def label_service(id) AffinityGroupHostLabelService.new(self, id) end |
#list(opts = {}) ⇒ Array<AffinityLabel>
List all host labels assigned to this affinity group.
The order of the returned labels isn’t guaranteed.
1219 1220 1221 |
# File 'lib/ovirtsdk4/services.rb', line 1219 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
# File 'lib/ovirtsdk4/services.rb', line 1241 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 |