Skip to content

Commit 20253dd

Browse files
committed
add doc and logic tweak
1 parent 1bc9b4e commit 20253dd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/cli.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ def list(
148148
"""Retrieve the list of Gateways
149149
150150
:param output: how to display the output [text|table|json]
151+
:param query: jmespath (https://jmespath.org/) query
152+
153+
Example::
154+
155+
hpecp gateway list --output json --query '[0].ip'
151156
"""
152157
if output == "table":
153158
print(get_client().gateway.list().tabulate(columns=columns))
@@ -162,8 +167,9 @@ def list(
162167
else:
163168
data = get_client().gateway.list().json
164169
if query:
165-
print(jmespath.search(query, data))
166-
print(data)
170+
print(jmespath.search(str(query), data))
171+
else:
172+
print(data)
167173

168174
def delete(
169175
self, gateway_id, wait_for_delete_secs=0,

0 commit comments

Comments
 (0)