Class: Circus::ClownClient

Inherits:
Agents::Client show all
Defined in:
lib/circus/clown_client.rb

Instance Method Summary collapse

Methods inherited from Agents::Client

#call

Constructor Details

#initialize(connection, logger) ⇒ ClownClient

Returns a new instance of ClownClient.



5
6
7
8
9
# File 'lib/circus/clown_client.rb', line 5

def initialize(connection, logger)
  super(connection)
  
  @logger = logger
end

Instance Method Details

#configure(node, name, config_url) ⇒ Object



15
16
17
# File 'lib/circus/clown_client.rb', line 15

def configure(node, name, config_url)
  @connection.call(node, 'Clown', 'Clown', 'configure', {'name' => name, 'config_url' => config_url}, @logger)
end

#deploy(node, name, act_url, config_url = nil) ⇒ Object



11
12
13
# File 'lib/circus/clown_client.rb', line 11

def deploy(node, name, act_url, config_url = nil)
  @connection.call(node, 'Clown', 'Clown', 'deploy', {'name' => name, 'url' => act_url, 'config_url' => config_url || ''}, @logger)
end

#exec(node, name, cmd) ⇒ Object



23
24
25
# File 'lib/circus/clown_client.rb', line 23

def exec(node, name, cmd)
  @connection.call(node, 'Clown', 'Clown', 'exec', {'name' => name, 'command' => cmd}, @logger)
end

#reset(node, name) ⇒ Object



27
28
29
# File 'lib/circus/clown_client.rb', line 27

def reset(node, name)
  @connection.call(node, 'Clown', 'Clown', 'reset', {'name' => name}, @logger)
end

#undeploy(node, name) ⇒ Object



19
20
21
# File 'lib/circus/clown_client.rb', line 19

def undeploy(node, name)
  @connection.call(node, 'Clown', 'Clown', 'undeploy', {'name' => name}, @logger)
end