From 57e5840710c3b2b74d31bfd6a0da739e0fc747ed Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 29 Apr 2017 00:32:32 +0000 Subject: Network tag support Neutron tag mechanism now supports network, subnet, port, subnetpool and router. Tag support for more resources is planned. This commit introduces a common mixin class to implement tag operation and individual resource consumes it. To support tag remove, network unset command is added. Implements blueprint neutron-client-tag Change-Id: Iad59d052f46896d27d73c22d6d4bb3df889f2352 --- doc/source/cli/command-objects/network.rst | 79 ++++++++++++++++++++++++++ doc/source/cli/command-objects/port.rst | 47 +++++++++++++++ doc/source/cli/command-objects/router.rst | 47 +++++++++++++++ doc/source/cli/command-objects/subnet-pool.rst | 47 +++++++++++++++ doc/source/cli/command-objects/subnet.rst | 47 +++++++++++++++ 5 files changed, 267 insertions(+) (limited to 'doc/source/cli/command-objects') diff --git a/doc/source/cli/command-objects/network.rst b/doc/source/cli/command-objects/network.rst index ed9fd13d..5f20dc38 100644 --- a/doc/source/cli/command-objects/network.rst +++ b/doc/source/cli/command-objects/network.rst @@ -32,6 +32,7 @@ Create new network [--provider-segment ] [--qos-policy ] [--transparent-vlan | --no-transparent-vlan] + [--tag | --no-tag] .. option:: --project @@ -165,6 +166,18 @@ Create new network *Network version 2 only* +.. option:: --tag + + Tag to be added to the network (repeat option to set multiple tags) + + *Network version 2 only* + +.. option:: --no-tag + + No tags associated with the network + + *Network version 2 only* + .. _network_create-name: .. describe:: @@ -206,6 +219,8 @@ List networks [--provider-physical-network ] [--provider-segment ] [--agent ] + [--tags [,,...]] [--any-tags [,,...]] + [--not-tags [,,...]] [--not-any-tags [,,...]] .. option:: --external @@ -297,6 +312,32 @@ List networks List networks hosted by agent (ID only) + *Network version 2 only* + +.. option:: --tags [,,...] + + List networks which have all given tag(s) + + *Network version 2 only* + +.. option:: --any-tags [,,...] + + List networks which have any given tag(s) + + *Network version 2 only* + +.. option:: --not-tags [,,...] + + Exclude networks which have all given tag(s) + + *Network version 2 only* + +.. option:: --not-any-tags [,,...] + + Exclude networks which have any given tag(s) + + *Network version 2 only* + network set ----------- @@ -318,6 +359,7 @@ Set network properties [--provider-physical-network ] [--provider-segment ] [--qos-policy | --no-qos-policy] + [--tag ] [--no-tag] .. option:: --name @@ -392,6 +434,15 @@ Set network properties Remove the QoS policy attached to this network +.. option:: --tag + + Tag to be added to the network (repeat option to set multiple tags) + +.. option:: --no-tag + + Clear tags associated with the network. Specify both --tag + and --no-tag to overwrite current tags + .. _network_set-network: .. describe:: @@ -412,3 +463,31 @@ Display network details .. describe:: Network to display (name or ID) + +network unset +------------- + +Unset network properties + +*Network version 2 only* + +.. program:: network unset +.. code:: bash + + openstack network unset + [--tag | --all-tag] + + +.. option:: --tag + + Tag to be removed from the network + (repeat option to remove multiple tags) + +.. option:: --all-tag + + Clear all tags associated with the network + +.. _network_unset-network: +.. describe:: + + Network to modify (name or ID) diff --git a/doc/source/cli/command-objects/port.rst b/doc/source/cli/command-objects/port.rst index 37814a95..c2da09b3 100644 --- a/doc/source/cli/command-objects/port.rst +++ b/doc/source/cli/command-objects/port.rst @@ -33,6 +33,7 @@ Create new port [--qos-policy ] [--project [--project-domain ]] [--enable-port-security | --disable-port-security] + [--tag | --no-tag] .. option:: --network @@ -126,6 +127,14 @@ Create new port Disable port security for this port +.. option:: --tag + + Tag to be added to the port (repeat option to set multiple tags) + +.. option:: --no-tag + + No tags associated with the port + .. _port_create-name: .. describe:: @@ -163,6 +172,8 @@ List ports [--fixed-ip subnet=,ip-address=] [--long] [--project [--project-domain ]] + [--tags [,,...]] [--any-tags [,,...]] + [--not-tags [,,...]] [--not-any-tags [,,...]] .. option:: --device-owner @@ -204,6 +215,22 @@ List ports Domain the project belongs to (name or ID). This can be used in case collisions between project names exist. +.. option:: --tags [,,...] + + List ports which have all given tag(s) + +.. option:: --any-tags [,,...] + + List ports which have any given tag(s) + +.. option:: --not-tags [,,...] + + Exclude ports which have all given tag(s) + +.. option:: --not-any-tags [,,...] + + Exclude ports which have any given tag(s) + port set -------- @@ -233,6 +260,7 @@ Set port properties [--allowed-address ip-address=[,mac-address=]] [--no-allowed-address] [--data-plane-status ] + [--tag ] [--no-tag] .. option:: --description @@ -342,6 +370,15 @@ Set port properties Unset it to None with the 'port unset' command (requires data plane status extension) +.. option:: --tag + + Tag to be added to the port (repeat option to set multiple tags) + +.. option:: --no-tag + + Clear tags associated with the port. Specify both --tag + and --no-tag to overwrite current tags + .. _port_set-port: .. describe:: @@ -378,6 +415,7 @@ Unset port properties [--allowed-address ip-address=[,mac-address=] [...]] [--qos-policy] [--data-plane-status] + [--tag | --all-tag] .. option:: --fixed-ip subnet=,ip-address= @@ -410,6 +448,15 @@ Unset port properties Clear existing information of data plane status +.. option:: --tag + + Tag to be removed from the port + (repeat option to remove multiple tags) + +.. option:: --all-tag + + Clear all tags associated with the port + .. _port_unset-port: .. describe:: diff --git a/doc/source/cli/command-objects/router.rst b/doc/source/cli/command-objects/router.rst index 8bdf81db..9c9364bc 100644 --- a/doc/source/cli/command-objects/router.rst +++ b/doc/source/cli/command-objects/router.rst @@ -67,6 +67,7 @@ Create new router [--ha | --no-ha] [--description ] [--availability-zone-hint ] + [--tag | --no-tag] .. option:: --project @@ -121,6 +122,14 @@ Create new router (Router Availability Zone extension required, repeat option to set multiple availability zones) +.. option:: --tag + + Tag to be added to the router (repeat option to set multiple tags) + +.. option:: --no-tag + + No tags associated with the router + .. _router_create-name: .. describe:: @@ -156,6 +165,8 @@ List routers [--long] [--project [--project-domain ]] [--agent ] + [--tags [,,...]] [--any-tags [,,...]] + [--not-tags [,,...]] [--not-any-tags [,,...]] .. option:: --agent @@ -186,6 +197,22 @@ List routers Domain the project belongs to (name or ID). This can be used in case collisions between project names exist. +.. option:: --tags [,,...] + + List routers which have all given tag(s) + +.. option:: --any-tags [,,...] + + List routers which have any given tag(s) + +.. option:: --not-tags [,,...] + + Exclude routers which have all given tag(s) + +.. option:: --not-any-tags [,,...] + + Exclude routers which have any given tag(s) + router remove port ------------------ @@ -246,6 +273,7 @@ Set router properties [--route destination=,gateway= | --no-route] [--ha | --no-ha] [--external-gateway [--enable-snat|--disable-snat] [--fixed-ip subnet=,ip-address=]] + [--tag ] [--no-tag] .. option:: --name @@ -311,6 +339,15 @@ Set router properties subnet=,ip-address= (repeat option to set multiple fixed IP addresses) +.. option:: --tag + + Tag to be added to the router (repeat option to set multiple tags) + +.. option:: --no-tag + + Clear tags associated with the router. Specify both --tag + and --no-tag to overwrite current tags + .. _router_set-router: .. describe:: @@ -343,6 +380,7 @@ Unset router properties openstack router unset [--route destination=,gateway=] [--external-gateway] + [--tag | --all-tag] .. option:: --route destination=,gateway= @@ -356,6 +394,15 @@ Unset router properties Remove external gateway information from the router +.. option:: --tag + + Tag to be removed from the router + (repeat option to remove multiple tags) + +.. option:: --all-tag + + Clear all tags associated with the router + .. _router_unset-router: .. describe:: diff --git a/doc/source/cli/command-objects/subnet-pool.rst b/doc/source/cli/command-objects/subnet-pool.rst index 3a60974a..0cff4d7f 100644 --- a/doc/source/cli/command-objects/subnet-pool.rst +++ b/doc/source/cli/command-objects/subnet-pool.rst @@ -25,6 +25,7 @@ Create subnet pool [--default | --no-default] [--share | --no-share] [--default-quota ] + [--tag | --no-tag] --pool-prefix [...] @@ -79,6 +80,14 @@ Create subnet pool Set default quota for subnet pool as the number of IP addresses allowed in a subnet +.. option:: --tag + + Tag to be added to the subnet pool (repeat option to set multiple tags) + +.. option:: --no-tag + + No tags associated with the subnet pool + .. option:: --pool-prefix Set subnet pool prefixes (in CIDR notation) @@ -120,6 +129,8 @@ List subnet pools [--project [--project-domain ]] [--name ] [--address-scope ] + [--tags [,,...]] [--any-tags [,,...]] + [--not-tags [,,...]] [--not-any-tags [,,...]] .. option:: --long @@ -158,6 +169,22 @@ List subnet pools List only subnet pools of given address scope in output (name or ID) +.. option:: --tags [,,...] + + List subnet pools which have all given tag(s) + +.. option:: --any-tags [,,...] + + List subnet pools which have any given tag(s) + +.. option:: --not-tags [,,...] + + Exclude subnet pools which have all given tag(s) + +.. option:: --not-any-tags [,,...] + + Exclude subnet pools which have any given tag(s) + subnet pool set --------------- @@ -176,6 +203,7 @@ Set subnet pool properties [--default | --no-default] [--description ] [--default-quota ] + [--tag ] [--no-tag] .. option:: --name @@ -225,6 +253,15 @@ Set subnet pool properties Set default quota for subnet pool as the number of IP addresses allowed in a subnet +.. option:: --tag + + Tag to be added to the subnet pool (repeat option to set multiple tags) + +.. option:: --no-tag + + Clear tags associated with the subnet pool. Specify both --tag + and --no-tag to overwrite current tags + .. _subnet_pool_set-subnet-pool: .. describe:: @@ -256,6 +293,7 @@ Unset subnet pool properties openstack subnet pool unset [--pool-prefix [...]] + [--tag | --all-tag] .. option:: --pool-prefix @@ -263,6 +301,15 @@ Unset subnet pool properties Remove subnet pool prefixes (in CIDR notation). (repeat option to unset multiple prefixes). +.. option:: --tag + + Tag to be removed from the subnet pool + (repeat option to remove multiple tags) + +.. option:: --all-tag + + Clear all tags associated with the subnet pool + .. _subnet_pool_unset-subnet-pool: .. describe:: diff --git a/doc/source/cli/command-objects/subnet.rst b/doc/source/cli/command-objects/subnet.rst index 4e609361..c228dc20 100644 --- a/doc/source/cli/command-objects/subnet.rst +++ b/doc/source/cli/command-objects/subnet.rst @@ -31,6 +31,7 @@ Create new subnet [--ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}] [--network-segment ] [--service-type ] + [--tag | --no-tag] --network @@ -125,6 +126,14 @@ Create new subnet Must be a valid device owner value for a network port (repeat option to set multiple service types) +.. option:: --tag + + Tag to be added to the subnet (repeat option to set multiple tags) + +.. option:: --no-tag + + No tags associated with the subnet + .. option:: --network Network this subnet belongs to (name or ID) @@ -167,6 +176,8 @@ List subnets [--gateway ] [--name ] [--subnet-range ] + [--tags [,,...]] [--any-tags [,,...]] + [--not-tags [,,...]] [--not-any-tags [,,...]] .. option:: --long @@ -218,6 +229,22 @@ List subnets List only subnets of given subnet range (in CIDR notation) in output e.g.: ``--subnet-range 10.10.0.0/16`` +.. option:: --tags [,,...] + + List subnets which have all given tag(s) + +.. option:: --any-tags [,,...] + + List subnets which have any given tag(s) + +.. option:: --not-tags [,,...] + + Exclude subnets which have all given tag(s) + +.. option:: --not-any-tags [,,...] + + Exclude subnets which have any given tag(s) + subnet set ---------- @@ -238,6 +265,7 @@ Set subnet properties [--service-type ] [--name ] [--description ] + [--tag ] [--no-tag] .. option:: --allocation-pool start=,end= @@ -305,6 +333,15 @@ Set subnet properties Updated name of the subnet +.. option:: --tag + + Tag to be added to the subnet (repeat option to set multiple tags) + +.. option:: --no-tag + + Clear tags associated with the subnet. Specify both --tag + and --no-tag to overwrite current tags + .. _subnet_set-subnet: .. describe:: @@ -340,6 +377,7 @@ Unset subnet properties [--dns-nameserver [...]] [--host-route destination=,gateway= [...]] [--service-type ] + [--tag | --all-tag] .. option:: --dns-nameserver @@ -368,6 +406,15 @@ Unset subnet properties Must be a valid device owner value for a network port (repeat option to unset multiple service types) +.. option:: --tag + + Tag to be removed from the subnet + (repeat option to remove multiple tags) + +.. option:: --all-tag + + Clear all tags associated with the subnet + .. _subnet_unset-subnet: .. describe:: -- cgit v1.2.1