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.
32875 32876 32877 |
# File 'lib/ovirtsdk4/services.rb', line 32875 def activate(opts = {}) internal_action(:activate, nil, ACTIVATE, opts) end |
#deactivate(opts = {}) ⇒ Object
Executes the deactivate
method.
32901 32902 32903 |
# File 'lib/ovirtsdk4/services.rb', line 32901 def deactivate(opts = {}) internal_action(:deactivate, nil, DEACTIVATE, opts) end |
#export(opts = {}) ⇒ Object
Executes the export
method.
32930 32931 32932 |
# File 'lib/ovirtsdk4/services.rb', line 32930 def export(opts = {}) internal_action(:export, nil, EXPORT, opts) end |
#get(opts = {}) ⇒ Disk
Returns the representation of the object managed by this service.
32959 32960 32961 |
# File 'lib/ovirtsdk4/services.rb', line 32959 def get(opts = {}) internal_get(GET, opts) end |
#move(opts = {}) ⇒ Object
Executes the move
method.
32988 32989 32990 |
# File 'lib/ovirtsdk4/services.rb', line 32988 def move(opts = {}) internal_action(:move, nil, MOVE, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions
service.
33084 33085 33086 |
# File 'lib/ovirtsdk4/services.rb', line 33084 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.
33018 33019 33020 |
# File 'lib/ovirtsdk4/services.rb', line 33018 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. |
33046 33047 33048 |
# File 'lib/ovirtsdk4/services.rb', line 33046 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
33104 33105 33106 33107 33108 33109 33110 33111 33112 33113 33114 33115 33116 33117 33118 33119 33120 33121 |
# File 'lib/ovirtsdk4/services.rb', line 33104 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.
33093 33094 33095 |
# File 'lib/ovirtsdk4/services.rb', line 33093 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |