diff --git a/haas/cli.py b/haas/cli.py index a5e995fa..98c3b141 100644 --- a/haas/cli.py +++ b/haas/cli.py @@ -491,10 +491,21 @@ def port_detach_nic(switch, port): url = object_url('switch', switch, 'port', port, 'detach_nic') do_post(url) +@cmd +def list_network_attachments(network, project): + """List nodes connected to a network + may be either "all" or a specific project name. + """ + url = object_url('network', network, 'attachments') + + if project == "all": + do_get(url) + else: + do_get(url, data={'project':project}) + @cmd def list_nodes(is_free): """List all nodes or all free nodes - may be either "all" or "free", and determines whether to list all nodes or all free nodes. """