Class: OvirtSDK4::AffinityLabelService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ AffinityLabel
Retrieves the details of a label.
-
#hosts_service ⇒ AffinityLabelHostsService
List all hosts with this label.
-
#remove(opts = {}) ⇒ Object
Removes a label from the system and clears all assignments of the removed label.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#update(label, opts = {}) ⇒ AffinityLabel
Updates a label.
-
#vms_service ⇒ AffinityLabelVmsService
List all virtual machines with this label.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ AffinityLabel
Retrieves the details of a label.
1247 1248 1249 |
# File 'lib/ovirtsdk4/services.rb', line 1247 def get(opts = {}) internal_get(GET, opts) end |
#hosts_service ⇒ AffinityLabelHostsService
List all hosts with this label.
1307 1308 1309 |
# File 'lib/ovirtsdk4/services.rb', line 1307 def hosts_service @hosts_service ||= AffinityLabelHostsService.new(self, 'hosts') end |
#remove(opts = {}) ⇒ Object
Removes a label from the system and clears all assignments of the removed label.
1271 1272 1273 |
# File 'lib/ovirtsdk4/services.rb', line 1271 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 |
# File 'lib/ovirtsdk4/services.rb', line 1327 def service(path) if path.nil? || path == '' return self end if path == 'hosts' return hosts_service end if path.start_with?('hosts/') return hosts_service.service(path[6..-1]) end if path == 'vms' return vms_service end if path.start_with?('vms/') return vms_service.service(path[4..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
#update(label, opts = {}) ⇒ AffinityLabel
Updates a label. This call will update all metadata, such as the name or description.
1298 1299 1300 |
# File 'lib/ovirtsdk4/services.rb', line 1298 def update(label, opts = {}) internal_update(label, AffinityLabel, UPDATE, opts) end |
#vms_service ⇒ AffinityLabelVmsService
List all virtual machines with this label.
1316 1317 1318 |
# File 'lib/ovirtsdk4/services.rb', line 1316 def vms_service @vms_service ||= AffinityLabelVmsService.new(self, 'vms') end |