diff --git a/doc/source/command-objects/network.rst b/doc/source/command-objects/network.rst index 5d9a5ca860..8075d50919 100644 --- a/doc/source/command-objects/network.rst +++ b/doc/source/command-objects/network.rst @@ -23,6 +23,7 @@ Create new network [--project [--project-domain ]] [--enable | --disable] [--share | --no-share] + [--description ] [--availability-zone-hint ] [--enable-port-security | --disable-port-security] [--external [--default | --no-default] | --internal] @@ -65,6 +66,10 @@ Create new network Do not share the network between projects +.. option:: --description + + Set network description + .. option:: --availability-zone-hint Availability Zone in which to create this network @@ -206,6 +211,7 @@ Set network properties [--name ] [--enable | --disable] [--share | --no-share] + [--description ] [--enable-port-security | --disable-port-security] [--external [--default | --no-default] | --internal] [--provider-network-type ] @@ -234,6 +240,10 @@ Set network properties Do not share the network between projects +.. option:: --description + + Set network description + .. 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 ccc02fd8e6..31b173e138 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -78,6 +78,10 @@ def _get_attrs(client_manager, parsed_args): parsed_args.availability_zone_hints is not None: attrs['availability_zone_hints'] = parsed_args.availability_zone_hints + # set description + if parsed_args.description: + attrs['description'] = parsed_args.description + # update_external_network_options if parsed_args.internal: attrs['router:external'] = False @@ -191,6 +195,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne): metavar='', help=_("Owner's project (name or ID)") ) + parser.add_argument( + '--description', + metavar='', + help=_("Set network description") + ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( '--availability-zone-hint', @@ -420,6 +429,11 @@ class SetNetwork(command.Command): action='store_true', help=_("Do not share the network between projects") ) + parser.add_argument( + '--description', + metavar="