Class: Pwnix::Api::Client::Node
- Inherits:
-
Object
- Object
- Pwnix::Api::Client::Node
show all
- Includes:
- HTTParty, HTTPartyTime
- Defined in:
- lib/pwnix-api-client/node.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#clear_errors, #errors, #has_errors?, included, #last_error, #safe_api_call
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
Instance Attribute Details
#api_config ⇒ Object
Returns the value of attribute api_config.
13
14
15
|
# File 'lib/pwnix-api-client/node.rb', line 13
def api_config
@api_config
end
|
#client_manager ⇒ Object
Returns the value of attribute client_manager.
13
14
15
|
# File 'lib/pwnix-api-client/node.rb', line 13
def client_manager
@client_manager
end
|
Instance Method Details
#clear ⇒ Object
57
58
59
|
# File 'lib/pwnix-api-client/node.rb', line 57
def clear
safe_api_call("/node/clear")
end
|
#connected? ⇒ Boolean
20
21
22
|
# File 'lib/pwnix-api-client/node.rb', line 20
def connected?
return true if safe_api_call("/node/check") == "ok"
end
|
#cookbooks ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/pwnix-api-client/node.rb', line 24
def cookbooks
cookbook_list = safe_api_call("/node/cookbook/list")
cookbooks = []
cookbook_list.each do |cookbook_name|
cookbooks << Cookbook.new(cookbook_name)
end
cookbooks
end
|
#last_commit(product) ⇒ Object
45
46
47
|
# File 'lib/pwnix-api-client/node.rb', line 45
def last_commit(product)
safe_api_call("/node/last_commit", { :product => product } )
end
|
#release ⇒ Object
41
42
43
|
# File 'lib/pwnix-api-client/node.rb', line 41
def release
safe_api_call("/node/release")
end
|
#restart ⇒ Object
61
62
63
|
# File 'lib/pwnix-api-client/node.rb', line 61
def restart
safe_api_call("/node/restart")
end
|
#status ⇒ Object
33
34
35
|
# File 'lib/pwnix-api-client/node.rb', line 33
def status
safe_api_call("/node/status")
end
|
#update ⇒ Object
49
50
51
|
# File 'lib/pwnix-api-client/node.rb', line 49
def update
safe_api_call("/node/update", { :options => {:timeout => 600} } )
end
|
#updating? ⇒ Boolean
53
54
55
|
# File 'lib/pwnix-api-client/node.rb', line 53
def updating?
safe_api_call("/node/updating")
end
|
#version ⇒ Object
37
38
39
|
# File 'lib/pwnix-api-client/node.rb', line 37
def version
safe_api_call("/node/version")
end
|