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
activate
method. -
#deactivate(opts = {}) ⇒ Object
Executes the
deactivate
method. -
#export(opts = {}) ⇒ Object
Executes the
export
method. -
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
-
#move(opts = {}) ⇒ Object
Executes the
move
method. -
#permissions_service ⇒ AssignedPermissionsService
Locates the
permissions
service. -
#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
statistics
service. -
#update(disk, opts = {}) ⇒ Disk
Updates the
disk
.
Methods inherited from Service
Instance Method Details
#activate(opts = {}) ⇒ Object
Executes the activate
method.
30473 30474 30475 |
# File 'lib/ovirtsdk4/services.rb', line 30473 def activate(opts = {}) internal_action(:activate, nil, ACTIVATE, opts) end |
#deactivate(opts = {}) ⇒ Object
Executes the deactivate
method.
30499 30500 30501 |
# File 'lib/ovirtsdk4/services.rb', line 30499 def deactivate(opts = {}) internal_action(:deactivate, nil, DEACTIVATE, opts) end |
#export(opts = {}) ⇒ Object
Executes the export
method.
30528 30529 30530 |
# File 'lib/ovirtsdk4/services.rb', line 30528 def export(opts = {}) internal_action(:export, nil, EXPORT, opts) end |
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
30557 30558 30559 |
# File 'lib/ovirtsdk4/services.rb', line 30557 def get(opts = {}) internal_get(GET, opts) end |
#move(opts = {}) ⇒ Object
Executes the move
method.
30586 30587 30588 |
# File 'lib/ovirtsdk4/services.rb', line 30586 def move(opts = {}) internal_action(:move, nil, MOVE, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions
service.
30683 30684 30685 |
# File 'lib/ovirtsdk4/services.rb', line 30683 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.
30616 30617 30618 |
# File 'lib/ovirtsdk4/services.rb', line 30616 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. |
30645 30646 30647 |
# File 'lib/ovirtsdk4/services.rb', line 30645 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
30703 30704 30705 30706 30707 30708 30709 30710 30711 30712 30713 30714 30715 30716 30717 30718 30719 30720 |
# File 'lib/ovirtsdk4/services.rb', line 30703 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.
30692 30693 30694 |
# File 'lib/ovirtsdk4/services.rb', line 30692 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |