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 HTTP/1.1
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>
11555 11556 11557 |
# File 'lib/ovirtsdk4/services.rb', line 11555 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 HTTP/1.1
The order of the returned list of volumes isn’t guaranteed.
11604 11605 11606 |
# File 'lib/ovirtsdk4/services.rb', line 11604 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 |
# File 'lib/ovirtsdk4/services.rb', line 11626 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.
11615 11616 11617 |
# File 'lib/ovirtsdk4/services.rb', line 11615 def volume_service(id) GlusterVolumeService.new(self, id) end |