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>
11707 11708 11709 |
# File 'lib/ovirtsdk4/services.rb', line 11707 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.
11757 11758 11759 |
# File 'lib/ovirtsdk4/services.rb', line 11757 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 |
# File 'lib/ovirtsdk4/services.rb', line 11779 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.
11768 11769 11770 |
# File 'lib/ovirtsdk4/services.rb', line 11768 def volume_service(id) GlusterVolumeService.new(self, id) end |