Class: Legion::Extensions::Node::Transport::Messages::ClusterKillswitch

Inherits:
Transport::Message
  • Object
show all
Defined in:
lib/legion/extensions/node/transport/messages/cluster_killswitch.rb

Constant Summary collapse

ROUTING_KEY =
'settings.extensions.blocked'

Instance Method Summary collapse

Instance Method Details

#encrypt?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 25

def encrypt?
  false
end

#exchangeObject



17
18
19
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 17

def exchange
  Legion::Extensions::Node::Transport::Exchanges::ClusterControl
end

#messageObject



29
30
31
32
33
34
35
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 29

def message
  Legion::Extensions::Node::ControlAuth.sign(
    function: 'update_settings',
    settings: { extensions: { blocked: [@options[:extension]] } },
    restart:  true
  )
end

#routing_keyObject



13
14
15
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 13

def routing_key
  ROUTING_KEY
end

#typeObject



21
22
23
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 21

def type
  'task'
end

#validateObject



37
38
39
40
41
# File 'lib/legion/extensions/node/transport/messages/cluster_killswitch.rb', line 37

def validate
  raise 'extension must be a String' unless @options[:extension].is_a?(String)

  @valid = true
end