summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2016-09-26 11:12:07 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2016-11-28 09:35:00 +0000
commit4132392c2fd8337d18296c33f07c4a89b8a58bda (patch)
tree96b03036cdaaf32304f7e742b09a69c463fb3997 /openstackclient/network
parentf4536e708dff37edcaf79ea85c9f68206315edea (diff)
downloadpython-openstackclient-4132392c2fd8337d18296c33f07c4a89b8a58bda.tar.gz
Add QoS support to Network object.
Added "qos_policy" parameter to Network class. Change-Id: Idc00f2792eef5b1f0910084d95cf9a8e83fe818c Closes-Bug: 1627069
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/network.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py
index 37775e6c..1c06c462 100644
--- a/openstackclient/network/v2/network.py
+++ b/openstackclient/network/v2/network.py
@@ -99,6 +99,13 @@ def _get_attrs(client_manager, parsed_args):
attrs['provider:physical_network'] = parsed_args.physical_network
if parsed_args.segmentation_id:
attrs['provider:segmentation_id'] = parsed_args.segmentation_id
+ if parsed_args.qos_policy is not None:
+ network_client = client_manager.network
+ _qos_policy = network_client.find_qos_policy(parsed_args.qos_policy,
+ ignore_missing=False)
+ attrs['qos_policy_id'] = _qos_policy.id
+ if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy:
+ attrs['qos_policy_id'] = None
# Update VLAN Transparency for networks
if parsed_args.transparent_vlan:
attrs['vlan_transparent'] = True
@@ -249,6 +256,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
help=_("Do not use the network as the default external network "
"(default)")
)
+ parser.add_argument(
+ '--qos-policy',
+ metavar='<qos-policy>',
+ help=_("QoS policy to attach to this network (name or ID)")
+ )
_add_additional_network_options(parser)
return parser
@@ -572,6 +584,17 @@ class SetNetwork(command.Command):
action='store_true',
help=_("Do not use the network as the default external network")
)
+ qos_group = parser.add_mutually_exclusive_group()
+ qos_group.add_argument(
+ '--qos-policy',
+ metavar='<qos-policy>',
+ help=_("QoS policy to attach to this network (name or ID)")
+ )
+ qos_group.add_argument(
+ '--no-qos-policy',
+ action='store_true',
+ help=_("Remove the QoS policy attached to this network")
+ )
_add_additional_network_options(parser)
return parser