diff --git a/doc/source/cli/command-objects/network.rst b/doc/source/cli/command-objects/network.rst index 5f20dc3884..220fbf32b5 100644 --- a/doc/source/cli/command-objects/network.rst +++ b/doc/source/cli/command-objects/network.rst @@ -24,6 +24,7 @@ Create new network [--enable | --disable] [--share | --no-share] [--description ] + [--mtu ] [--availability-zone-hint ] [--enable-port-security | --disable-port-security] [--external [--default | --no-default] | --internal] @@ -74,6 +75,12 @@ Create new network *Network version 2 only* +.. option:: --mtu + + Set network mtu + + *Network version 2 only* + .. option:: --availability-zone-hint Availability Zone in which to create this network @@ -353,6 +360,7 @@ Set network properties [--enable | --disable] [--share | --no-share] [--description ] + [--mtu ] [--enable-port-security | --disable-port-security] [--external [--default | --no-default] | --internal] [--provider-network-type ] @@ -386,6 +394,10 @@ Set network properties Set network description +.. option:: --mtu + + Set network mtu + .. option:: --enable-port-security Enable port security by default for ports created on diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 4c1725c5f6..d1c7f005d3 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -107,6 +107,10 @@ def _get_attrs_network(client_manager, parsed_args): if parsed_args.description: attrs['description'] = parsed_args.description + # set mtu + if parsed_args.mtu: + attrs['mtu'] = parsed_args.mtu + # update_external_network_options if parsed_args.internal: attrs['router:external'] = False @@ -217,6 +221,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne): metavar='', help=_("Set network description") ) + parser.add_argument( + '--mtu', + metavar='', + help=_("Set network mtu") + ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--availability-zone-hint', @@ -619,6 +628,11 @@ class SetNetwork(command.Command): metavar="