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

Implement network delete command

Refs: #4563
parent 56f5c6fc
......@@ -340,8 +340,7 @@ class _id_filter(object):
id_suff=ValueArgument(
'filter by id suffix (case insensitive)', '--id-suffix'),
id_like=ValueArgument(
'print only if id contains this (case insensitive)',
'--id-like')
'print only if id contains this (case insensitive)', '--id-like')
)
def _non_exact_id_filter(self, items):
......
......@@ -151,7 +151,6 @@ class network_create(_init_networking, _optional_json):
@errors.cyclades.connection
def _run(self, name):
# admin_state_up is not used in Cyclades
print self.client.create_network
net = self.client.create_network(
name, admin_state_up=True, shared=self['shared'])
self._print(net, self.print_dict)
......@@ -159,3 +158,18 @@ class network_create(_init_networking, _optional_json):
def main(self, name):
super(self.__class__, self)._run()
self._run(name=name)
@command(network_cmds)
class network_delete(_init_networking, _optional_output_cmd):
"""Delete a network"""
@errors.generic.all
@errors.cyclades.connection
def _run(self, network_id):
r = self.client.delete_network(network_id)
self._optional_output(r)
def main(self, network_id):
super(self.__class__, self)._run()
self._run(network_id=network_id)
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