Class: OvirtSDK4::GlusterVolumeService

Inherits:
MeasurableService show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#get(opts = {}) ⇒ GlusterVolume

Get the gluster volume details.

For example, to get details of a gluster volume with identifier 123 in cluster 456, send a request like this:

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

This GET request will return the following output:

<gluster_volume id="123">
 <name>data</name>
 <link href="/ovirt-engine/api/clusters/456/glustervolumes/123/glusterbricks" rel="glusterbricks"/>
 <disperse_count>0</disperse_count>
 <options>
   <option>
     <name>storage.owner-gid</name>
     <value>36</value>
   </option>
   <option>
     <name>performance.io-cache</name>
     <value>off</value>
   </option>
   <option>
     <name>cluster.data-self-heal-algorithm</name>
     <value>full</value>
   </option>
 </options>
 <redundancy_count>0</redundancy_count>
 <replica_count>3</replica_count>
 <status>up</status>
 <stripe_count>0</stripe_count>
 <transport_types>
   <transport_type>tcp</transport_type>
 </transport_types>
 <volume_type>replicate</volume_type>
 </gluster_volume>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



34882
34883
34884
# File 'lib/ovirtsdk4/services.rb', line 34882

def get(opts = {})
  internal_get(GET, opts)
end

#get_profile_statistics(opts = {}) ⇒ Object

Get gluster volume profile statistics.

For example, to get profile statistics for a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :details (GlusterVolumeProfileDetails)

    Gluster volume profiling information returned from the action.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



34915
34916
34917
# File 'lib/ovirtsdk4/services.rb', line 34915

def get_profile_statistics(opts = {})
  internal_action(:getprofilestatistics, :details, GET_PROFILE_STATISTICS, opts)
end

#gluster_bricks_serviceGlusterBricksService

Reference to a service managing gluster bricks.

Returns:



35308
35309
35310
# File 'lib/ovirtsdk4/services.rb', line 35308

def gluster_bricks_service
  @gluster_bricks_service ||= GlusterBricksService.new(self, 'glusterbricks')
end

#rebalance(opts = {}) ⇒ Object

Rebalance the gluster volume.

Rebalancing a gluster volume helps to distribute the data evenly across all the bricks. After expanding or shrinking a gluster volume (without migrating data), we need to rebalance the data among the bricks. In a non-replicated volume, all bricks should be online to perform the rebalance operation. In a replicated volume, at least one of the bricks in the replica should be online.

For example, to rebalance a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the rebalance should be performed asynchronously.

  • :fix_layout (Boolean)

    If set to true, rebalance will only fix the layout so that new data added to the volume is distributed across all the hosts. But it will not migrate/rebalance the existing data. Default is false.

  • :force (Boolean)

    Indicates if the rebalance should be force started. The rebalance command can be executed with the force option even when the older clients are connected to the cluster. However, this could lead to a data loss situation. Default is false.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



34962
34963
34964
# File 'lib/ovirtsdk4/services.rb', line 34962

def rebalance(opts = {})
  internal_action(:rebalance, nil, REBALANCE, opts)
end

#remove(opts = {}) ⇒ Object

Removes the gluster volume.

For example, to remove a volume with identifier 123 in cluster 456, send a request like this:

DELETE /ovirt-engine/api/clusters/456/glustervolumes/123

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



34994
34995
34996
# File 'lib/ovirtsdk4/services.rb', line 34994

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#reset_all_options(opts = {}) ⇒ Object

Resets all the options set in the gluster volume.

For example, to reset all options in a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the reset should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35028
35029
35030
# File 'lib/ovirtsdk4/services.rb', line 35028

def reset_all_options(opts = {})
  internal_action(:resetalloptions, nil, RESET_ALL_OPTIONS, opts)
end

#reset_option(opts = {}) ⇒ Object

Resets a particular option in the gluster volume.

For example, to reset a particular option option1 in a gluster volume with identifier 123 in cluster 456, send a request like this:

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

With the following request body:

<action>
 <option name="option1"/>
</action>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the reset should be performed asynchronously.

  • :force (Boolean)
  • :option (Option)

    Option to reset.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35077
35078
35079
# File 'lib/ovirtsdk4/services.rb', line 35077

def reset_option(opts = {})
  internal_action(:resetoption, nil, RESET_OPTION, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
# File 'lib/ovirtsdk4/services.rb', line 35328

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'glusterbricks'
    return gluster_bricks_service
  end
  if path.start_with?('glusterbricks/')
    return gluster_bricks_service.service(path[14..-1])
  end
  if path == 'statistics'
    return statistics_service
  end
  if path.start_with?('statistics/')
    return statistics_service.service(path[11..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#set_option(opts = {}) ⇒ Object

Sets a particular option in the gluster volume.

For example, to set option1 with value value1 in a gluster volume with identifier 123 in cluster 456, send a request like this:

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

With the following request body:

<action>
 <option name="option1" value="value1"/>
</action>

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :option (Option)

    Option to set.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35123
35124
35125
# File 'lib/ovirtsdk4/services.rb', line 35123

def set_option(opts = {})
  internal_action(:setoption, nil, SET_OPTION, opts)
end

#start(opts = {}) ⇒ Object

Starts the gluster volume.

A Gluster Volume should be started to read/write data. For example, to start a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :force (Boolean)

    Indicates if the volume should be force started. If a gluster volume is started already but few/all bricks are down then force start can be used to bring all the bricks up. Default is false.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35161
35162
35163
# File 'lib/ovirtsdk4/services.rb', line 35161

def start(opts = {})
  internal_action(:start, nil, START, opts)
end

#start_profile(opts = {}) ⇒ Object

Start profiling the gluster volume.

For example, to start profiling a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35194
35195
35196
# File 'lib/ovirtsdk4/services.rb', line 35194

def start_profile(opts = {})
  internal_action(:startprofile, nil, START_PROFILE, opts)
end

#statistics_serviceStatisticsService

Locates the statistics service.

Returns:



35317
35318
35319
# File 'lib/ovirtsdk4/services.rb', line 35317

def statistics_service
  @statistics_service ||= StatisticsService.new(self, 'statistics')
end

#stop(opts = {}) ⇒ Object

Stops the gluster volume.

Stopping a volume will make its data inaccessible.

For example, to stop a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :force (Boolean)
  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35232
35233
35234
# File 'lib/ovirtsdk4/services.rb', line 35232

def stop(opts = {})
  internal_action(:stop, nil, STOP, opts)
end

#stop_profile(opts = {}) ⇒ Object

Stop profiling the gluster volume.

For example, to stop profiling a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35265
35266
35267
# File 'lib/ovirtsdk4/services.rb', line 35265

def stop_profile(opts = {})
  internal_action(:stopprofile, nil, STOP_PROFILE, opts)
end

#stop_rebalance(opts = {}) ⇒ Object

Stop rebalancing the gluster volume.

For example, to stop rebalancing a gluster volume with identifier 123 in cluster 456, send a request like this:

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

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the action should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.



35299
35300
35301
# File 'lib/ovirtsdk4/services.rb', line 35299

def stop_rebalance(opts = {})
  internal_action(:stoprebalance, nil, STOP_REBALANCE, opts)
end