Class: OvirtSDK4::GlusterVolumesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(volume, opts = {}) ⇒ GlusterVolume
Creates a new gluster volume.
-
#list(opts = {}) ⇒ Array<GlusterVolume>
Lists all gluster volumes in the cluster.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#volume_service(id) ⇒ GlusterVolumeService
Reference to a service managing gluster volume.
Methods inherited from Service
Instance Method Details
#add(volume, opts = {}) ⇒ GlusterVolume
Creates a new gluster volume.
The volume is created based on properties of the volume
parameter. The properties name
, volume_type
and
bricks
are required.
For example, to add a volume with name myvolume
to the cluster 123
, send the following request:
POST /ovirt-engine/api/clusters/123/glustervolumes
With the following request body:
<gluster_volume>
<name>myvolume</name>
<volume_type>replicate</volume_type>
<replica_count>3</replica_count>
<bricks>
<brick>
<server_id>server1</server_id>
<brick_dir>/exp1</brick_dir>
</brick>
<brick>
<server_id>server2</server_id>
<brick_dir>/exp1</brick_dir>
</brick>
<brick>
<server_id>server3</server_id>
<brick_dir>/exp1</brick_dir>
</brick>
<bricks>
</gluster_volume>
11620 11621 11622 |
# File 'lib/ovirtsdk4/services.rb', line 11620 def add(volume, opts = {}) internal_add(volume, GlusterVolume, ADD, opts) end |
#list(opts = {}) ⇒ Array<GlusterVolume>
Lists all gluster volumes in the cluster.
For example, to list all Gluster Volumes in cluster 456
, send a request like
this:
GET /ovirt-engine/api/clusters/456/glustervolumes
The order of the returned list of volumes isn’t guaranteed.
11670 11671 11672 |
# File 'lib/ovirtsdk4/services.rb', line 11670 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 |
# File 'lib/ovirtsdk4/services.rb', line 11692 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return volume_service(path) end return volume_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |
#volume_service(id) ⇒ GlusterVolumeService
Reference to a service managing gluster volume.
11681 11682 11683 |
# File 'lib/ovirtsdk4/services.rb', line 11681 def volume_service(id) GlusterVolumeService.new(self, id) end |