Skip to content

Commit f88e782

Browse files
author
Gabriel Monroy
committed
move logs to apps:logs and create shortcut
1 parent e6b57a0 commit f88e782

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

client/deis.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,22 @@ def apps_list(self, args):
491491
else:
492492
raise ResponseError(response)
493493

494+
def apps_logs(self, args):
495+
"""
496+
Retrieve the most recent log events
497+
498+
Usage: deis apps:logs [--app=<app>]
499+
"""
500+
app = args.get('--app')
501+
if not app:
502+
app = self._session.app
503+
response = self._dispatch('post',
504+
"/api/apps/{}/logs".format(app))
505+
if response.status_code == requests.codes.ok: # @UndefinedVariable
506+
print(response.json())
507+
else:
508+
raise ResponseError(response)
509+
494510
def auth_register(self, args):
495511
"""
496512
Register a new user with a Deis controller
@@ -1252,24 +1268,6 @@ def layers_list(self, args):
12521268
else:
12531269
raise ResponseError(response)
12541270

1255-
def logs(self, args):
1256-
"""
1257-
Retrieve the most recent log events
1258-
1259-
Usage: deis logs [--app=<app>]
1260-
"""
1261-
app = args.get('--app')
1262-
if not app:
1263-
app = self._session.app
1264-
response = self._dispatch('post',
1265-
"/api/apps/{}/logs".format(app))
1266-
if response.status_code == requests.codes.ok: # @UndefinedVariable
1267-
print(response.json())
1268-
elif response.status_code == requests.codes.not_found: # @UndefinedVariable
1269-
print(response.json())
1270-
else:
1271-
raise ResponseError(response)
1272-
12731271
def nodes(self, args):
12741272
"""
12751273
Valid commands for nodes:
@@ -1633,6 +1631,7 @@ def parse_args(cmd):
16331631
'converge': 'formations:converge',
16341632
'calculate': 'apps:calculate',
16351633
'ssh': 'nodes:ssh',
1634+
'logs': 'apps:logs',
16361635
}
16371636
if cmd == 'help':
16381637
cmd = sys.argv[-1]

0 commit comments

Comments
 (0)