Allow to specify ps_args when listing processes

Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
This commit is contained in:
Pierre Fersing 2015-09-25 16:45:37 +02:00
parent 26e22bbd39
commit 2d4a71df2e
2 changed files with 6 additions and 2 deletions

View File

@ -325,9 +325,12 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
@utils.check_resource
def top(self, container):
def top(self, container, ps_args=None):
u = self._url("/containers/{0}/top", container)
return self._result(self._get(u), True)
params = {}
if ps_args is not None:
params['ps_args'] = ps_args
return self._result(self._get(u, params=params), True)
@utils.check_resource
def unpause(self, container):

View File

@ -878,6 +878,7 @@ Display the running processes of a container.
**Params**:
* container (str): The container to inspect
* ps_args (str): An optional arguments passed to ps (e.g., aux)
**Returns** (str): The output of the top