class OvirtSDK4::GlusterBricksService

Constants

ACTIVATE
ADD
LIST
MIGRATE
REMOVE
STOP_MIGRATE

Public Instance Methods

activate(opts = {}) click to toggle source

Activate the bricks post data migration of remove brick operation.

Used to activate brick(s) once the data migration from bricks is complete but user no longer wishes to remove bricks. The bricks that were previously marked for removal will now be used as normal bricks.

For example, to retain the bricks that on glustervolume `123` from which data was migrated, send a request like this:

source

POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/activate


With a request body like this:

source,xml

<action>

<bricks>
  <brick>
    <name>host1:/rhgs/brick1</name>
  </brick>
</bricks>

</action>


@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the activation should be performed asynchronously.

@option opts [Array<GlusterBrick>] :bricks The list of bricks that need to be re-activated.

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

# File lib/ovirtsdk4/services.rb, line 11101
def activate(opts = {})
  internal_action(:activate, nil, ACTIVATE, opts)
end
add(bricks, opts = {}) click to toggle source

Adds a list of bricks to gluster volume.

Used to expand a gluster volume by adding bricks. For replicated volume types, the parameter `replica_count` needs to be passed. In case the replica count is being increased, then the number of bricks needs to be equivalent to the number of replica sets.

For example, to add bricks to gluster volume `123`, send a request like this:

source

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


With a request body like this:

source,xml

<bricks>

<brick>
  <server_id>111</server_id>
  <brick_dir>/export/data/brick3</brick_dir>
</brick>

</bricks>


@param bricks [Array<GlusterBrick>] The list of bricks to be added to the volume

@param opts [Hash] Additional options.

@option opts [Integer] :replica_count Replica count of volume post add operation.

@option opts [Integer] :stripe_count Stripe count of volume post add operation.

@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<GlusterBrick>]

# File lib/ovirtsdk4/services.rb, line 11157
def add(bricks, opts = {})
  internal_add(bricks, List, ADD, opts)
end
brick_service(id) click to toggle source

Returns a reference to the service managing a single gluster brick.

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

@return [GlusterBrickService] A reference to the `brick` service.

# File lib/ovirtsdk4/services.rb, line 11389
def brick_service(id)
  GlusterBrickService.new(self, id)
end
list(opts = {}) click to toggle source

Lists the bricks of a gluster volume.

For example, to list bricks of gluster volume `123`, send a request like this:

source

GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks


Provides an output as below:

source,xml

<bricks>

<brick id="234">
  <name>host1:/rhgs/data/brick1</name>
  <brick_dir>/rhgs/data/brick1</brick_dir>
  <server_id>111</server_id>
  <status>up</status>
</brick>
<brick id="233">
  <name>host2:/rhgs/data/brick1</name>
  <brick_dir>/rhgs/data/brick1</brick_dir>
  <server_id>222</server_id>
  <status>up</status>
</brick>

</bricks>


The order of the returned list is based on the brick order provided at gluster volume creation.

@param opts [Hash] Additional options.

@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 bricks to return. If not specified all the bricks are returned.

@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<GlusterBrick>]

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

Start migration of data prior to removing bricks.

Removing bricks is a two-step process, where the data on bricks to be removed, is first migrated to remaining bricks. Once migration is completed the removal of bricks is confirmed via the API xref:services-gluster_bricks-methods-remove. If at any point, the action needs to be cancelled xref:services-gluster_bricks-methods-stop_migrate has to be called.

For instance, to delete a brick from a gluster volume with id `123`, send a request:

source

POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/migrate


With a request body like this:

source,xml

<action>

<bricks>
  <brick>
    <name>host1:/rhgs/brick1</name>
  </brick>
</bricks>

</action>


The migration process can be tracked from the job id returned from the API using xref:services-job-methods-get and steps in job using xref:services-step-methods-get

@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the migration should be performed asynchronously.

@option opts [Array<GlusterBrick>] :bricks List of bricks for which data migration needs to be started.

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

# File lib/ovirtsdk4/services.rb, line 11275
def migrate(opts = {})
  internal_action(:migrate, nil, MIGRATE, opts)
end
remove(opts = {}) click to toggle source

Removes bricks from gluster volume.

The recommended way to remove bricks without data loss is to first migrate the data using xref:services-gluster_bricks-methods-stop_migrate and then removing them. If migrate was not called on bricks prior to remove, the bricks are removed without data migration which may lead to data loss.

For example, to delete the bricks from gluster volume `123`, send a request like this:

source

DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks


With a request body like this:

source,xml

<bricks>

<brick>
  <name>host:brick_directory</name>
</brick>

</bricks>


@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the remove should be performed asynchronously. @option opts [Array<GlusterBrick>] :bricks The list of bricks to be removed @option opts [Integer] :replica_count Replica count of volume post add operation. @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.

# File lib/ovirtsdk4/services.rb, line 11326
def remove(opts = {})
  internal_remove(REMOVE, 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 11400
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return brick_service(path)
  end
  return brick_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end
stop_migrate(opts = {}) click to toggle source

Stops migration of data from bricks for a remove brick operation.

To cancel data migration that was started as part of the 2-step remove brick process in case the user wishes to continue using the bricks. The bricks that were marked for removal will function as normal bricks post this operation.

For example, to stop migration of data from the bricks of gluster volume `123`, send a request like this:

source

POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/stopmigrate


With a request body like this:

source,xml

<bricks>

<brick>
  <name>host:brick_directory</name>
</brick>

</bricks>


@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the action should be performed asynchronously.

@option opts [Array<GlusterBrick>] :bricks List of bricks for which data migration needs to be stopped. This list should match the arguments passed to

xref:services-gluster_bricks-methods-migrate[migrate].

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

# File lib/ovirtsdk4/services.rb, line 11378
def stop_migrate(opts = {})
  internal_action(:stopmigrate, nil, STOP_MIGRATE, opts)
end