Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
move logs to apps:logs and create shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Monroy committed Sep 17, 2013
1 parent e6b57a0 commit f88e782
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions client/deis.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,22 @@ def apps_list(self, args):
else:
raise ResponseError(response)

def apps_logs(self, args):
"""
Retrieve the most recent log events
Usage: deis apps:logs [--app=<app>]
"""
app = args.get('--app')
if not app:
app = self._session.app
response = self._dispatch('post',
"/api/apps/{}/logs".format(app))
if response.status_code == requests.codes.ok: # @UndefinedVariable
print(response.json())
else:
raise ResponseError(response)

def auth_register(self, args):
"""
Register a new user with a Deis controller
Expand Down Expand Up @@ -1252,24 +1268,6 @@ def layers_list(self, args):
else:
raise ResponseError(response)

def logs(self, args):
"""
Retrieve the most recent log events
Usage: deis logs [--app=<app>]
"""
app = args.get('--app')
if not app:
app = self._session.app
response = self._dispatch('post',
"/api/apps/{}/logs".format(app))
if response.status_code == requests.codes.ok: # @UndefinedVariable
print(response.json())
elif response.status_code == requests.codes.not_found: # @UndefinedVariable
print(response.json())
else:
raise ResponseError(response)

def nodes(self, args):
"""
Valid commands for nodes:
Expand Down Expand Up @@ -1633,6 +1631,7 @@ def parse_args(cmd):
'converge': 'formations:converge',
'calculate': 'apps:calculate',
'ssh': 'nodes:ssh',
'logs': 'apps:logs',
}
if cmd == 'help':
cmd = sys.argv[-1]
Expand Down

0 comments on commit f88e782

Please sign in to comment.