Class: OvirtSDK4::VmDiskService
- Inherits:
-
MeasurableService
- Object
- Service
- MeasurableService
- OvirtSDK4::VmDiskService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#activate(opts = {}) ⇒ Object
Executes the
activatemethod. -
#deactivate(opts = {}) ⇒ Object
Executes the
deactivatemethod. -
#export(opts = {}) ⇒ Object
Executes the
exportmethod. -
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
-
#move(opts = {}) ⇒ Object
Executes the
movemethod. -
#permissions_service ⇒ AssignedPermissionsService
Locates the
permissionsservice. -
#reduce(opts = {}) ⇒ Object
Reduces the size of the disk image.
-
#remove(opts = {}) ⇒ Object
Detach the disk from the virtual machine.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#statistics_service ⇒ StatisticsService
Locates the
statisticsservice. -
#update(disk, opts = {}) ⇒ Disk
Updates the
disk.
Methods inherited from Service
Instance Method Details
#activate(opts = {}) ⇒ Object
Executes the activate method.
32429 32430 32431 |
# File 'lib/ovirtsdk4/services.rb', line 32429 def activate(opts = {}) internal_action(:activate, nil, ACTIVATE, opts) end |
#deactivate(opts = {}) ⇒ Object
Executes the deactivate method.
32455 32456 32457 |
# File 'lib/ovirtsdk4/services.rb', line 32455 def deactivate(opts = {}) internal_action(:deactivate, nil, DEACTIVATE, opts) end |
#export(opts = {}) ⇒ Object
Executes the export method.
32484 32485 32486 |
# File 'lib/ovirtsdk4/services.rb', line 32484 def export(opts = {}) internal_action(:export, nil, EXPORT, opts) end |
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
32513 32514 32515 |
# File 'lib/ovirtsdk4/services.rb', line 32513 def get(opts = {}) internal_get(GET, opts) end |
#move(opts = {}) ⇒ Object
Executes the move method.
32542 32543 32544 |
# File 'lib/ovirtsdk4/services.rb', line 32542 def move(opts = {}) internal_action(:move, nil, MOVE, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions service.
32638 32639 32640 |
# File 'lib/ovirtsdk4/services.rb', line 32638 def @permissions_service ||= AssignedPermissionsService.new(self, 'permissions') end |
#reduce(opts = {}) ⇒ Object
Reduces the size of the disk image.
Invokes reduce on the logical volume (i.e. this is only applicable for block storage domains). This is applicable for floating disks and disks attached to non-running virtual machines. There is no need to specify the size as the optimal size is calculated automatically.
32572 32573 32574 |
# File 'lib/ovirtsdk4/services.rb', line 32572 def reduce(opts = {}) internal_action(:reduce, nil, REDUCE, opts) end |
#remove(opts = {}) ⇒ Object
Detach the disk from the virtual machine.
|
Note
|
In version 3 of the API this used to also remove the disk completely from the system, but starting with version 4 it doesn’t. If you need to remove it completely use the remove method of the top level disk service. |
32600 32601 32602 |
# File 'lib/ovirtsdk4/services.rb', line 32600 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
32658 32659 32660 32661 32662 32663 32664 32665 32666 32667 32668 32669 32670 32671 32672 32673 32674 32675 |
# File 'lib/ovirtsdk4/services.rb', line 32658 def service(path) if path.nil? || path == '' return self end if path == 'permissions' return end if path.start_with?('permissions/') return .service(path[12..-1]) end if path == 'statistics' return statistics_service end if path.start_with?('statistics/') return statistics_service.service(path[11..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
#statistics_service ⇒ StatisticsService
Locates the statistics service.
32647 32648 32649 |
# File 'lib/ovirtsdk4/services.rb', line 32647 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |