summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorreedip <reedip.banerjee@nectechnologies.in>2016-04-04 11:17:29 +0900
committerReedip <reedip.banerjee@nectechnologies.in>2016-04-06 16:52:47 +0000
commit1b351e16956563916cdf4f27071653e4b69569c2 (patch)
tree24514b1ea950aaf8832cfb5a38051eff3a4a0176 /openstackclient/network
parent107bc5164f99ef956d952273235648c7f8f26764 (diff)
downloadpython-openstackclient-1b351e16956563916cdf4f27071653e4b69569c2.tar.gz
Add provider network options to osc network create
The following patch adds the provider network options to OSC "network create". Change-Id: Ib8449c00ee4b4285889588f03ddd7a686ce8f987 Partial-Bug: #1545537
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/network.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py
index 6fd18efb..d3b20c0f 100644
--- a/openstackclient/network/v2/network.py
+++ b/openstackclient/network/v2/network.py
@@ -165,6 +165,26 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
action='store_true',
help='Do not use the network as the default external network.'
'By default, no network is set as an external network.')
+ parser.add_argument(
+ '--provider-network-type',
+ metavar='<provider-network-type>',
+ choices=['flat', 'gre', 'local',
+ 'vlan', 'vxlan'],
+ help='The physical mechanism by which the virtual network '
+ 'is implemented. The supported options are: '
+ 'flat, gre, local, vlan, vxlan')
+ parser.add_argument(
+ '--provider-physical-network',
+ metavar='<provider-physical-network>',
+ dest='physical_network',
+ help='Name of the physical network over which the virtual '
+ 'network is implemented')
+ parser.add_argument(
+ '--provider-segmentation-id',
+ metavar='<provider-segmentation-id>',
+ dest='segmentation_id',
+ help='VLAN ID for VLAN networks or tunnel-id for GRE/VXLAN '
+ 'networks')
return parser
def update_parser_compute(self, parser):
@@ -185,6 +205,12 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
attrs['is_default'] = False
if parsed_args.default:
attrs['is_default'] = True
+ if parsed_args.provider_network_type:
+ attrs['provider:network_type'] = parsed_args.provider_network_type
+ if parsed_args.physical_network:
+ attrs['provider:physical_network'] = parsed_args.physical_network
+ if parsed_args.segmentation_id:
+ attrs['provider:segmentation_id'] = parsed_args.segmentation_id
obj = client.create_network(**attrs)
columns = _get_columns(obj)
data = utils.get_item_properties(obj, columns, formatters=_formatters)