Commit cd40143a authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Implement network info

Refs: #4563
parent 77bf75fe
......@@ -100,19 +100,43 @@ class network_list(_init_networking, _optional_json, _name_filter, _id_filter):
arguments = dict(
detail=FlagArgument('show detailed output', ('-l', '--details')),
'output results in pages (-n to set items per page, default 10)',
def _run(self):
nets = self.client.list_networks()
nets = self._filter_by_name(nets)
nets = self._filter_by_id(nets)
if not self['detail']:
nets = [dict(id=net['id'], name=net['name']) for net in nets]
kwargs = dict()
if self['more']:
kwargs['out'] = StringIO()
kwargs['title'] = ()
self._print(nets, **kwargs)
if self['more']:
def main(self):
super(self.__class__, self)._run()
class network_info(_init_networking, _optional_json):
"""Get details about a network"""
def _run(self, network_id):
net = self.client.get_network_details(network_id)
self._print(net, self.print_dict)
def main(self, network_id):
super(self.__class__, self)._run()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment