summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/cli/command-objects/subnet.rst7
-rw-r--r--openstackclient/network/v2/subnet.py7
-rw-r--r--releasenotes/notes/bug-1513894-6d2f05db6e1df744.yaml6
3 files changed, 19 insertions, 1 deletions
diff --git a/doc/source/cli/command-objects/subnet.rst b/doc/source/cli/command-objects/subnet.rst
index c228dc20..0a56ccf1 100644
--- a/doc/source/cli/command-objects/subnet.rst
+++ b/doc/source/cli/command-objects/subnet.rst
@@ -18,7 +18,7 @@ Create new subnet
openstack subnet create
[--project <project> [--project-domain <project-domain>]]
- [--subnet-pool <subnet-pool> | --use-default-subnet-pool [--prefix-length <prefix-length>]]
+ [--subnet-pool <subnet-pool> | --use-default-subnet-pool [--prefix-length <prefix-length>] | --use-prefix-delegation]
[--subnet-range <subnet-range>]
[--allocation-pool start=<ip-address>,end=<ip-address>]
[--dhcp | --no-dhcp]
@@ -48,6 +48,11 @@ Create new subnet
Subnet pool from which this subnet will obtain a CIDR (name or ID)
+.. option:: --use-prefix-delegation
+
+ Use 'prefix-delegation' if IP is IPv6 format and IP would be delegated
+ externally
+
.. option:: --use-default-subnet-pool
Use default subnet pool for :option:`--ip-version`
diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py
index b96dff7f..c71358a5 100644
--- a/openstackclient/network/v2/subnet.py
+++ b/openstackclient/network/v2/subnet.py
@@ -186,6 +186,8 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
subnet_pool = client.find_subnet_pool(parsed_args.subnet_pool,
ignore_missing=False)
attrs['subnetpool_id'] = subnet_pool.id
+ if parsed_args.use_prefix_delegation:
+ attrs['subnetpool_id'] = "prefix_delegation"
if parsed_args.use_default_subnet_pool:
attrs['use_default_subnet_pool'] = True
if parsed_args.prefix_length is not None:
@@ -261,6 +263,11 @@ class CreateSubnet(command.ShowOne):
"(Name or ID)")
)
subnet_pool_group.add_argument(
+ '--use-prefix-delegation',
+ help=_("Use 'prefix-delegation' if IP is IPv6 format "
+ "and IP would be delegated externally")
+ )
+ subnet_pool_group.add_argument(
'--use-default-subnet-pool',
action='store_true',
help=_("Use default subnet pool for --ip-version")
diff --git a/releasenotes/notes/bug-1513894-6d2f05db6e1df744.yaml b/releasenotes/notes/bug-1513894-6d2f05db6e1df744.yaml
new file mode 100644
index 00000000..a7d75055
--- /dev/null
+++ b/releasenotes/notes/bug-1513894-6d2f05db6e1df744.yaml
@@ -0,0 +1,6 @@
+---
+features:
+ - |
+ Add ``--use-prefix-delegation`` option to the ``subnet create`` command to
+ specify 'Prefix Delegation' as a subnetpool when creating subnets.
+ [Bug `1513894 <https://bugs.launchpad.net/bugs/1513894>`_]