summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/subnet_pool.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/openstackclient/network/v2/subnet_pool.py b/openstackclient/network/v2/subnet_pool.py
index 19cd46c9..44f30207 100644
--- a/openstackclient/network/v2/subnet_pool.py
+++ b/openstackclient/network/v2/subnet_pool.py
@@ -77,6 +77,29 @@ def _add_prefix_options(parser):
)
+class CreateSubnetPool(command.ShowOne):
+ """Create subnet pool"""
+
+ def get_parser(self, prog_name):
+ parser = super(CreateSubnetPool, self).get_parser(prog_name)
+ parser.add_argument(
+ 'name',
+ metavar="<name>",
+ help='Name of the new subnet pool'
+ )
+ _add_prefix_options(parser)
+
+ return parser
+
+ def take_action(self, parsed_args):
+ client = self.app.client_manager.network
+ attrs = _get_attrs(parsed_args)
+ obj = client.create_subnet_pool(**attrs)
+ columns = _get_columns(obj)
+ data = utils.get_item_properties(obj, columns, formatters=_formatters)
+ return (columns, data)
+
+
class DeleteSubnetPool(command.Command):
"""Delete subnet pool"""