summaryrefslogtreecommitdiff
path: root/openstackclient/network/v2
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/network/v2')
-rw-r--r--openstackclient/network/v2/port.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
index a22bcafb..4011f5f0 100644
--- a/openstackclient/network/v2/port.py
+++ b/openstackclient/network/v2/port.py
@@ -516,6 +516,10 @@ class ListPort(command.Lister):
"network:dhcp).")
)
parser.add_argument(
+ '--host',
+ metavar='<host-id>',
+ help=_("List only ports bound to this host ID"))
+ parser.add_argument(
'--network',
metavar='<network>',
help=_("List only ports connected to this network (name or ID)"))
@@ -603,6 +607,8 @@ class ListPort(command.Lister):
server = utils.find_resource(compute_client.servers,
parsed_args.server)
filters['device_id'] = server.id
+ if parsed_args.host:
+ filters['binding:host_id'] = parsed_args.host
if parsed_args.network:
network = network_client.find_network(parsed_args.network,
ignore_missing=False)