class OvirtSDK4::GlusterVolumesService

Constants

ADD
LIST

Public Instance Methods

add(volume, opts = {}) click to toggle source

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:

source

POST /ovirt-engine/api/clusters/123/glustervolumes


With the following request body:

source,xml

<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>


@param volume [GlusterVolume] The gluster volume definition from which to create the volume is passed as input and the newly created

volume is returned.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [GlusterVolume]

# File lib/ovirtsdk4/services.rb, line 11707
def add(volume, opts = {})
  internal_add(volume, GlusterVolume, ADD, opts)
end
list(opts = {}) click to toggle source

Lists all gluster volumes in the cluster.

For example, to list all Gluster Volumes in cluster `456`, send a request like this:

source

GET /ovirt-engine/api/clusters/456/glustervolumes


The order of the returned list of volumes isn't guaranteed.

@param opts [Hash] Additional options.

@option opts [Boolean] :case_sensitive Indicates if the search performed using the `search` parameter should be performed taking case into

account. The default value is `true`, which means that case is taken into account. If you want to search
ignoring case set it to `false`.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Integer] :max Sets the maximum number of volumes to return. If not specified all the volumes are returned.

@option opts [String] :search A query string used to restrict the returned volumes.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Array<GlusterVolume>]

# File lib/ovirtsdk4/services.rb, line 11757
def list(opts = {})
  internal_get(LIST, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# 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) click to toggle source

Reference to a service managing gluster volume.

@param id [String] The identifier of the `volume`.

@return [GlusterVolumeService] A reference to the `volume` service.

# File lib/ovirtsdk4/services.rb, line 11768
def volume_service(id)
  GlusterVolumeService.new(self, id)
end