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>
10601 10602 10603 |
# File 'lib/ovirtsdk4/services.rb', line 10601 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.
10651 10652 10653 |
# File 'lib/ovirtsdk4/services.rb', line 10651 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 |
# File 'lib/ovirtsdk4/services.rb', line 10673 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.
10662 10663 10664 |
# File 'lib/ovirtsdk4/services.rb', line 10662 def volume_service(id) GlusterVolumeService.new(self, id) end |