Class: Pwnix::Api::Client::ConsoleClient
- Inherits:
-
Object
- Object
- Pwnix::Api::Client::ConsoleClient
show all
- Includes:
- HTTParty, HTTPartyTime
- Defined in:
- lib/pwnix-api-client/node/client/console_client.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#clear_errors, #errors, #has_errors?, included, #last_error, #safe_api_call
Constructor Details
Returns a new instance of ConsoleClient.
11
12
13
14
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 11
def initialize(id)
@id = id
@type = "console_client"
end
|
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
8
9
10
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 8
def id
@id
end
|
#type ⇒ Object
Returns the value of attribute type.
9
10
11
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 9
def type
@type
end
|
Instance Method Details
#config ⇒ Object
20
21
22
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 20
def config
safe_api_call("/node/clients/#{@id}/config")
end
|
#connect ⇒ Object
36
37
38
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 36
def connect
safe_api_call("/node/clients/#{@id}/connect")
end
|
#connected? ⇒ Boolean
32
33
34
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 32
def connected?
safe_api_call("/node/clients/#{@id}/connected") == true
end
|
#destroy ⇒ Object
44
45
46
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 44
def destroy
safe_api_call("/node/clients/#{@id}/destroy")
end
|
#disconnect ⇒ Object
40
41
42
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 40
def disconnect
safe_api_call("/node/clients/#{@id}/disconnect")
end
|
#get_config_value(key) ⇒ Object
24
25
26
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 24
def get_config_value(key)
safe_api_call("/node/clients/#{@id}/config/#{key}")
end
|
#set_config_value(key, value) ⇒ Object
28
29
30
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 28
def set_config_value(key,value)
safe_api_call("/node/clients/#{@id}/config/#{key}/set", :value => value)
end
|
#status ⇒ Object
16
17
18
|
# File 'lib/pwnix-api-client/node/client/console_client.rb', line 16
def status
safe_api_call("/node/clients/#{@id}/status")
end
|