Sha256: e7a01a06a2b51500b1e3bbe3c7d806dda71d5d98a4e63f18bc24cc1f5bb68441
Contents?: true
Size: 895 Bytes
Versions: 1
Compression:
Stored size: 895 Bytes
Contents
class Etcdv3 class Maintenance # Sadly these are the only alarm types supported by the api right now. ALARM_TYPES = { NONE: 0, NOSPACE: 1 } ALARM_ACTIONS = { get: 0, activate: 1, # Should only be used in testing. Not a stable feature... deactivate: 2 } def initialize(hostname, credentials, metadata = {}) @stub = Etcdserverpb::Maintenance::Stub.new(hostname, credentials) @metadata = metadata end def member_status @stub.status(Etcdserverpb::StatusRequest.new, metadata: @metadata) end 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) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
etcdv3-0.4.0 | lib/etcdv3/maintenance.rb |