Class: OvirtSDK4::GlusterBrickService
- Inherits:
-
MeasurableService
- Object
- Service
- MeasurableService
- OvirtSDK4::GlusterBrickService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ GlusterBrick
Get details of a brick.
-
#remove(opts = {}) ⇒ Object
Removes a brick.
-
#replace(opts = {}) ⇒ Object
Replaces this brick with a new one.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#statistics_service ⇒ StatisticsService
Locates the
statistics
service.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ GlusterBrick
Get details of a brick.
Retrieves status details of brick from underlying gluster volume with header All-Content
set to true
. This is
the equivalent of running gluster volume status <volumename> <brickname> detail
.
For example, to get the details of brick 234
of gluster volume 123
, send a request like this:
GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234
Which will return a response body like this:
<brick id="234">
<name>host1:/rhgs/data/brick1</name>
<brick_dir>/rhgs/data/brick1</brick_dir>
<server_id>111</server_id>
<status>up</status>
<device>/dev/mapper/RHGS_vg1-lv_vmaddldisks</device>
<fs_name>xfs</fs_name>
<gluster_clients>
<gluster_client>
<bytes_read>2818417648</bytes_read>
<bytes_written>1384694844</bytes_written>
<client_port>1011</client_port>
<host_name>client2</host_name>
</gluster_client>
</gluster_clients>
<memory_pools>
<memory_pool>
<name>data-server:fd_t</name>
<alloc_count>1626348</alloc_count>
<cold_count>1020</cold_count>
<hot_count>4</hot_count>
<max_alloc>23</max_alloc>
<max_stdalloc>0</max_stdalloc>
<padded_size>140</padded_size>
<pool_misses>0</pool_misses>
</memory_pool>
</memory_pools>
<mnt_options>rw,seclabel,noatime,nodiratime,attr2,inode64,sunit=512,swidth=2048,noquota</mnt_options>
<pid>25589</pid>
<port>49155</port>
</brick>
34468 34469 34470 |
# File 'lib/ovirtsdk4/services.rb', line 34468 def get(opts = {}) internal_get(GET, opts) end |
#remove(opts = {}) ⇒ Object
Removes a brick.
Removes a brick from the underlying gluster volume and deletes entries from database. This can be used only when removing a single brick without data migration. To remove multiple bricks and with data migration, use migrate instead.
For example, to delete brick 234
from gluster volume 123
, send a request like this:
DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234
34504 34505 34506 |
# File 'lib/ovirtsdk4/services.rb', line 34504 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#replace(opts = {}) ⇒ Object
Replaces this brick with a new one.
Important
|
This operation has been deprecated since version 3.5 of the engine and will be removed in the future. Use add brick(s) and migrate brick(s) instead. |
34537 34538 34539 |
# File 'lib/ovirtsdk4/services.rb', line 34537 def replace(opts = {}) internal_action(:replace, nil, REPLACE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
34557 34558 34559 34560 34561 34562 34563 34564 34565 34566 34567 34568 |
# File 'lib/ovirtsdk4/services.rb', line 34557 def service(path) if path.nil? || path == '' return self 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 |
#statistics_service ⇒ StatisticsService
Locates the statistics
service.
34546 34547 34548 |
# File 'lib/ovirtsdk4/services.rb', line 34546 def statistics_service @statistics_service ||= StatisticsService.new(self, 'statistics') end |