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.
32341 32342 32343 |
# File 'lib/ovirtsdk4/services.rb', line 32341 def activate(opts = {}) internal_action(:activate, nil, ACTIVATE, opts) end |
#deactivate(opts = {}) ⇒ Object
Executes the deactivate method.
32367 32368 32369 |
# File 'lib/ovirtsdk4/services.rb', line 32367 def deactivate(opts = {}) internal_action(:deactivate, nil, DEACTIVATE, opts) end |
#export(opts = {}) ⇒ Object
Executes the export method.
32396 32397 32398 |
# File 'lib/ovirtsdk4/services.rb', line 32396 def export(opts = {}) internal_action(:export, nil, EXPORT, opts) end |
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
32425 32426 32427 |
# File 'lib/ovirtsdk4/services.rb', line 32425 def get(opts = {}) internal_get(GET, opts) end |
#move(opts = {}) ⇒ Object
Executes the move method.
32454 32455 32456 |
# File 'lib/ovirtsdk4/services.rb', line 32454 def move(opts = {}) internal_action(:move, nil, MOVE, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions service.
32551 32552 32553 |
# File 'lib/ovirtsdk4/services.rb', line 32551 def ||= 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.
32484 32485 32486 |
# File 'lib/ovirtsdk4/services.rb', line 32484 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. |
32513 32514 32515 |
# File 'lib/ovirtsdk4/services.rb', line 32513 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
32571 32572 32573 32574 32575 32576 32577 32578 32579 32580 32581 32582 32583 32584 32585 32586 32587 32588 |
# File 'lib/ovirtsdk4/services.rb', line 32571 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.
32560 32561 32562 |
# File 'lib/ovirtsdk4/services.rb', line 32560 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |
#update(disk, opts = {}) ⇒ Disk
Updates the disk.
32542 32543 32544 |
# File 'lib/ovirtsdk4/services.rb', line 32542 def update(disk, opts = {}) internal_update(disk, Disk, UPDATE, opts) end |