Class: OvirtSDK4::StorageDomainService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#disk_profiles_service ⇒ AssignedDiskProfilesService
Locates the
disk_profiles
service. -
#disk_snapshots_service ⇒ DiskSnapshotsService
Locates the
disk_snapshots
service. -
#disks_service ⇒ StorageDomainDisksService
Reference to the service that manages the disks available in the storage domain.
-
#files_service ⇒ FilesService
Returns a reference to the service that manages the files available in the storage domain.
-
#get(opts = {}) ⇒ StorageDomain
Retrieves the description of the storage domain.
-
#images_service ⇒ ImagesService
Locates the
images
service. -
#is_attached(opts = {}) ⇒ Object
Used for querying if the storage domain is already attached to a data center using the is_attached boolean field, which is part of the storage server.
-
#permissions_service ⇒ AssignedPermissionsService
Locates the
permissions
service. -
#reduce_luns(opts = {}) ⇒ Object
This operation reduces logical units from the storage domain.
-
#refresh_luns(opts = {}) ⇒ Object
This operation refreshes the LUN size.
-
#remove(opts = {}) ⇒ Object
Removes the storage domain.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#storage_connections_service ⇒ StorageDomainServerConnectionsService
Returns a reference to the service that manages the storage connections.
-
#templates_service ⇒ StorageDomainTemplatesService
Locates the
templates
service. -
#update(storage_domain, opts = {}) ⇒ StorageDomain
Updates a storage domain.
-
#update_ovf_store(opts = {}) ⇒ Object
This operation forces the update of the
OVF_STORE
of this storage domain. -
#vms_service ⇒ StorageDomainVmsService
Locates the
vms
service.
Methods inherited from Service
Instance Method Details
#disk_profiles_service ⇒ AssignedDiskProfilesService
Locates the disk_profiles
service.
21397 21398 21399 |
# File 'lib/ovirtsdk4/services.rb', line 21397 def disk_profiles_service @disk_profiles_service ||= AssignedDiskProfilesService.new(self, 'diskprofiles') end |
#disk_snapshots_service ⇒ DiskSnapshotsService
Locates the disk_snapshots
service.
21406 21407 21408 |
# File 'lib/ovirtsdk4/services.rb', line 21406 def disk_snapshots_service @disk_snapshots_service ||= DiskSnapshotsService.new(self, 'disksnapshots') end |
#disks_service ⇒ StorageDomainDisksService
Reference to the service that manages the disks available in the storage domain.
21415 21416 21417 |
# File 'lib/ovirtsdk4/services.rb', line 21415 def disks_service @disks_service ||= StorageDomainDisksService.new(self, 'disks') end |
#files_service ⇒ FilesService
Returns a reference to the service that manages the files available in the storage domain.
21424 21425 21426 |
# File 'lib/ovirtsdk4/services.rb', line 21424 def files_service @files_service ||= FilesService.new(self, 'files') end |
#get(opts = {}) ⇒ StorageDomain
Retrieves the description of the storage domain.
21089 21090 21091 |
# File 'lib/ovirtsdk4/services.rb', line 21089 def get(opts = {}) internal_get(GET, opts) end |
#images_service ⇒ ImagesService
Locates the images
service.
21433 21434 21435 |
# File 'lib/ovirtsdk4/services.rb', line 21433 def images_service @images_service ||= ImagesService.new(self, 'images') end |
#is_attached(opts = {}) ⇒ Object
Used for querying if the storage domain is already attached to a data center using the is_attached boolean field, which is part of the storage server. IMPORTANT: Executing this API will cause the host to disconnect from the storage domain.
21122 21123 21124 |
# File 'lib/ovirtsdk4/services.rb', line 21122 def is_attached(opts = {}) internal_action(:isattached, :is_attached, IS_ATTACHED, opts) end |
#permissions_service ⇒ AssignedPermissionsService
Locates the permissions
service.
21442 21443 21444 |
# File 'lib/ovirtsdk4/services.rb', line 21442 def @permissions_service ||= AssignedPermissionsService.new(self, 'permissions') end |
#reduce_luns(opts = {}) ⇒ Object
This operation reduces logical units from the storage domain.
In order to do so the data stored on the provided logical units will be moved to other logical units of the storage domain and only then they will be reduced from the storage domain.
For example, in order to reduce two logical units from a storage domain send a request like this:
POST /ovirt-engine/api/storageDomains/123/reduceluns
With a request body like this:
<action>
<logical_units>
<logical_unit id="1IET_00010001"/>
<logical_unit id="1IET_00010002"/>
</logical_units>
</action>
Note that this operation is only applicable to block storage domains (i.e., storage domains with the
<<types/storage_type, storage type> of iSCSI or FCP).
21173 21174 21175 |
# File 'lib/ovirtsdk4/services.rb', line 21173 def reduce_luns(opts = {}) internal_action(:reduceluns, nil, REDUCE_LUNS, opts) end |
#refresh_luns(opts = {}) ⇒ Object
This operation refreshes the LUN size.
After increasing the size of the underlying LUN on the storage server, the user can refresh the LUN size. This action forces a rescan of the provided LUNs and updates the database with the new size, if required.
For example, in order to refresh the size of two LUNs send a request like this:
POST /ovirt-engine/api/storageDomains/262b056b-aede-40f1-9666-b883eff59d40/refreshluns
With a request body like this:
<action>
<logical_units>
<logical_unit id="1IET_00010001"/>
<logical_unit id="1IET_00010002"/>
</logical_units>
</action>
21226 21227 21228 |
# File 'lib/ovirtsdk4/services.rb', line 21226 def refresh_luns(opts = {}) internal_action(:refreshluns, nil, REFRESH_LUNS, opts) end |
#remove(opts = {}) ⇒ Object
Removes the storage domain.
Without any special parameters, the storage domain is detached from the system and removed from the database. The storage domain can then be imported to the same or to a different setup, with all the data on it. If the storage is not accessible the operation will fail.
If the destroy
parameter is true
then the operation will always succeed, even if the storage is not
accessible, the failure is just ignored and the storage domain is removed from the database anyway.
If the format
parameter is true
then the actual storage is formatted, and the metadata is removed from the
LUN or directory, so it can no longer be imported to the same or to a different setup.
21295 21296 21297 |
# File 'lib/ovirtsdk4/services.rb', line 21295 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 |
# File 'lib/ovirtsdk4/services.rb', line 21480 def service(path) if path.nil? || path == '' return self end if path == 'diskprofiles' return disk_profiles_service end if path.start_with?('diskprofiles/') return disk_profiles_service.service(path[13..-1]) end if path == 'disksnapshots' return disk_snapshots_service end if path.start_with?('disksnapshots/') return disk_snapshots_service.service(path[14..-1]) end if path == 'disks' return disks_service end if path.start_with?('disks/') return disks_service.service(path[6..-1]) end if path == 'files' return files_service end if path.start_with?('files/') return files_service.service(path[6..-1]) end if path == 'images' return images_service end if path.start_with?('images/') return images_service.service(path[7..-1]) end if path == 'permissions' return end if path.start_with?('permissions/') return .service(path[12..-1]) end if path == 'storageconnections' return storage_connections_service end if path.start_with?('storageconnections/') return storage_connections_service.service(path[19..-1]) end if path == 'templates' return templates_service end if path.start_with?('templates/') return templates_service.service(path[10..-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 |
#storage_connections_service ⇒ StorageDomainServerConnectionsService
Returns a reference to the service that manages the storage connections.
21451 21452 21453 |
# File 'lib/ovirtsdk4/services.rb', line 21451 def storage_connections_service @storage_connections_service ||= StorageDomainServerConnectionsService.new(self, 'storageconnections') end |
#templates_service ⇒ StorageDomainTemplatesService
Locates the templates
service.
21460 21461 21462 |
# File 'lib/ovirtsdk4/services.rb', line 21460 def templates_service @templates_service ||= StorageDomainTemplatesService.new(self, 'templates') end |
#update(storage_domain, opts = {}) ⇒ StorageDomain
Updates a storage domain.
Not all of the StorageDomain's attributes are updatable after creation. Those that can be
updated are: name
, description
, comment
, warning_low_space_indicator
, critical_space_action_blocker
and
wipe_after_delete.
(Note that changing the wipe_after_delete
attribute will not change the wipe after delete
property of disks that already exist).
To update the name
and wipe_after_delete
attributes of a storage domain with an identifier 123
, send a
request as follows:
PUT /ovirt-engine/api/storageDomains/123
With a request body as follows:
<storage_domain>
<name>data2</name>
<wipe_after_delete>true</wipe_after_delete>
</storage_domain>
21347 21348 21349 |
# File 'lib/ovirtsdk4/services.rb', line 21347 def update(storage_domain, opts = {}) internal_update(storage_domain, StorageDomain, UPDATE, opts) end |
#update_ovf_store(opts = {}) ⇒ Object
This operation forces the update of the OVF_STORE
of this storage domain.
The OVF_STORE
is a disk image that contains the metadata
of virtual machines and disks that reside in the
storage domain. This metadata is used in case the
domain is imported or exported to or from a different
data center or a different installation.
By default the OVF_STORE
is updated periodically
(set by default to 60 minutes) but users might want to force an
update after an important change, or when the they believe the
OVF_STORE
is corrupt.
When initiated by the user, OVF_STORE
update will be performed whether
an update is needed or not.
21388 21389 21390 |
# File 'lib/ovirtsdk4/services.rb', line 21388 def update_ovf_store(opts = {}) internal_action(:updateovfstore, nil, UPDATE_OVF_STORE, opts) end |
#vms_service ⇒ StorageDomainVmsService
Locates the vms
service.
21469 21470 21471 |
# File 'lib/ovirtsdk4/services.rb', line 21469 def vms_service @vms_service ||= StorageDomainVmsService.new(self, 'vms') end |