class Rancher::Api::Instance
instance usually container
Public Instance Methods
container?()
click to toggle source
# File lib/rancher/api/models/instance.rb, line 14 def container? type == 'container' end
execute(command)
click to toggle source
{
"attachStdin": true, "attachStdout": true, "command": [ "rake", "db:create", "db:schema:load", "db:seed" ], "tty": true
}
# File lib/rancher/api/models/instance.rb, line 48 def execute(command) url = actions['execute'] data = { 'attachStdin' => true, 'attachStdout' => true, 'command' => command, 'tty' => true } action = Action.post(url, data) action.run! end
logs(lines = 20)
click to toggle source
# File lib/rancher/api/models/instance.rb, line 62 def logs(lines = 20) url = actions['logs'] data = { 'follow' => false, 'lines' => lines } action = Action.post(url, data) action.run! end