class Etcdv3::Maintenance

Constants

ALARM_ACTIONS
ALARM_TYPES

Sadly these are the only alarm types supported by the api right now.

Public Class Methods

new(hostname, credentials, _timeout, metadata = {}) click to toggle source
# File lib/etcdv3/maintenance.rb, line 15
def initialize(hostname, credentials, _timeout, metadata = {})
  @stub = Etcdserverpb::Maintenance::Stub.new(hostname, credentials)
  @metadata = metadata
end

Public Instance Methods

alarms(action, member_id, alarm=:NONE) click to toggle source
# 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: @metadata)
end
member_status() click to toggle source
# File lib/etcdv3/maintenance.rb, line 30
def member_status
  @stub.status(Etcdserverpb::StatusRequest.new, metadata: @metadata)
end