Class: OvirtSDK4::GlusterVolumeService
- Inherits:
-
MeasurableService
- Object
- Service
- MeasurableService
- OvirtSDK4::GlusterVolumeService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ GlusterVolume
Get the gluster volume details.
-
#get_profile_statistics(opts = {}) ⇒ Object
Get gluster volume profile statistics.
-
#gluster_bricks_service ⇒ GlusterBricksService
Reference to a service managing gluster bricks.
-
#rebalance(opts = {}) ⇒ Object
Rebalance the gluster volume.
-
#remove(opts = {}) ⇒ Object
Removes the gluster volume.
-
#reset_all_options(opts = {}) ⇒ Object
Resets all the options set in the gluster volume.
-
#reset_option(opts = {}) ⇒ Object
Resets a particular option in the gluster volume.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#set_option(opts = {}) ⇒ Object
Sets a particular option in the gluster volume.
-
#start(opts = {}) ⇒ Object
Starts the gluster volume.
-
#start_profile(opts = {}) ⇒ Object
Start profiling the gluster volume.
-
#statistics_service ⇒ StatisticsService
Locates the
statistics
service. -
#stop(opts = {}) ⇒ Object
Stops the gluster volume.
-
#stop_profile(opts = {}) ⇒ Object
Stop profiling the gluster volume.
-
#stop_rebalance(opts = {}) ⇒ Object
Stop rebalancing the gluster volume.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ GlusterVolume
Get the gluster volume details.
For example, to get details of a gluster volume with identifier 123
in cluster 456
, send a request like this:
GET /ovirt-engine/api/clusters/456/glustervolumes/123
This GET request will return the following output:
<gluster_volume id="123">
<name>data</name>
<link href="/ovirt-engine/api/clusters/456/glustervolumes/123/glusterbricks" rel="glusterbricks"/>
<disperse_count>0</disperse_count>
<options>
<option>
<name>storage.owner-gid</name>
<value>36</value>
</option>
<option>
<name>performance.io-cache</name>
<value>off</value>
</option>
<option>
<name>cluster.data-self-heal-algorithm</name>
<value>full</value>
</option>
</options>
<redundancy_count>0</redundancy_count>
<replica_count>3</replica_count>
<status>up</status>
<stripe_count>0</stripe_count>
<transport_types>
<transport_type>tcp</transport_type>
</transport_types>
<volume_type>replicate</volume_type>
</gluster_volume>
38302 38303 38304 |
# File 'lib/ovirtsdk4/services.rb', line 38302 def get(opts = {}) internal_get(GET, opts) end |
#get_profile_statistics(opts = {}) ⇒ Object
Get gluster volume profile statistics.
For example, to get profile statistics for a gluster volume with identifier 123
in cluster 456
, send a
request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/getprofilestatistics
38335 38336 38337 |
# File 'lib/ovirtsdk4/services.rb', line 38335 def get_profile_statistics(opts = {}) internal_action(:getprofilestatistics, :details, GET_PROFILE_STATISTICS, opts) end |
#gluster_bricks_service ⇒ GlusterBricksService
Reference to a service managing gluster bricks.
38728 38729 38730 |
# File 'lib/ovirtsdk4/services.rb', line 38728 def gluster_bricks_service @gluster_bricks_service ||= GlusterBricksService.new(self, 'glusterbricks') end |
#rebalance(opts = {}) ⇒ Object
Rebalance the gluster volume.
Rebalancing a gluster volume helps to distribute the data evenly across all the bricks. After expanding or shrinking a gluster volume (without migrating data), we need to rebalance the data among the bricks. In a non-replicated volume, all bricks should be online to perform the rebalance operation. In a replicated volume, at least one of the bricks in the replica should be online.
For example, to rebalance a gluster volume with identifier 123
in cluster 456
, send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/rebalance
38382 38383 38384 |
# File 'lib/ovirtsdk4/services.rb', line 38382 def rebalance(opts = {}) internal_action(:rebalance, nil, REBALANCE, opts) end |
#remove(opts = {}) ⇒ Object
Removes the gluster volume.
For example, to remove a volume with identifier 123
in cluster 456
, send a request like this:
DELETE /ovirt-engine/api/clusters/456/glustervolumes/123
38414 38415 38416 |
# File 'lib/ovirtsdk4/services.rb', line 38414 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#reset_all_options(opts = {}) ⇒ Object
Resets all the options set in the gluster volume.
For example, to reset all options in a gluster volume with identifier 123
in cluster 456
, send a request like
this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetalloptions
38448 38449 38450 |
# File 'lib/ovirtsdk4/services.rb', line 38448 def (opts = {}) internal_action(:resetalloptions, nil, RESET_ALL_OPTIONS, opts) end |
#reset_option(opts = {}) ⇒ Object
Resets a particular option in the gluster volume.
For example, to reset a particular option option1
in a gluster volume with identifier 123
in cluster 456
,
send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetoption
With the following request body:
<action>
<option name="option1"/>
</action>
38497 38498 38499 |
# File 'lib/ovirtsdk4/services.rb', line 38497 def reset_option(opts = {}) internal_action(:resetoption, nil, RESET_OPTION, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
38748 38749 38750 38751 38752 38753 38754 38755 38756 38757 38758 38759 38760 38761 38762 38763 38764 38765 |
# File 'lib/ovirtsdk4/services.rb', line 38748 def service(path) if path.nil? || path == '' return self end if path == 'glusterbricks' return gluster_bricks_service end if path.start_with?('glusterbricks/') return gluster_bricks_service.service(path[14..-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 |
#set_option(opts = {}) ⇒ Object
Sets a particular option in the gluster volume.
For example, to set option1
with value value1
in a gluster volume with identifier 123
in cluster 456
,
send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/setoption
With the following request body:
<action>
<option name="option1" value="value1"/>
</action>
38543 38544 38545 |
# File 'lib/ovirtsdk4/services.rb', line 38543 def set_option(opts = {}) internal_action(:setoption, nil, SET_OPTION, opts) end |
#start(opts = {}) ⇒ Object
Starts the gluster volume.
A Gluster Volume should be started to read/write data. For example, to start a gluster volume with identifier
123
in cluster 456
, send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/start
38581 38582 38583 |
# File 'lib/ovirtsdk4/services.rb', line 38581 def start(opts = {}) internal_action(:start, nil, START, opts) end |
#start_profile(opts = {}) ⇒ Object
Start profiling the gluster volume.
For example, to start profiling a gluster volume with identifier 123
in cluster 456
, send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/startprofile
38614 38615 38616 |
# File 'lib/ovirtsdk4/services.rb', line 38614 def start_profile(opts = {}) internal_action(:startprofile, nil, START_PROFILE, opts) end |
#statistics_service ⇒ StatisticsService
Locates the statistics
service.
38737 38738 38739 |
# File 'lib/ovirtsdk4/services.rb', line 38737 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |
#stop(opts = {}) ⇒ Object
Stops the gluster volume.
Stopping a volume will make its data inaccessible.
For example, to stop a gluster volume with identifier 123
in cluster 456
, send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/stop
38652 38653 38654 |
# File 'lib/ovirtsdk4/services.rb', line 38652 def stop(opts = {}) internal_action(:stop, nil, STOP, opts) end |
#stop_profile(opts = {}) ⇒ Object
Stop profiling the gluster volume.
For example, to stop profiling a gluster volume with identifier 123
in cluster 456
, send a request like this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/stopprofile
38685 38686 38687 |
# File 'lib/ovirtsdk4/services.rb', line 38685 def stop_profile(opts = {}) internal_action(:stopprofile, nil, STOP_PROFILE, opts) end |
#stop_rebalance(opts = {}) ⇒ Object
Stop rebalancing the gluster volume.
For example, to stop rebalancing a gluster volume with identifier 123
in cluster 456
, send a request like
this:
POST /ovirt-engine/api/clusters/456/glustervolumes/123/stoprebalance
38719 38720 38721 |
# File 'lib/ovirtsdk4/services.rb', line 38719 def stop_rebalance(opts = {}) internal_action(:stoprebalance, nil, STOP_REBALANCE, opts) end |