Class: Cephdetail::Health
- Inherits:
-
Object
- Object
- Cephdetail::Health
- Defined in:
- lib/cephdetail.rb
Overview
The Health class exposes health data from the /detail endpoint of the Ceph REST API.
Example:
>> health = Cephdetail::Health.new
>> df = health.df
>> status = health.status
>> cluster_health = health.cluster_health
>> osdstat = health.osdstat
>> osdperf = health.osdperf
>> pgstat = health.pgstat
Instance Method Summary collapse
-
#cluster_health ⇒ Object
Return /health?detail data (ceph health detail) in the form of a Ruby Hash for manipulation by other code/applications.
-
#df ⇒ Object
Return disk usage stats (ceph df) in the form of a Ruby Hash for manipulation by other code/applications.
-
#initialize ⇒ Health
constructor
Fetch the URL for the Ceph REST API server in your environment.
-
#osdperf ⇒ Object
Return /osd/perf data (ceph osd perf) in the form of a Ruby Hash for manipulation by other code/applications.
-
#osdstat ⇒ Object
Return /osd/stat data (ceph osd stat) in the form of a Ruby Hash for manipulation by other code/applications.
-
#pgstat ⇒ Object
Return /pg/stat data (ceph pg stat) in the form of a Ruby Hash for manipulation by other code/applications.
-
#status ⇒ Object
Return /status data (ceph -s) in the form of a Ruby Hash for manipulation by other code/applications.
Constructor Details
#initialize ⇒ Health
Fetch the URL for the Ceph REST API server in your environment
30 31 32 |
# File 'lib/cephdetail.rb', line 30 def initialize @api_url = ENV['CEPH_REST_API'] end |
Instance Method Details
#cluster_health ⇒ Object
Return /health?detail data (ceph health detail) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request.
50 51 52 |
# File 'lib/cephdetail.rb', line 50 def cluster_health return check("health?detail") end |
#df ⇒ Object
Return disk usage stats (ceph df) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request.
38 39 40 |
# File 'lib/cephdetail.rb', line 38 def df return check("df") end |
#osdperf ⇒ Object
Return /osd/perf data (ceph osd perf) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request
62 63 64 |
# File 'lib/cephdetail.rb', line 62 def osdperf return check("osd/perf") end |
#osdstat ⇒ Object
Return /osd/stat data (ceph osd stat) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request.
56 57 58 |
# File 'lib/cephdetail.rb', line 56 def osdstat return check("osd/stat") end |
#pgstat ⇒ Object
Return /pg/stat data (ceph pg stat) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request. WARNING: On large clusters, the result set will be massive!!!
69 70 71 |
# File 'lib/cephdetail.rb', line 69 def pgstat return check("pg/stat") end |
#status ⇒ Object
Return /status data (ceph -s) in the form of a Ruby Hash for manipulation by other code/applications. Uses the private check(attrib) method to make the HTTP request.
44 45 46 |
# File 'lib/cephdetail.rb', line 44 def status return check("status") end |