Class: Etcdv3::Maintenance
- Inherits:
-
Object
- Object
- Etcdv3::Maintenance
- Defined in:
- lib/etcdv3/maintenance.rb
Constant Summary collapse
- ALARM_TYPES =
Sadly these are the only alarm types supported by the api right now.
{ NONE: 0, NOSPACE: 1 }
- ALARM_ACTIONS =
{ get: 0, activate: 1, # Should only be used in testing. Not a stable feature... deactivate: 2 }
Instance Method Summary collapse
- #alarms(action, member_id, alarm = :NONE) ⇒ Object
-
#initialize(hostname, credentials, _timeout, metadata = {}) ⇒ Maintenance
constructor
A new instance of Maintenance.
- #member_status ⇒ Object
Constructor Details
#initialize(hostname, credentials, _timeout, metadata = {}) ⇒ Maintenance
Returns a new instance of Maintenance.
15 16 17 18 |
# File 'lib/etcdv3/maintenance.rb', line 15 def initialize(hostname, credentials, _timeout, = {}) @stub = Etcdserverpb::Maintenance::Stub.new(hostname, credentials) = end |
Instance Method Details
#alarms(action, member_id, alarm = :NONE) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/etcdv3/maintenance.rb', line 20 def alarms(action, member_id, alarm=:NONE) alarm = ALARM_TYPES[alarm] request = Etcdserverpb::AlarmRequest.new( action: ALARM_ACTIONS[action], memberID: member_id, alarm: action == :deactivate ? ALARM_TYPES[:NOSPACE] : alarm ) @stub.alarm(request, metadata: ) end |
#member_status ⇒ Object
30 31 32 |
# File 'lib/etcdv3/maintenance.rb', line 30 def member_status @stub.status(Etcdserverpb::StatusRequest.new, metadata: ) end |