Skip to content

Commit 75487ed

Browse files
author
Gabriel Monroy
committed
add apps:info with info shortcut
1 parent 5f09ad8 commit 75487ed

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

client/deis.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
3131
create create a new application
3232
scale scale containers by type (web=2, worker=1)
33+
info view information about the current app
3334
open open a URL to the app in a browser
3435
logs view aggregated log info for the app
3536
run run a command in an ephemeral app container
@@ -473,6 +474,25 @@ def apps_list(self, args):
473474
else:
474475
raise ResponseError(response)
475476

477+
def apps_info(self, args):
478+
"""
479+
Print info about the current application
480+
481+
Usage: deis apps:info [--app=<app>]
482+
"""
483+
app = args.get('--app')
484+
if not app:
485+
app = self._session.app
486+
response = self._dispatch('get', "/api/apps/{}".format(app))
487+
if response.status_code == requests.codes.ok: # @UndefinedVariable
488+
print("=== {} Application".format(app))
489+
print(json.dumps(response.json(), indent=2))
490+
print()
491+
self.containers_list(args)
492+
print()
493+
else:
494+
raise ResponseError(response)
495+
476496
def apps_open(self, args):
477497
"""
478498
Open a URL to the application in a browser
@@ -1634,6 +1654,7 @@ def parse_args(cmd):
16341654
'create': 'apps:create',
16351655
'destroy': 'apps:destroy',
16361656
'ps': 'containers:list',
1657+
'info': 'apps:info',
16371658
'scale': 'containers:scale',
16381659
'converge': 'formations:converge',
16391660
'calculate': 'apps:calculate',

0 commit comments

Comments
 (0)