Merge "neutron: autogenerate docs"

This commit is contained in:
Zuul 2019-11-05 00:41:31 +00:00 committed by Gerrit Code Review
commit d17a1c8039
32 changed files with 525 additions and 4904 deletions

View File

@ -7,143 +7,5 @@ to a given project and may be shared between projects.
Network v2
address scope create
--------------------
Create new address scope
.. program:: address scope create
.. code:: bash
openstack address scope create
[--project <project> [--project-domain <project-domain>]]
[--ip-version <ip-version>]
[--share | --no-share]
<name>
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --ip-version <ip-version>
IP version (4 or 6, default is 4)
.. option:: --share
Share the address scope between projects
.. option:: --no-share
Do not share the address scope between projects (default)
.. _address_scope_create-name:
.. describe:: <name>
New address scope name
address scope delete
--------------------
Delete address scope(s)
.. program:: address scope delete
.. code:: bash
openstack address scope delete
<address-scope> [<address-scope> ...]
.. _address_scope_delete-address-scope:
.. describe:: <address-scope>
Address scope(s) to delete (name or ID)
address scope list
------------------
List address scopes
.. program:: address scope list
.. code:: bash
openstack address scope list
[--name <name>]
[--ip-version <ip-version>]
[--project <project> [--project-domain <project-domain>]]
[--share | --no-share]
.. option:: --name <name>
List only address scopes of given name in output
.. option:: --ip-version <ip-version>
List address scopes of given IP version networks (4 or 6)
.. option:: --project <project>
List address scopes according to their project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --share
List address scopes shared between projects
.. option:: --no-share
List address scopes not shared between projects
address scope set
-----------------
Set address scope properties
.. program:: address scope set
.. code:: bash
openstack address scope set
[--name <name>]
[--share | --no-share]
<address-scope>
.. option:: --name <name>
Set address scope name
.. option:: --share
Share the address scope between projects
.. option:: --no-share
Do not share the address scope between projects
.. _address_scope_set-address-scope:
.. describe:: <address-scope>
Address scope to modify (name or ID)
address scope show
------------------
Display address scope details
.. program:: address scope show
.. code:: bash
openstack address scope show
<address-scope>
.. _address_scope_show-address-scope:
.. describe:: <address-scope>
Address scope to display (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: address scope *

View File

@ -4,12 +4,5 @@ floating ip pool
Network v2
floating ip pool list
---------------------
List pools of floating IP addresses
.. program:: floating ip pool list
.. code:: bash
openstack floating ip pool list
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip pool *

View File

@ -4,170 +4,6 @@ floating ip port forwarding
Network v2
floating ip port forwarding create
----------------------------------
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip port forwarding *
Create floating IP Port Forwarding
.. program:: floating ip port forwarding create
.. code:: bash
openstack floating ip port forwarding create
--internal-ip-address <internal-ip-address>
--port <port>
--internal-protocol-port <port-number>
--external-protocol-port <port-number>
--protocol <protocol>
<floating-ip>
.. describe:: --internal-ip-address <internal-ip-address>
The fixed IPv4 address of the network port associated
to the floating IP port forwarding
.. describe:: --port <port>
The name or ID of the network port associated to the
floating IP port forwarding
.. describe:: --internal-protocol-port <port-number>
The protocol port number of the network port fixed
IPv4 address associated to the floating IP port
forwarding
.. describe:: --external-protocol-port <port-number>
The protocol port number of the port forwarding's
floating IP address
.. describe:: --protocol <protocol>
The protocol used in the floating IP port forwarding,
for instance: TCP, UDP
.. describe:: <floating-ip>
Floating IP that the port forwarding belongs to (IP
address or ID)
floating ip port forwarding delete
----------------------------------
Delete floating IP Port Forwarding(s)
.. program:: floating ip port forwarding delete
.. code:: bash
openstack floating ip port forwarding delete <floating-ip>
<port-forwarding-id> [<port-forwarding-id> ...]
.. describe:: <floating-ip>
Floating IP that the port forwarding belongs to (IP
address or ID)
.. describe:: <port-forwarding-id>
The ID of the floating IP port forwarding
floating ip port forwarding list
--------------------------------
List floating IP Port Forwarding(s)
.. program:: floating ip port forwarding list
.. code:: bash
openstack floating ip port forwarding list
[--port <port>]
[--external-protocol-port <port-number>]
[--protocol protocol]
<floating-ip>
.. option:: --port <port>
The ID of the network port associated to the floating
IP port forwarding
.. option:: --protocol <protocol>
The IP protocol used in the floating IP port
forwarding
.. describe:: <floating-ip>
Floating IP that the port forwarding belongs to (IP
address or ID)
floating ip port forwarding set
-------------------------------
Set floating IP Port Forwarding properties
.. program:: floating ip port forwarding set
.. code:: bash
openstack floating ip port forwarding set
[--port <port>]
[--internal-ip-address <internal-ip-address>]
[--internal-protocol-port <port-number>]
[--external-protocol-port <port-number>]
[--protocol <protocol>]
<floating-ip>
<port-forwarding-id>
.. option:: --port <port>
The ID of the network port associated to the floating
IP port forwarding
.. option:: --internal-ip-address <internal-ip-address>
The fixed IPv4 address of the network port associated
to the floating IP port forwarding
.. option:: --internal-protocol-port <port-number>
The TCP/UDP/other protocol port number of the network
port fixed IPv4 address associated to the floating IP
port forwarding
.. option:: --external-protocol-port <port-number>
The TCP/UDP/other protocol port number of the port
forwarding's floating IP address
.. option:: --protocol <protocol>
The IP protocol used in the floating IP port
forwarding
.. describe:: <floating-ip>
Floating IP that the port forwarding belongs to (IP
address or ID)
.. describe:: <port-forwarding-id>
The ID of the floating IP port forwarding
floating ip port forwarding show
--------------------------------
Display floating IP Port Forwarding details
.. program:: floating ip port forwarding show
.. code:: bash
openstack floating ip show <floating-ip> <port-forwarding-id>
.. describe:: <floating-ip>
Floating IP that the port forwarding belongs to (IP
address or ID)
.. describe:: <port-forwarding-id>
The ID of the floating IP port forwarding

View File

@ -4,298 +4,23 @@ floating ip
Network v2
floating ip create
------------------
.. NOTE(efried): have to list these out one by one; 'floating ip' pulls in
... pool and ... port forwarding.
Create floating IP
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip create
.. program:: floating ip create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip delete
openstack floating ip create
[--subnet <subnet>]
[--port <port>]
[--floating-ip-address <ip-address>]
[--fixed-ip-address <ip-address>]
[--description <description>]
[--qos-policy <qos-policy>]
[--project <project> [--project-domain <project-domain>]]
[--tag <tag> | --no-tag]
[--dns-domain <dns-domain>]
[--dns-name <dns-name>]
<network>
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip list
.. option:: --subnet <subnet>
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip set
Subnet on which you want to create the floating IP (name or ID)
*Network version 2 only*
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip show
.. option:: --port <port>
Port to be associated with the floating IP (name or ID)
*Network version 2 only*
.. option:: --floating-ip-address <ip-address>
Floating IP address
*Network version 2 only*
.. option:: --fixed-ip-address <ip-address>
Fixed IP address mapped to the floating IP
*Network version 2 only*
.. option:: --description <description>
Set floating IP description
*Network version 2 only*
.. option:: --qos-policy <qos-policy>
QoS policy to attach to the floating IP (name or ID)
*Network version 2 only*
.. option:: --project <project>
Owner's project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --tag <tag>
Tag to be added to the floating IP (repeat option to set multiple tags)
*Network version 2 only*
.. option:: --no-tag
No tags associated with the floating IP
*Network version 2 only*
.. option:: --dns-domain <dns-domain>
Set DNS domain for this floating IP (requires DNS integration extension).
.. option:: --dns-name <dns-name>
Set DNS name for this floating IP (requires DNS integration extension).
.. describe:: <network>
Network to allocate floating IP from (name or ID)
floating ip delete
------------------
Delete floating IP(s)
.. program:: floating ip delete
.. code:: bash
openstack floating ip delete <floating-ip> [<floating-ip> ...]
.. describe:: <floating-ip>
Floating IP(s) to delete (IP address or ID)
floating ip list
----------------
List floating IP(s)
.. program:: floating ip list
.. code:: bash
openstack floating ip list
[--network <network>]
[--port <port>]
[--fixed-ip-address <ip-address>]
[--long]
[--status <status>]
[--project <project> [--project-domain <project-domain>]]
[--router <router>]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --network <network>
List floating IP(s) according to given network (name or ID)
*Network version 2 only*
.. option:: --port <port>
List floating IP(s) according to given port (name or ID)
*Network version 2 only*
.. option:: --fixed-ip-address <ip-address>
List floating IP(s) according to given fixed IP address
*Network version 2 only*
.. option:: --floating-ip-address <ip-address>
List floating IP(s) according to given floating IP address
*Network version 2 only*
.. option:: --long
List additional fields in output
*Network version 2 only*
.. option:: --status <status>
List floating IP(s) according to given status ('ACTIVE', 'DOWN')
*Network version 2 only*
.. option:: --project <project>
List floating IP(s) according to given project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID). This can
be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --router <router>
List floating IP(s) according to given router (name or ID)
*Network version 2 only*
.. option:: --tags <tag>[,<tag>,...]
List floating IP(s) which have all given tag(s)
*Network version 2 only*
.. option:: --any-tags <tag>[,<tag>,...]
List floating IP(s) which have any given tag(s)
*Network version 2 only*
.. option:: --not-tags <tag>[,<tag>,...]
Exclude floating IP(s) which have all given tag(s)
*Network version 2 only*
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude floating IP(s) which have any given tag(s)
*Network version 2 only*
floating ip set
---------------
Set floating IP properties
.. program:: floating ip set
.. code:: bash
openstack floating ip set
[--port <port>]
[--fixed-ip-address <ip-address>]
[--qos-policy <qos-policy> | --no-qos-policy]
[--tag <tag>] [--no-tag]
<floating-ip>
.. option:: --port <port>
Associate the floating IP with port (name or ID)
.. option:: --fixed-ip-address <ip-address>
Fixed IP of the port (required only if port has multiple IPs)
.. option:: --qos-policy <qos-policy>
Attach QoS policy to the floating IP (name or ID)
.. option:: --no-qos-policy
Remove the QoS policy attached to the floating IP
.. option:: --tag <tag>
Tag to be added to the floating IP (repeat option to set multiple tags)
.. option:: --no-tag
Clear tags associated with the floating IP. Specify both --tag
and --no-tag to overwrite current tags
.. _floating_ip_set-floating-ip:
.. describe:: <floating-ip>
Floating IP to associate (IP address or ID)
floating ip show
----------------
Display floating IP details
.. program:: floating ip show
.. code:: bash
openstack floating ip show <floating-ip>
.. describe:: <floating-ip>
Floating IP to display (IP address or ID)
floating ip unset
-----------------
Unset floating IP Properties
.. program:: floating ip unset
.. code:: bash
openstack floating ip unset
[--port]
[--qos-policy]
[--tag <tag> | --all-tag]
<floating-ip>
.. option:: --port
Disassociate any port associated with the floating IP
.. option:: --qos-policy
Remove the QoS policy attached to the floating IP
.. option:: --tag <tag>
Tag to be removed from the floating IP
(repeat option to remove multiple tags)
.. option:: --all-tag
Clear all tags associated with the floating IP
.. _floating_ip_unset-floating-ip:
.. describe:: <floating-ip>
Floating IP to disassociate (IP address or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: floating ip unset

View File

@ -4,57 +4,5 @@ ip availability
Network v2
ip availability list
--------------------
List IP availability for network
This command retrieves information about IP availability.
Useful for admins who need a quick way to check the
IP availability for all associated networks.
List specifically returns total IP capacity and the
number of allocated IP addresses from that pool.
.. program:: ip availability list
.. code:: bash
openstack ip availability list
[--ip-version {4,6}]
[--project <project>]
.. option:: --ip-version {4,6}
List IP availability of given IP version networks
(default is 4)
.. option:: --project <project>
List IP availability of given project
(name or ID)
ip availability show
--------------------
Show network IP availability details
This command retrieves information about IP availability.
Useful for admins who need a quick way to
check the IP availability and details for a
specific network.
This command will return information about
IP availability for the network as a whole, and
return availability information for each individual
subnet within the network as well.
.. program:: ip availability show
.. code:: bash
openstack ip availability show
<network>
.. _ip_availability_show-network:
.. describe:: <network>
Show IP availability for a specific network (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: ip availability *

View File

@ -10,207 +10,5 @@ agent is "True".
Network v2
network agent add network
-------------------------
Add network to an agent
.. program:: network agent add network
.. code:: bash
openstack network agent add network
[--dhcp]
<agent-id>
<network>
.. option:: --dhcp
Add a network to DHCP agent
.. describe:: <agent-id>
Agent to which a network is added (ID only)
.. describe:: <network>
Network to be added to an agent (name or ID)
network agent add router
------------------------
Add router to an agent
.. program:: network agent add router
.. code:: bash
openstack network agent add router
[--l3]
<agent-id>
<router>
.. option:: --l3
Add router to an L3 agent
.. _network_agent_add_router-agent-id:
.. describe:: <agent-id>
Agent to which a router is added (ID only)
.. _network_agent_add_router-router:
.. describe:: <router>
Router to be added to an agent (name or ID)
network agent delete
--------------------
Delete network agent(s)
.. program:: network agent delete
.. code:: bash
openstack network agent delete
<network-agent> [<network-agent> ...]
.. _network_agent_delete-network-agent:
.. describe:: <network-agent>
Network agent(s) to delete (ID only)
network agent list
------------------
List network agents
.. program:: network agent list
.. code:: bash
openstack network agent list
[--agent-type <agent-type>]
[--host <host>]
[--network <network> | --router <router>]
[--long]
.. option:: --agent-type <agent-type>
List only agents with the specified agent type.
The supported agent types are: dhcp, open-vswitch,
linux-bridge, ofa, l3, loadbalancer, metering,
metadata, macvtap, nic.
.. option:: --host <host>
List only agents running on the specified host
.. option:: --network <network>
List agents hosting a network (name or ID)
.. option:: --router <router>
List agents hosting this router (name or ID)
.. option:: --long
List additional fields in output
network agent remove network
----------------------------
Remove network from an agent
.. program:: network agent remove network
.. code:: bash
openstack network agent remove network
[--dhcp]
<agent-id>
<network>
.. option:: --dhcp
Remove network from DHCP agent
.. _network_agent_remove_network-agent-id:
.. describe:: <agent-id>
Agent to which a network is removed (ID only)
.. _network_agent_remove_network-network:
.. describe:: <network>
Network to be removed from an agent (name or ID)
network agent remove router
---------------------------
Remove router from an agent
.. program:: network agent remove router
.. code:: bash
openstack agent remove router
[--l3]
<agent-id>
<router>
.. option:: --l3
Remove router from an L3 agent
.. _network_agent_remove_router-agent-id:
.. describe:: <agent-id>
Agent from which router will be removed (ID only)
.. _network_agent_remove_router-router:
.. describe:: <router>
Router to be removed from an agent (name or ID)
network agent set
-----------------
Set network agent properties
.. program:: network agent set
.. code:: bash
openstack network agent set
[--description <description>]
[--enable | --disable]
<network-agent>
.. option:: --description <description>
Set network agent description
.. option:: --enable
Enable network agent
.. option:: --disable
Disable network agent
.. _network_agent_set-network-agent:
.. describe:: <network-agent>
Network agent to modify (ID only)
network agent show
------------------
Display network agent details
.. program:: network agent show
.. code:: bash
openstack network agent show
<network-agent>
.. _network_agent_show-network-agent:
.. describe:: <network-agent>
Network agent to display (ID only)
.. autoprogram-cliff:: openstack.network.v2
:command: network agent *

View File

@ -10,60 +10,5 @@ http://docs.openstack.org/newton/networking-guide/config-auto-allocation.html
Network v2
network auto allocated topology create
--------------------------------------
Create the auto allocated topology for project
.. program:: network auto allocated topology create
.. code:: bash
openstack network auto allocated topology create
[--or-show]
[--check-resources]
[--project <project> [--project-domain <project-domain>]]
.. option:: --or-show
If topology exists returns the topologies information (Default).
.. option:: --check-resources
Validate the requirements for auto allocated topology.
Does not return a topology.
.. option:: --project <project>
Return the auto allocated topology for a given project.
Default is current project.
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. _network_auto_allocated_topology_create:
network auto allocated topology delete
--------------------------------------
Delete auto allocated topology for project
.. program:: network auto allocated topology delete
.. code:: bash
openstack network auto allocated topology delete
[--project <project> [--project-domain <project-domain>]]
.. option:: --project <project>
Delete auto allocated topology for a given project.
Default is the current project.
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. _network_auto_allocated_topology_delete:
.. autoprogram-cliff:: openstack.network.v2
:command: network auto allocated topology *

View File

@ -11,135 +11,5 @@ operators to create user options according to deployment needs.
Network v2
network flavor profile create
-----------------------------
Create a new network flavor profile
.. program:: network flavor profile create
.. code:: bash
openstack network flavor profile create
[--project <project> [--project-domain <project-domain>]]
[--description <description>]
[--enable | --disable]
(--driver <driver> | --metainfo <metainfo> | --driver <driver> --metainfo <metainfo>)
.. option:: --project <project>
Owner's project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID). This can
be used in case collisions between project names
exist
.. option:: --description <description>
Description for the flavor profile
*Network version 2 only*
.. option:: --enable
Enable the flavor profile (default)
.. option:: --disable
Disable the flavor profile
.. option:: --driver <driver>
Python module path to driver
*Network version 2 only*
.. option:: --metainfo <metainfo>
Metainfo for the flavor profile
*Network version 2 only*
network flavor profile delete
-----------------------------
Delete network flavor profile
.. program:: network flavor profile delete
.. code:: bash
openstack network flavor profile delete
<flavor-profile-id> [<flavor-profile-id> ...]
.. describe:: <flavor-profile-id>
Flavor profile(s) to delete (ID only)
network flavor profile list
---------------------------
List network flavor profiles
.. program:: network flavor profile list
.. code:: bash
openstack network flavor profile list
network flavor profile set
--------------------------
Set network flavor profile properties
.. program:: network flavor profile set
.. code:: bash
openstack network flavor profile set
[--description <description>]
[--driver <driver>]
[--enable | --disable]
[--metainfo <metainfo>]
<flavor-profile-id>
.. option:: --description <description>
Description of the flavor profile
.. option:: --driver <driver>
Python module path to driver
.. option:: --enable (Default)
Enable the flavor profile
.. option:: --disable
Disable the flavor profile
.. option:: --metainfo <metainfo>
Metainfo for the flavor profile
.. describe:: <flavor-profile-id>
Flavor profile to update (ID only)
network flavor profile show
---------------------------
Show network flavor profile
.. program:: network flavor profile show
.. code:: bash
openstack network flavor profile show
<flavor-profile-id>
.. describe:: <flavor-profile-id>
Flavor profile to display (ID only)
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor profile *

View File

@ -8,176 +8,26 @@ service flavors.
Network v2
network flavor add profile
--------------------------
.. NOTE(efried): have to list these out one by one; 'network flavor' pulls in
... profile *.
Add network flavor to service profile
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor add profile
.. program:: network flavor add profile
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor create
openstack network flavor add profile
<flavor>
<service-profile-id>
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor delete
.. describe:: <flavor>
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor list
Flavor to which service profile is added. (Name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor remove profile
.. describe:: <service-profile-id>
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor set
Service profile to be added to flavor. (ID only)
.. _network_flavor_add_profile:
network flavor create
---------------------
Create network flavor
.. program:: network flavor create
.. code:: bash
openstack network flavor create
--service-type <service-type>
[--description <description>]
[--enable | --disable]
[--project <project> [--project-domain <project-domain>]]
<name>
.. option:: --service-type <service-type>
Service type to which the flavor applies to: e.g. VPN.
(See openstack :ref:`\<service providers\> <network_service_provider_list>`) (required)
.. option:: --description <description>
Description for the flavor
.. option:: --enable
Enable the flavor (default)
.. option:: --disable
Disable the flavor
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID). This can
be used in case collisions between project names
exist.
.. describe:: <name>
Name for the flavor
.. _network_flavor_create:
network flavor delete
---------------------
Delete network flavor(s)
.. program:: network flavor delete
.. code:: bash
openstack network flavor delete
<flavor> [<flavor> ...]
.. describe:: <flavor>
Flavor(s) to delete (name or ID)
.. _network_flavor_delete:
network flavor list
-------------------
List network flavors
.. program:: network flavor list
.. code:: bash
openstack network flavor list
.. _network_flavor_list:
network flavor remove profile
-----------------------------
Remove network flavor from service profile
.. program:: network flavor remove profile
.. code:: bash
openstack network flavor remove profile
<flavor>
<service-profile-id>
.. describe:: <flavor>
Flavor from which service profile is removed. (Name or ID)
.. describe:: <service-profile-id>
Service profile to be removed from flavor. (ID only)
.. _network_flavor_remove_profile:
network flavor set
------------------
Set network flavor properties
.. program:: network flavor set
.. code:: bash
openstack network flavor set
[--name <name>]
[--description <description>]
[--enable | --disable]
<flavor>
.. option:: --name <name>
Set flavor name
.. option:: --description <description>
Set network flavor description
.. option:: --enable
Enable network flavor
.. option:: --disable
Disable network flavor
.. describe:: <flavor>
Flavor to update (name or ID)
.. _network_flavor_set:
network flavor show
-------------------
Show network flavor
.. program:: network flavor show
.. code:: bash
openstack network flavor show
<flavor>
.. describe:: <flavor>
Flavor to display (name or ID)
.. _network_flavor_show:
.. autoprogram-cliff:: openstack.network.v2
:command: network flavor show

View File

@ -9,93 +9,5 @@ metering extension.
Network v2
network meter rule create
-------------------------
Create meter rule
.. program:: network meter rule create
.. code:: bash
openstack network meter rule create
--remote-ip-prefix <remote-ip-prefix>
[--ingress | --egress]
[--exclude | --include]
[--project <project> [--project-domain <project-domain>]]
<meter>
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name of ID).
This can be used in case collisions between project names exist.
.. option:: --ingress
Rule is applied to incoming traffic (default)
.. option:: --egress
Rule is applied to outgoing traffic
.. option:: --exclude
Exclude remote_ip_prefix from count of the traffic of IP addresses
.. option:: --include
Include remote_ip_prefix into count of the traffic of IP addresses
(default)
.. option:: --remote-ip-prefix <remote-ip-prefix>
The remote IP prefix to associate with this metering rule packet
.. _network_meter_rule_create:
.. describe:: <meter>
Meter to associate with this meter rule (name or ID)
network meter rule delete
-------------------------
Delete meter rule(s)
.. program:: network meter rule delete
.. code:: bash
openstack network meter rule delete <id> [<id> ...]
.. _network_meter_rule_delete:
.. describe:: <meter-rule-id>
ID of meter rule(s) to delete
network meter rule list
-----------------------
List meter rules
.. program:: network meter rule list
.. code:: bash
openstack network meter rule list
network meter rule show
-----------------------
Show meter rule
.. program:: network meter rule show
.. code:: bash
openstack network meter rule show <meter-rule-id>
.. _network_meter_show:
.. describe:: <meter-rule-id>
Meter rule to display (ID only)
.. autoprogram-cliff:: openstack.network.v2
:command: network meter rule *

View File

@ -8,84 +8,17 @@ are specific to the L3 metering extension.
Network v2
network meter create
--------------------
.. NOTE(efried): have to list these out one by one; 'network meter *' pulls in
... rule *.
Create network meter
.. autoprogram-cliff:: openstack.network.v2
:command: network meter create
.. program:: network meter create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: network meter delete
openstack network meter create
[--project <project> [--project-domain <project-domain>]]
[--description <description>]
[--share | --no-share]
<name>
.. autoprogram-cliff:: openstack.network.v2
:command: network meter list
.. option:: --project <project>
Owner's project (name of ID)
*Network version 2 only*
.. option:: --description <description>
Description of meter
*Network version 2 only*
.. option:: --share
Share the meter between projects
.. option:: --no-share
Do not share the meter between projects (Default)
.. _network_meter_create:
.. describe:: <name>
New meter name
network meter delete
--------------------
Delete network meter(s)
.. program:: network meter delete
.. code:: bash
openstack network meter delete
<meter> [<meter> ...]
.. _network_meter_delete:
.. describe:: <meter>
Meter(s) to delete (name or ID)
network meter list
------------------
List network meters
.. program:: network meter list
.. code:: bash
openstack network meter list
network meter show
------------------
Show network meter
.. program:: network meter show
.. code:: bash
openstack network meter show
<meter>
.. _network_meter_show:
.. describe:: <meter>
Meter to display (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network meter show

View File

@ -7,157 +7,5 @@ network or a port.
Network v2
network qos policy create
-------------------------
Create new Network QoS policy
.. program:: network qos policy create
.. code:: bash
openstack network qos policy create
[--description <description>]
[--share | --no-share]
[--project <project>]
[--project-domain <project-domain>]
[--default | --no-default]
<name>
.. option:: --description <description>
Description of the QoS policy
.. option:: --share
Make the QoS policy accessible by other projects
.. option:: --no-share
Make the QoS policy not accessible by other projects (default)
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --default
Set this as a default network QoS policy
.. option:: --no-default
Set this as a non-default network QoS policy
.. _network_qos_policy_create-name:
.. describe:: <name>
New QoS policy specification name
network qos policy delete
-------------------------
Delete Network QoS policy
.. program:: network qos policy delete
.. code:: bash
openstack network qos policy delete
<qos-policy> [<qos-policy> ...]
.. _network_qos_policy_delete-qos-policy:
.. describe:: <qos-policy>
Network QoS policy(s) to delete (name or ID)
network qos policy list
-----------------------
List Network QoS policies
.. program:: network qos policy list
.. code:: bash
openstack network qos policy list
[--project <project> [--project-domain <project-domain>]]
[--share | --no-share]
.. option:: --project <project>
List qos policies according to their project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --share
List qos policies shared between projects
.. option:: --no-share
List qos policies not shared between projects
network qos policy set
----------------------
Set Network QoS policy properties
.. program:: network qos policy set
.. code:: bash
openstack network qos policy set
[--name <name>]
[--description <description>]
[--share | --no-share]
[--default | --no-default]
<qos-policy>
.. option:: --name <name>
Name of the QoS policy
.. option:: --description <description>
Description of the QoS policy
.. option:: --share
Make the QoS policy accessible by other projects
.. option:: --no-share
Make the QoS policy not accessible by other projects
.. option:: --default
Set this as a default network QoS policy
.. option:: --no-default
Set this as a non-default network QoS policy
.. _network_qos_policy_set-qos-policy:
.. describe:: <qos-policy>
Network QoS policy to modify (name or ID)
network qos policy show
-----------------------
Display Network QoS policy details
.. program:: network qos policy show
.. code:: bash
openstack network qos policy show
<qos-policy>
.. _network_qos_policy_show-qos-policy:
.. describe:: <qos-policy>
Network QoS policy to display (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network qos policy *

View File

@ -7,27 +7,5 @@ used.
Network v2
network qos rule type list
--------------------------
List Network QoS rule types
.. program:: network qos rule type list
.. code:: bash
openstack network qos rule type list
network qos rule type show
--------------------------
Display Network QoS rule type details
.. program:: network qos rule type show
.. code:: bash
openstack network qos rule type show
<rule-type-name>
.. describe:: <rule-type-name>
Name of QoS rule type (minimum-bandwidth, dscp-marking, bandwidth-limit)
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule type *

View File

@ -9,157 +9,20 @@ rules, each of them
Network v2
network qos rule create
-----------------------
.. NOTE(efried): have to list these out one by one; 'network qos rule *' pulls
network qos rule type *.
Create new Network QoS rule
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule create
.. program:: network qos rule create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule delete
openstack network qos rule create
--type <type>
[--max-kbps <max-kbps>]
[--max-burst-kbits <max-burst-kbits>]
[--dscp-marks <dscp-marks>]
[--min-kbps <min-kbps>]
[--ingress | --egress]
<qos-policy>
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule list
.. option:: --type <type>
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule set
QoS rule type (minimum-bandwidth, dscp-marking, bandwidth-limit)
.. option:: --max-kbps <min-kbps>
Maximum bandwidth in kbps
.. option:: --max-burst-kbits <max-burst-kbits>
Maximum burst in kilobits, 0 means automatic
.. option:: --dscp-mark <dscp-mark>
DSCP mark: value can be 0, even numbers from 8-56, excluding 42, 44, 50,
52, and 54
.. option:: --min-kbps <min-kbps>
Minimum guaranteed bandwidth in kbps
.. option:: --ingress
Ingress traffic direction from the project point of view
.. option:: --egress
Egress traffic direction from the project point of view
.. describe:: <qos-policy>
QoS policy that contains the rule (name or ID)
network qos rule delete
-----------------------
Delete Network QoS rule
.. program:: network qos rule delete
.. code:: bash
openstack network qos rule delete
<qos-policy>
<rule-id>
.. describe:: <qos-policy>
QoS policy that contains the rule (name or ID)
.. describe:: <rule-id>
Network QoS rule to delete (ID)
network qos rule list
---------------------
List Network QoS rules
.. program:: network qos rule list
.. code:: bash
openstack network qos rule list
<qos-policy>
.. describe:: <qos-policy>
QoS policy that contains the rule (name or ID)
network qos rule set
--------------------
Set Network QoS rule properties
.. program:: network qos rule set
.. code:: bash
openstack network qos rule set
[--max-kbps <max-kbps>]
[--max-burst-kbits <max-burst-kbits>]
[--dscp-marks <dscp-marks>]
[--min-kbps <min-kbps>]
[--ingress | --egress]
<qos-policy>
<rule-id>
.. option:: --max-kbps <min-kbps>
Maximum bandwidth in kbps
.. option:: --max-burst-kbits <max-burst-kbits>
Maximum burst in kilobits, 0 means automatic
.. option:: --dscp-mark <dscp-mark>
DSCP mark: value can be 0, even numbers from 8-56, excluding 42, 44, 50,
52, and 54
.. option:: --min-kbps <min-kbps>
Minimum guaranteed bandwidth in kbps
.. option:: --ingress
Ingress traffic direction from the project point of view
.. option:: --egress
Egress traffic direction from the project point of view
.. describe:: <qos-policy>
QoS policy that contains the rule (name or ID)
.. describe:: <rule-id>
Network QoS rule to delete (ID)
network qos rule show
---------------------
Display Network QoS rule details
.. program:: network qos rule show
.. code:: bash
openstack network qos rule show
<qos-policy>
<rule-id>
.. describe:: <qos-policy>
QoS policy that contains the rule (name or ID)
.. describe:: <rule-id>
Network QoS rule to delete (ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network qos rule show

View File

@ -8,136 +8,5 @@ to network resources for specific projects.
Network v2
network rbac create
-------------------
Create network RBAC policy
.. program:: network rbac create
.. code:: bash
openstack network rbac create
--type <type>
--action <action>
[--target-project <target-project> | --target-all-projects]
[--target-project-domain <target-project-domain>]
[--project <project> [--project-domain <project-domain>]]
<rbac-policy>
.. option:: --type <type>
Type of the object that RBAC policy affects ("security_group", "qos_policy" or "network") (required)
.. option:: --action <action>
Action for the RBAC policy ("access_as_external" or "access_as_shared") (required)
.. option:: --target-project <target-project>
The project to which the RBAC policy will be enforced (name or ID)
.. option:: --target-all-projects
Allow creating RBAC policy for all projects.
.. option:: --target-project-domain <target-project-domain>
Domain the target project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --project <project>
The owner project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. _network_rbac_create-rbac-policy:
.. describe:: <rbac-object>
The object to which this RBAC policy affects (name or ID)
network rbac delete
-------------------
Delete network RBAC policy(s)
.. program:: network rbac delete
.. code:: bash
openstack network rbac delete
<rbac-policy> [<rbac-policy> ...]
.. _network_rbac_delete-rbac-policy:
.. describe:: <rbac-policy>
RBAC policy(s) to delete (ID only)
network rbac list
-----------------
List network RBAC policies
.. program:: network rbac list
.. code:: bash
openstack network rbac list
[--type <type>]
[--action <action>]
[--long]
.. option:: --type <type>
List network RBAC policies according to given object type ("security_group", "qos_policy" or "network")
.. option:: --action <action>
List network RBAC policies according to given action ("access_as_external" or "access_as_shared")
.. option:: --long
List additional fields in output
network rbac set
----------------
Set network RBAC policy properties
.. program:: network rbac set
.. code:: bash
openstack network rbac set
[--target-project <target-project> [--target-project-domain <target-project-domain>]]
<rbac-policy>
.. option:: --target-project <target-project>
The project to which the RBAC policy will be enforced (name or ID)
.. option:: --target-project-domain <target-project-domain>
Domain the target project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. _network_rbac_set-rbac-policy:
.. describe:: <rbac-policy>
RBAC policy to be modified (ID only)
network rbac show
-----------------
Display network RBAC policy details
.. program:: network rbac show
.. code:: bash
openstack network rbac show
<rbac-policy>
.. _network_rbac_show-rbac-policy:
.. describe:: <rbac-policy>
RBAC policy (ID only)
.. autoprogram-cliff:: openstack.network.v2
:command: network rbac *

View File

@ -9,125 +9,20 @@ within a network may not be guaranteed.
Network v2
network segment create
----------------------
.. NOTE(efried): have to list these out one by one; 'network segment *' pulls
... range *.
Create new network segment
.. autoprogram-cliff:: openstack.network.v2
:command: network segment create
.. program:: network segment create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: network segment delete
openstack network segment create
[--description <description>]
[--physical-network <physical-network>]
[--segment <segment>]
--network <network>
--network-type <network-type>
<name>
.. autoprogram-cliff:: openstack.network.v2
:command: network segment list
.. option:: --description <description>
.. autoprogram-cliff:: openstack.network.v2
:command: network segment set
Network segment description
.. option:: --physical-network <physical-network>
Physical network name of this network segment
.. option:: --segment <segment>
Segment identifier for this network segment which is
based on the network type, VLAN ID for vlan network
type and tunnel ID for geneve, gre and vxlan network
types
.. option:: --network <network>
Network this network segment belongs to (name or ID)
.. option:: --network-type <network-type>
Network type of this network segment
(flat, geneve, gre, local, vlan or vxlan)
.. _network_segment_create-name:
.. describe:: <name>
New network segment name
network segment delete
----------------------
Delete network segment(s)
.. program:: network segment delete
.. code:: bash
openstack network segment delete
<network-segment> [<network-segment> ...]
.. _network_segment_delete-segment:
.. describe:: <network-segment>
Network segment(s) to delete (name or ID)
network segment list
--------------------
List network segments
.. program:: network segment list
.. code:: bash
openstack network segment list
[--long]
[--network <network>]
.. option:: --long
List additional fields in output
.. option:: --network <network>
List network segments that belong to this network (name or ID)
network segment set
-------------------
Set network segment properties
.. program:: network segment set
.. code:: bash
openstack network segment set
[--description <description>]
[--name <name>]
<network-segment>
.. option:: --description <description>
Set network segment description
.. option:: --name <name>
Set network segment name
.. _network_segment_set-segment:
.. describe:: <network-segment>
Network segment to modify (name or ID)
network segment show
--------------------
Display network segment details
.. program:: network segment show
.. code:: bash
openstack network segment show
<network-segment>
.. _network_segment_show-segment:
.. describe:: <network-segment>
Network segment to display (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network segment show

View File

@ -9,12 +9,5 @@ Network v2
.. _network_service_provider_list:
network service provider list
-----------------------------
List service providers
.. program:: network service provider list
.. code:: bash
openstack network service provider list
.. autoprogram-cliff:: openstack.network.v2
:command: network service provider list

View File

@ -11,505 +11,23 @@ provider networks. Networks can be connected via routers.
Compute v2, Network v2
network create
--------------
.. NOTE(efried): have to list these out one by one; 'network *' pulls in
... flavor *, ... qos policy *, etc.
Create new network
.. autoprogram-cliff:: openstack.network.v2
:command: network create
.. program:: network create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: network delete
openstack network create
[--project <project> [--project-domain <project-domain>]]
[--enable | --disable]
[--share | --no-share]
[--description <description>]
[--mtu <mtu>]
[--availability-zone-hint <availability-zone>]
[--enable-port-security | --disable-port-security]
[--external [--default | --no-default] | --internal]
[--provider-network-type <provider-network-type>]
[--provider-physical-network <provider-physical-network>]
[--provider-segment <provider-segment>]
[--qos-policy <qos-policy>]
[--transparent-vlan | --no-transparent-vlan]
[--dns-domain <dns-domain>]
[--tag <tag> | --no-tag]
<name>
.. autoprogram-cliff:: openstack.network.v2
:command: network list
.. option:: --project <project>
.. autoprogram-cliff:: openstack.network.v2
:command: network set
Owner's project (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network show
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --enable
Enable network (default)
*Network version 2 only*
.. option:: --disable
Disable network
*Network version 2 only*
.. option:: --share
Share the network between projects
.. option:: --no-share
Do not share the network between projects
.. option:: --description <description>
Set network description
*Network version 2 only*
.. option:: --mtu <mtu>
Set network mtu
*Network version 2 only*
.. option:: --availability-zone-hint <availability-zone>
Availability Zone in which to create this network
(Network Availability Zone extension required,
repeat option to set multiple availability zones)
*Network version 2 only*
.. option:: --enable-port-security
Enable port security by default for ports created on
this network (default)
*Network version 2 only*
.. option:: --disable-port-security
Disable port security by default for ports created on
this network
*Network version 2 only*
.. option:: --subnet <subnet>
IPv4 subnet for fixed IPs (in CIDR notation)
*Compute version 2 only*
.. option:: --external
Set this network as an external network
(external-net extension required)
*Network version 2 only*
.. option:: --internal
Set this network as an internal network (default)
*Network version 2 only*
.. option:: --default
Specify if this network should be used as
the default external network
*Network version 2 only*
.. option:: --no-default
Do not use the network as the default external network
(default)
*Network version 2 only*
.. option:: --provider-network-type <provider-network-type>
The physical mechanism by which the virtual network is implemented.
The supported options are: flat, geneve, gre, local, vlan, vxlan.
*Network version 2 only*
.. option:: --provider-physical-network <provider-physical-network>
Name of the physical network over which the virtual network is implemented
*Network version 2 only*
.. option:: --provider-segment <provider-segment>
VLAN ID for VLAN networks or Tunnel ID for GENEVE/GRE/VXLAN networks
*Network version 2 only*
.. option:: --qos-policy <qos-policy>
QoS policy to attach to this network (name or ID)
*Network version 2 only*
.. option:: --transparent-vlan
Make the network VLAN transparent
*Network version 2 only*
.. option:: --no-transparent-vlan
Do not make the network VLAN transparent
*Network version 2 only*
.. option:: --dns-domain <dns-domain>
Set DNS domain for this network (requires DNS integration extension).
.. option:: --tag <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:: <name>
New network name
network delete
--------------
Delete network(s)
.. program:: network delete
.. code:: bash
openstack network delete
<network> [<network> ...]
.. _network_delete-network:
.. describe:: <network>
Network(s) to delete (name or ID)
network list
------------
List networks
.. program:: network list
.. code:: bash
openstack network list
[--external | --internal]
[--long]
[--name <name>]
[--enable | --disable]
[--project <project> [--project-domain <project-domain>]]
[--share | --no-share]
[--status <status>]
[--provider-network-type <provider-network-type>]
[--provider-physical-network <provider-physical-network>]
[--provider-segment <provider-segment>]
[--agent <agent-id>]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --external
List external networks
*Network version 2 only*
.. option:: --internal
List internal networks
*Network version 2 only*
.. option:: --long
List additional fields in output
*Network version 2 only*
.. option:: --name <name>
List networks according to their name
*Network version 2 only*
.. option:: --enable
List enabled networks
*Network version 2 only*
.. option:: --disable
List disabled networks
*Network version 2 only*
.. option:: --project <project>
List networks according to their project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --share
List networks shared between projects
*Network version 2 only*
.. option:: --no-share
List networks not shared between projects
*Network version 2 only*
.. option:: --status <status>
List networks according to their status
('ACTIVE', 'BUILD', 'DOWN', 'ERROR')
.. option:: --provider-network-type <provider-network-type>
List networks according to their physical mechanisms.
The supported options are: flat, geneve, gre, local, vlan, vxlan.
*Network version 2 only*
.. option:: --provider-physical-network <provider-physical-network>
List networks according to name of the physical network
*Network version 2 only*
.. option:: --provider-segment <provider-segment>
List networks according to VLAN ID for VLAN networks
or Tunnel ID for GENEVE/GRE/VXLAN networks
*Network version 2 only*
.. option:: --agent <agent-id>
List networks hosted by agent (ID only)
*Network version 2 only*
.. option:: --tags <tag>[,<tag>,...]
List networks which have all given tag(s)
*Network version 2 only*
.. option:: --any-tags <tag>[,<tag>,...]
List networks which have any given tag(s)
*Network version 2 only*
.. option:: --not-tags <tag>[,<tag>,...]
Exclude networks which have all given tag(s)
*Network version 2 only*
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude networks which have any given tag(s)
*Network version 2 only*
network set
-----------
Set network properties
*Network version 2 only*
.. program:: network set
.. code:: bash
openstack network set
[--name <name>]
[--enable | --disable]
[--share | --no-share]
[--description <description>]
[--mtu <mtu>]
[--enable-port-security | --disable-port-security]
[--external [--default | --no-default] | --internal]
[--provider-network-type <provider-network-type>]
[--provider-physical-network <provider-physical-network>]
[--provider-segment <provider-segment>]
[--qos-policy <qos-policy> | --no-qos-policy]
[--dns-domain <dns-domain>]
[--tag <tag>] [--no-tag]
<network>
.. option:: --name <name>
Set network name
.. option:: --enable
Enable network
.. option:: --disable
Disable network
.. option:: --share
Share the network between projects
.. option:: --no-share
Do not share the network between projects
.. option:: --description <description>
Set network description
.. option:: --mtu <mtu>
Set network mtu
.. option:: --enable-port-security
Enable port security by default for ports created on
this network
.. option:: --disable-port-security
Disable port security by default for ports created on
this network
.. option:: --external
Set this network as an external network.
(external-net extension required)
.. option:: --internal
Set this network as an internal network
.. option:: --default
Set the network as the default external network
.. option:: --no-default
Do not use the network as the default external network.
.. option:: --provider-network-type <provider-network-type>
The physical mechanism by which the virtual network is implemented.
The supported options are: flat, gre, local, vlan, vxlan.
.. option:: --provider-physical-network <provider-physical-network>
Name of the physical network over which the virtual network is implemented
.. option:: --provider-segment <provider-segment>
VLAN ID for VLAN networks or Tunnel ID for GRE/VXLAN networks
.. option:: --qos-policy <qos-policy>
QoS policy to attach to this network (name or ID)
.. option:: --no-qos-policy
Remove the QoS policy attached to this network
.. option:: --dns-domain <dns-domain>
Set DNS domain for this network (requires DNS integration extension).
.. option:: --tag <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:: <network>
Network to modify (name or ID)
network show
------------
Display network details
.. program:: network show
.. code:: bash
openstack network show
<network>
.. _network_show-network:
.. describe:: <network>
Network to display (name or ID)
network unset
-------------
Unset network properties
*Network version 2 only*
.. program:: network unset
.. code:: bash
openstack network unset
[--tag <tag> | --all-tag]
<network>
.. option:: --tag <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>
Network to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network unset

View File

@ -10,159 +10,5 @@ administrator to control the segment ranges globally or on a per-tenant basis.
Network v2
network segment range create
----------------------------
Create new network segment range
.. program:: network segment range create
.. code:: bash
openstack network segment range create
(--private | --shared)
[--project <project> [--project-domain <project-domain>]]
--network-type <network-type>
[--physical-network <physical-network-name>]
--minimum <minimum-segmentation-id>
--maximum <maximum-segmentation-id>
<name>
.. option:: --private
Network segment range is assigned specifically to the project
.. option:: --shared
Network segment range is shared with other projects
.. option:: --project <project>
Network segment range owner (name or ID). Optional when the segment
range is shared
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --physical-network <physical-network-name>
Physical network name of this network segment range
.. option:: --network-type <network-type>
Network type of this network segment range
(geneve, gre, vlan or vxlan)
.. option:: --minimum <minimum-segmentation-id>
Minimum segment identifier for this network segment range which is based
on the network type, VLAN ID for vlan network type and tunnel ID for
geneve, gre and vxlan network types
.. option:: --maximum <maximum-segmentation-id>
Maximum segment identifier for this network segment range which is based
on the network type, VLAN ID for vlan network type and tunnel ID for
geneve, gre and vxlan network types
.. _network_segment_range_create-name:
.. describe:: <name>
Name of new network segment range
network segment range delete
----------------------------
Delete network segment range(s)
.. program:: network segment range delete
.. code:: bash
openstack network segment range delete
<network-segment-range> [<network-segment-range> ...]
.. _network_segment_range_delete-network-segment-range:
.. describe:: <network-segment-range>
Network segment range (s) to delete (name or ID)
network segment range list
--------------------------
List network segment ranges
.. program:: network segment range list
.. code:: bash
openstack network segment range list
[--long]
[--used | --unused]
[--available | --unavailable]
.. option:: --long
List additional fields in output
.. option:: --used
List network segment ranges that have segments in use
.. option:: --unused
List network segment ranges that do not have segments not in use
.. option:: --available
List network segment ranges that have available segments
.. option:: --unavailable
List network segment ranges without available segments
network segment range set
-------------------------
Set network segment range properties
.. program:: network segment range set
.. code:: bash
openstack network segment range set
[--name <name>]
[--minimum <minimum-segmentation-id>]
[--maximum <maximum-segmentation-id>]
<network-segment-range>
.. option:: --name <name>
Set network segment range name
.. option:: --minimum <minimum-segmentation-id>
Set network segment range minimum segment identifier
.. option:: --maximum <maximum-segmentation-id>
Set network segment range maximum segment identifier
.. _network_segment_range_set-network-segment-range:
.. describe:: <network-segment-range>
Network segment range to modify (name or ID)
network segment range show
--------------------------
Display network segment range details
.. program:: network segment range show
.. code:: bash
openstack network segment range show
<network-segment-range>
.. _network_segment_range_show-network-segment-range:
.. describe:: <network-segment-range>
Network segment range to display (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: network segment range *

View File

@ -8,486 +8,5 @@ configuration, such as the MAC and IP addresses to be used on that port.
Network v2
port create
-----------
Create new port
.. program:: port create
.. code:: bash
openstack port create
--network <network>
[--description <description>]
[--fixed-ip subnet=<subnet>,ip-address=<ip-address> | --no-fixed-ip]
[--device <device-id>]
[--device-owner <device-owner>]
[--vnic-type <vnic-type>]
[--binding-profile <binding-profile>]
[--host <host-id>]
[--enable | --disable]
[--enable-uplink-status-propagation | --disable-uplink-status-propagation]
[--mac-address <mac-address>]
[--security-group <security-group> | --no-security-group]
[--dns-domain <dns-domain>]
[--dns-name <dns-name>]
[--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]]
[--qos-policy <qos-policy>]
[--project <project> [--project-domain <project-domain>]]
[--enable-port-security | --disable-port-security]
[--tag <tag> | --no-tag]
<name>
.. option:: --network <network>
Network this port belongs to (name or ID)
.. option:: --description <description>
Description of this port
.. option:: --fixed-ip subnet=<subnet>,ip-address=<ip-address>
Desired IP and/or subnet for this port (name or ID):
subnet=<subnet>,ip-address=<ip-address>
(repeat option to set multiple fixed IP addresses)
.. option:: --no-fixed-ip
No IP or subnet for this port
.. option:: --device <device-id>
Port device ID
.. option:: --device-owner <device-owner>
Device owner of this port. This is the entity that uses
the port (for example, network:dhcp).
.. option:: --vnic-type <vnic-type>
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal |
virtio-forwarder, default: normal)
.. option:: --binding-profile <binding-profile>
Custom data to be passed as binding:profile. Data may
be passed as <key>=<value> or JSON.
(repeat option to set multiple binding:profile data)
.. option:: --host <host-id>
Allocate port on host ``<host-id>`` (ID only)
.. option:: --enable
Enable port (default)
.. option:: --disable
Disable port
.. option:: --enable-uplink-status-propagation
Enable uplink status propagate
.. option:: --disable-uplink-status-propagation
Disable uplink status propagate (default)
.. option:: --mac-address <mac-address>
MAC address of this port
.. option:: --security-group <security-group>
Security group to associate with this port (name or ID)
(repeat option to set multiple security groups)
.. option:: --no-security-group
Associate no security groups with this port
.. option:: --dns-domain <dns-name>
Set DNS domain for this port
(requires dns_domain for ports extension)
.. option:: --dns-name <dns-name>
Set DNS name for this port
(requires DNS integration extension)
.. option:: --allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]
Add allowed-address pair associated with this port:
ip-address=<ip-address>[,mac-address=<mac-address>]
(repeat option to set multiple allowed-address pairs)
.. option:: --qos-policy <qos-policy>
Attach QoS policy to this port (name or ID)
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --enable-port-security
Enable port security for this port (Default)
.. option:: --disable-port-security
Disable port security for this port
.. option:: --tag <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:: <name>
Name of this port
port delete
-----------
Delete port(s)
.. program:: port delete
.. code:: bash
openstack port delete
<port> [<port> ...]
.. _port_delete-port:
.. describe:: <port>
Port(s) to delete (name or ID)
port list
---------
List ports
.. program:: port list
.. code:: bash
openstack port list
[--device-owner <device-owner>]
[--router <router> | --server <server> | --device-id <device-id>]
[--network <network>]
[--mac-address <mac-address>]
[--fixed-ip subnet=<subnet>,ip-address=<ip-address>,ip-substring=<ip-substring>]
[--long]
[--project <project> [--project-domain <project-domain>]]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --device-owner <device-owner>
List only ports with the specified device owner. This is
the entity that uses the port (for example, network:dhcp).
.. option:: --router <router>
List only ports attached to this router (name or ID)
.. option:: --server <server>
List only ports attached to this server (name or ID)
.. option:: --device-id <device-id>
List only ports with the specified device ID
.. option:: --network <network>
List only ports attached to this network (name or ID)
.. option:: --mac-address <mac-address>
List only ports with this MAC address
.. option:: --fixed-ip subnet=<subnet>,ip-address=<ip-address>,ip-substring=<ip-substring>
Desired IP address, IP address substring and/or subnet (name or ID) for
filtering ports:
subnet=<subnet>,ip-address=<ip-address>,ip-substring=<ip-substring>
(repeat option to set multiple fixed IP addresses)
.. option:: --long
List additional fields in output
.. option:: --project <project>
List ports according to their project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --tags <tag>[,<tag>,...]
List ports which have all given tag(s)
.. option:: --any-tags <tag>[,<tag>,...]
List ports which have any given tag(s)
.. option:: --not-tags <tag>[,<tag>,...]
Exclude ports which have all given tag(s)
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude ports which have any given tag(s)
port set
--------
Set port properties
.. program:: port set
.. code:: bash
openstack port set
[--description <description>]
[--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
[--no-fixed-ip]
[--device <device-id>]
[--device-owner <device-owner>]
[--vnic-type <vnic-type>]
[--binding-profile <binding-profile>]
[--no-binding-profile]
[--host <host-id>]
[--qos-policy <qos-policy>]
[--enable | --disable]
[--name <name>]
[--mac-address <mac-address>]
[--security-group <security-group>]
[--no-security-group]
[--enable-port-security | --disable-port-security]
[--dns-domain <dns-domain>]
[--dns-name <dns-name>]
[--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]]
[--no-allowed-address]
[--data-plane-status <status>]
[--tag <tag>] [--no-tag]
<port>
.. option:: --description <description>
Description of this port
.. option:: --fixed-ip subnet=<subnet>,ip-address=<ip-address>
Desired IP and/or subnet for this port (name or ID):
subnet=<subnet>,ip-address=<ip-address>
(repeat option to set multiple fixed IP addresses)
.. option:: --no-fixed-ip
Clear existing information of fixed IP addresses.
Specify both :option:`--fixed-ip` and :option:`--no-fixed-ip`
to overwrite the current fixed IP addresses.
.. option:: --device <device-id>
Port device ID
.. option:: --device-owner <device-owner>
Device owner of this port. This is the entity that uses
the port (for example, network:dhcp).
.. option:: --vnic-type <vnic-type>
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal |
virtio-forwarder, default: normal)
.. option:: --binding-profile <binding-profile>
Custom data to be passed as binding:profile. Data may
be passed as <key>=<value> or JSON.
(repeat option to set multiple binding:profile data)
.. option:: --no-binding-profile
Clear existing information of binding:profile.
Specify both :option:`--binding-profile` and :option:`--no-binding-profile`
to overwrite the current binding:profile information.
.. option:: --host <host-id>
Allocate port on host ``<host-id>`` (ID only)
.. option:: --qos-policy <qos-policy>
Attach QoS policy to this port (name or ID)
.. option:: --enable
Enable port
.. option:: --disable
Disable port
.. option:: --name
Set port name
.. option:: --mac-address
Set port's MAC address (admin only)
.. option:: --security-group <security-group>
Security group to associate with this port (name or ID)
(repeat option to set multiple security groups)
.. option:: --no-security-group
Clear existing security groups associated with this port
.. option:: --enable-port-security
Enable port security for this port
.. option:: --disable-port-security
Disable port security for this port
.. option:: --dns-domain <dns-domain>
Set DNS domain for this port
(requires dns_domain for ports extension)
.. option:: --dns-name <dns-name>
Set DNS name for this port
(requires DNS integration extension)
.. option:: --allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]
Add allowed-address pair associated with this port:
ip-address=<ip-address>[,mac-address=<mac-address>]
(repeat option to set multiple allowed-address pairs)
.. option:: --no-allowed-address
Clear existing allowed-address pairs associated
with this port.
(Specify both --allowed-address and --no-allowed-address
to overwrite the current allowed-address pairs)
.. option:: --data-plane-status
Set data plane status of this port (ACTIVE | DOWN).
Unset it to None with the 'port unset' command
(requires data plane status extension)
.. option:: --tag <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:: <port>
Port to modify (name or ID)
port show
---------
Display port details
.. program:: port show
.. code:: bash
openstack port show
<port>
.. _port_show-port:
.. describe:: <port>
Port to display (name or ID)
port unset
----------
Unset port properties
.. program:: port unset
.. code:: bash
openstack port unset
[--fixed-ip subnet=<subnet>,ip-address=<ip-address> [...]]
[--binding-profile <binding-profile-key> [...]]
[--security-group <security-group> [...]]
[--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>] [...]]
[--qos-policy]
[--data-plane-status]
[--tag <tag> | --all-tag]
<port>
.. option:: --fixed-ip subnet=<subnet>,ip-address=<ip-address>
Desired IP and/or subnet which should be removed
from this port (name or ID): subnet=<subnet>,ip-address=<ip-address>
(repeat option to unset multiple fixed IP addresses)
.. option:: --binding-profile <binding-profile-key>
Desired key which should be removed from binding-profile
(repeat option to unset multiple binding:profile data)
.. option:: --security-group <security-group>
Security group which should be removed from this port (name or ID)
(repeat option to unset multiple security groups)
.. option:: --allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]
Desired allowed-address pair which should be removed from this port:
ip-address=<ip-address>[,mac-address=<mac-address>]
(repeat option to unset multiple allowed-address pairs)
.. option:: --qos-policy
Remove the QoS policy attached to the port
.. option:: --data-plane-status
Clear existing information of data plane status
.. option:: --tag <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:: <port>
Port to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: port *

View File

@ -8,402 +8,5 @@ network access for servers on project networks.
Network v2
router add port
---------------
Add a port to a router
.. program:: router add port
.. code:: bash
openstack router add port
<router>
<port>
.. _router_add_port:
.. describe:: <router>
Router to which port will be added (name or ID)
.. describe:: <port>
Port to be added (name or ID)
router add subnet
-----------------
Add a subnet to a router
.. program:: router add subnet
.. code:: bash
openstack router add subnet
<router>
<subnet>
.. _router_add_subnet:
.. describe:: <router>
Router to which subnet will be added (name or ID)
.. describe:: <subnet>
Subnet to be added (name or ID)
router create
-------------
Create new router
.. program:: router create
.. code:: bash
openstack router create
[--project <project> [--project-domain <project-domain>]]
[--enable | --disable]
[--distributed | --centralized]
[--ha | --no-ha]
[--description <description>]
[--availability-zone-hint <availability-zone>]
[--tag <tag> | --no-tag]
<name>
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --enable
Enable router (default)
.. option:: --disable
Disable router
.. option:: --distributed
Create a distributed router
The default router type (distributed vs centralized) is determined by a
configuration setting in the OpenStack deployment. Since we are unable
to know that default wihtout attempting to actually create a router it
is suggested to use either :option:`--distributed` or :option:`--centralized`
in situations where multiple cloud deployments may be used.
.. option:: --centralized
Create a centralized router
See the note in :option:`--distributed` regarding the default used when
creating a new router.
.. option:: --ha
Create a highly available router
.. option:: --no-ha
Create a legacy router
.. option:: --description <description>
Set router description
.. option:: --availability-zone-hint <availability-zone>
Availability Zone in which to create this router
(Router Availability Zone extension required,
repeat option to set multiple availability zones)
.. option:: --tag <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:: <name>
New router name
router delete
-------------
Delete router(s)
.. program:: router delete
.. code:: bash
openstack router delete
<router> [<router> ...]
.. _router_delete-router:
.. describe:: <router>
Router(s) to delete (name or ID)
router list
-----------
List routers
.. program:: router list
.. code:: bash
openstack router list
[--name <name>]
[--enable | --disable]
[--long]
[--project <project> [--project-domain <project-domain>]]
[--agent <agent-id>]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --agent <agent-id>
List routers hosted by an agent (ID only)
.. option:: --long
List additional fields in output
.. option:: --name <name>
List routers according to their name
.. option:: --enable
List enabled routers
.. option:: --disable
List disabled routers
.. option:: --project <project>
List routers according to their project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --tags <tag>[,<tag>,...]
List routers which have all given tag(s)
.. option:: --any-tags <tag>[,<tag>,...]
List routers which have any given tag(s)
.. option:: --not-tags <tag>[,<tag>,...]
Exclude routers which have all given tag(s)
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude routers which have any given tag(s)
router remove port
------------------
Remove a port from a router
.. program:: router remove port
.. code:: bash
openstack router remove port
<router>
<port>
.. _router_remove_port:
.. describe:: <router>
Router from which port will be removed (name or ID)
.. describe:: <port>
Port to be removed and deleted (name or ID)
router remove subnet
--------------------
Remove a subnet from a router
.. program:: router remove subnet
.. code:: bash
openstack router remove subnet
<router>
<subnet>
.. _router_remove_subnet:
.. describe:: <router>
Router from which subnet will be removed (name or ID)
.. describe:: <subnet>
Subnet to be removed (name or ID)
router set
----------
Set router properties
.. program:: router set
.. code:: bash
openstack router set
[--name <name>]
[--enable | --disable]
[--distributed | --centralized]
[--description <description>]
[--route destination=<subnet>,gateway=<ip-address> | --no-route]
[--ha | --no-ha]
[--external-gateway <network> [--enable-snat|--disable-snat] [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]]
[--tag <tag>] [--no-tag]
<router>
.. option:: --name <name>
Set router name
.. option:: --enable
Enable router
.. option:: --disable
Disable router
.. option:: --distributed
Set router to distributed mode (disabled router only)
.. option:: --centralized
Set router to centralized mode (disabled router only)
.. option:: --description <description>
Set router description
.. option:: --route destination=<subnet>,gateway=<ip-address>
Routes associated with the router
destination: destination subnet (in CIDR notation)
gateway: nexthop IP address
(repeat option to set multiple routes)
.. option:: --no-route
Clear routes associated with the router.
Specify both --route and --no-route to overwrite
current value of route.
.. option:: --ha
Set the router as highly available (disabled router only)
.. option:: --no-ha
Clear high availablability attribute of the router (disabled router only)
.. option:: --external-gateway <network>
External Network used as router's gateway (name or ID)
.. option:: --enable-snat
Enable Source NAT on external gateway
.. option:: --disable-snat
Disable Source NAT on external gateway
.. option:: --fixed-ip subnet=<subnet>,ip-address=<ip-address>
Desired IP and/or subnet (name or ID) on external gateway:
subnet=<subnet>,ip-address=<ip-address>
(repeat option to set multiple fixed IP addresses)
.. option:: --tag <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:: <router>
Router to modify (name or ID)
router show
-----------
Display router details
.. program:: router show
.. code:: bash
openstack router show
<router>
.. _router_show-router:
.. describe:: <router>
Router to display (name or ID)
router unset
------------
Unset router properties
.. program:: router unset
.. code:: bash
openstack router unset
[--route destination=<subnet>,gateway=<ip-address>]
[--external-gateway]
[--tag <tag> | --all-tag]
<router>
.. option:: --route destination=<subnet>,gateway=<ip-address>
Routes to be removed from the router
destination: destination subnet (in CIDR notation)
gateway: nexthop IP address
(repeat option to unset multiple routes)
.. option:: --external-gateway
Remove external gateway information from the router
.. option:: --tag <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:: <router>
Router to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: router *

View File

@ -7,194 +7,5 @@ and other resources on the network.
Compute v2, Network v2
security group rule create
--------------------------
Create a new security group rule
.. program:: security group rule create
.. code:: bash
openstack security group rule create
[--remote-ip <ip-address> | --remote-group <group>]
[--dst-port <port-range> | [--icmp-type <icmp-type> [--icmp-code <icmp-code>]]]
[--protocol <protocol>]
[--ingress | --egress]
[--ethertype <ethertype>]
[--project <project> [--project-domain <project-domain>]]
[--description <description>]
<group>
.. option:: --remote-ip <ip-address>
Remote IP address block (may use CIDR notation;
default for IPv4 rule: 0.0.0.0/0,
default for IPv6 rule: ::/0)
.. option:: --remote-group <group>
Remote security group (name or ID)
.. option:: --dst-port <port-range>
Destination port, may be a single port or a starting and
ending port range: 137:139. Required for IP protocols TCP
and UDP. Ignored for ICMP IP protocols.
.. option:: --icmp-type <icmp-type>
ICMP type for ICMP IP protocols
*Network version 2 only*
.. option:: --icmp-code <icmp-code>
ICMP code for ICMP IP protocols
*Network version 2 only*
.. option:: --protocol <protocol>
IP protocol (icmp, tcp, udp; default: tcp)
*Compute version 2*
IP protocol (ah, dccp, egp, esp, gre, icmp, igmp,
ipv6-encap, ipv6-frag, ipv6-icmp, ipv6-nonxt,
ipv6-opts, ipv6-route, ospf, pgm, rsvp, sctp, tcp,
udp, udplite, vrrp and integer representations [0-255]
or any; default: any (all protocols))
*Network version 2*
.. option:: --ingress
Rule applies to incoming network traffic (default)
*Network version 2 only*
.. option:: --egress
Rule applies to outgoing network traffic
*Network version 2 only*
.. option:: --ethertype <ethertype>
Ethertype of network traffic
(IPv4, IPv6; default: based on IP protocol)
*Network version 2 only*
.. option:: --project <project>
Owner's project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --description <description>
Set security group rule description
*Network version 2 only*
.. describe:: <group>
Create rule in this security group (name or ID)
security group rule delete
--------------------------
Delete security group rule(s)
.. program:: security group rule delete
.. code:: bash
openstack security group rule delete
<rule> [<rule> ...]
.. describe:: <rule>
Security group rule(s) to delete (ID only)
security group rule list
------------------------
List security group rules
.. program:: security group rule list
.. code:: bash
openstack security group rule list
[--all-projects]
[--protocol <protocol>]
[--ethertype <ethertype>]
[--ingress | --egress]
[--long]
[<group>]
.. option:: --all-projects
Display information from all projects (admin only)
*Network version 2 ignores this option and will always display information*
*for all projects (admin only).*
.. option:: --long
List additional fields in output
*Compute version 2 does not have additional fields to display.*
.. option:: --protocol
List rules by the IP protocol (ah, dhcp, egp, esp, gre, icmp, igmp,
ipv6-encap, ipv6-frag, ipv6-icmp, ipv6-nonxt,ipv6-opts, ipv6-route,
ospf, pgm, rsvp, sctp, tcp, udp, udplite, vrrp and integer
representations [0-255] or any; default: any (all protocols))
*Network version 2*
.. option:: --ethertype
List rules by the Ethertype (IPv4 or IPv6)
*Network version 2*
.. option:: --ingress
List rules applied to incoming network traffic
*Network version 2 only*
.. option:: --egress
List rules applied to outgoing network traffic
*Network version 2 only*
.. describe:: <group>
List all rules in this security group (name or ID)
security group rule show
------------------------
Display security group rule details
.. program:: security group rule show
.. code:: bash
openstack security group rule show
<rule>
.. describe:: <rule>
Security group rule to display (ID only)
.. autoprogram-cliff:: openstack.network.v2
:command: security group rule *

View File

@ -8,197 +8,23 @@ which specify the network access rules.
Compute v2, Network v2
security group create
---------------------
.. NOTE(efried): have to list these out one by one; 'security group *' pulls in
... rule *.
Create a new security group
.. autoprogram-cliff:: openstack.network.v2
:command: security group create
.. program:: security group create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: security group delete
openstack security group create
[--description <description>]
[--project <project> [--project-domain <project-domain>]]
[--tag <tag> | --no-tag]
<name>
.. autoprogram-cliff:: openstack.network.v2
:command: security group list
.. option:: --description <description>
.. autoprogram-cliff:: openstack.network.v2
:command: security group set
Security group description
.. autoprogram-cliff:: openstack.network.v2
:command: security group show
.. option:: --project <project>
Owner's project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --tag <tag>
Tag to be added to the security group (repeat option to set multiple tags)
*Network version 2 only*
.. option:: --no-tag
No tags associated with the security group
*Network version 2 only*
.. describe:: <name>
New security group name
security group delete
---------------------
Delete security group(s)
.. program:: security group delete
.. code:: bash
openstack security group delete
<group> [<group> ...]
.. describe:: <group>
Security group(s) to delete (name or ID)
security group list
-------------------
List security groups
.. program:: security group list
.. code:: bash
openstack security group list
[--all-projects]
[--project <project> [--project-domain <project-domain>]]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --all-projects
Display information from all projects (admin only)
*Network version 2 ignores this option and will always display information*
*for all projects (admin only).*
.. option:: --project <project>
List security groups according to the project (name or ID)
*Network version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Network version 2 only*
.. option:: --tags <tag>[,<tag>,...]
List security groups which have all given tag(s)
*Network version 2 only*
.. option:: --any-tags <tag>[,<tag>,...]
List security groups which have any given tag(s)
*Network version 2 only*
.. option:: --not-tags <tag>[,<tag>,...]
Exclude security groups which have all given tag(s)
*Network version 2 only*
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude security groups which have any given tag(s)
*Network version 2 only*
security group set
------------------
Set security group properties
.. program:: security group set
.. code:: bash
openstack security group set
[--name <new-name>]
[--description <description>]
[--tag <tag>] [--no-tag]
<group>
.. option:: --name <new-name>
New security group name
.. option:: --description <description>
New security group description
.. option:: --tag <tag>
Tag to be added to the security group (repeat option to set multiple tags)
.. option:: --no-tag
Clear tags associated with the security group. Specify both --tag
and --no-tag to overwrite current tags
.. describe:: <group>
Security group to modify (name or ID)
security group show
-------------------
Display security group details
.. program:: security group show
.. code:: bash
openstack security group show
<group>
.. describe:: <group>
Security group to display (name or ID)
security group unset
--------------------
Unset security group properties
.. program:: security group unset
.. code:: bash
openstack security group unset
[--tag <tag> | --all-tag]
<group>
.. option:: --tag <tag>
Tag to be removed from the security group
(repeat option to remove multiple tags)
.. option:: --all-tag
Clear all tags associated with the security group
.. describe:: <group>
Security group to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: security group unset

View File

@ -7,304 +7,5 @@ that are available for IP address allocation.
Network v2
subnet pool create
------------------
Create subnet pool
.. program:: subnet pool create
.. code:: bash
openstack subnet pool create
[--default-prefix-length <default-prefix-length>]
[--min-prefix-length <min-prefix-length>]
[--max-prefix-length <max-prefix-length>]
[--description <description>]
[--project <project> [--project-domain <project-domain>]]
[--address-scope <address-scope>]
[--default | --no-default]
[--share | --no-share]
[--default-quota <num-ip-addresses>]
[--tag <tag> | --no-tag]
--pool-prefix <pool-prefix> [...]
<name>
.. option:: --default-prefix-length <default-prefix-length>
Set subnet pool default prefix length
.. option:: --min-prefix-length <min-prefix-length>
Set subnet pool minimum prefix length
.. option:: --max-prefix-length <max-prefix-length>
Set subnet pool maximum prefix length
.. option:: --description <description>
Set subnet pool description
.. option:: --project <project>
Owner's project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID). This can be used in case
collisions between project names exist.
.. option:: --address-scope <address-scope>
Set address scope associated with the subnet pool (name or ID),
prefixes must be unique across address scopes
.. option:: --default
Set this as a default subnet pool
.. option:: --no-default
Set this as a non-default subnet pool
.. option:: --share
Set this subnet pool as shared
.. option:: --no-share
Set this subnet pool as not shared
.. option:: --default-quota <num-ip-addresses>
Set default per-project quota for this subnet pool as the number of
IP addresses that can be allocated from the subnet pool
.. option:: --tag <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 <pool-prefix>
Set subnet pool prefixes (in CIDR notation)
(repeat option to set multiple prefixes)
.. _subnet_pool_create-name:
.. describe:: <name>
Name of the new subnet pool
subnet pool delete
------------------
Delete subnet pool(s)
.. program:: subnet pool delete
.. code:: bash
openstack subnet pool delete
<subnet-pool> [<subnet-pool> ...]
.. _subnet_pool_delete-subnet-pool:
.. describe:: <subnet-pool>
Subnet pool(s) to delete (name or ID)
subnet pool list
----------------
List subnet pools
.. program:: subnet pool list
.. code:: bash
openstack subnet pool list
[--long]
[--share | --no-share]
[--default | --no-default]
[--project <project> [--project-domain <project-domain>]]
[--name <name>]
[--address-scope <address-scope>]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --long
List additional fields in output
.. option:: --share
List subnet pools shared between projects
.. option:: --no-share
List subnet pools not shared between projects
.. option:: --default
List subnet pools used as the default external subnet pool
.. option:: --no-default
List subnet pools not used as the default external subnet pool
.. option:: --project <project>
List subnet pools according to their project (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --name <name>
List only subnet pools of given name in output
.. option:: --address-scope <address-scope>
List only subnet pools of given address scope in output (name or ID)
.. option:: --tags <tag>[,<tag>,...]
List subnet pools which have all given tag(s)
.. option:: --any-tags <tag>[,<tag>,...]
List subnet pools which have any given tag(s)
.. option:: --not-tags <tag>[,<tag>,...]
Exclude subnet pools which have all given tag(s)
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude subnet pools which have any given tag(s)
subnet pool set
---------------
Set subnet pool properties
.. program:: subnet pool set
.. code:: bash
openstack subnet pool set
[--name <name>]
[--pool-prefix <pool-prefix> [...]]
[--default-prefix-length <default-prefix-length>]
[--min-prefix-length <min-prefix-length>]
[--max-prefix-length <max-prefix-length>]
[--address-scope <address-scope> | --no-address-scope]
[--default | --no-default]
[--description <description>]
[--default-quota <num-ip-addresses>]
[--tag <tag>] [--no-tag]
<subnet-pool>
.. option:: --name <name>
Set subnet pool name
.. option:: --pool-prefix <pool-prefix>
Set subnet pool prefixes (in CIDR notation)
(repeat option to set multiple prefixes)
.. option:: --default-prefix-length <default-prefix-length>
Set subnet pool default prefix length
.. option:: --min-prefix-length <min-prefix-length>
Set subnet pool minimum prefix length
.. option:: --max-prefix-length <max-prefix-length>
Set subnet pool maximum prefix length
.. option:: --address-scope <address-scope>
Set address scope associated with the subnet pool (name or ID),
prefixes must be unique across address scopes
.. option:: --no-address-scope
Remove address scope associated with the subnet pool
.. option:: --default
Set this as a default subnet pool
.. option:: --no-default
Set this as a non-default subnet pool
.. option:: --description <description>
Set subnet pool description
.. option:: --default-quota <num-ip-addresses>
Set default per-project quota for this subnet pool as the number of
IP addresses that can be allocated from the subnet pool
.. option:: --tag <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:: <subnet-pool>
Subnet pool to modify (name or ID)
subnet pool show
----------------
Display subnet pool details
.. program:: subnet pool show
.. code:: bash
openstack subnet pool show
<subnet-pool>
.. _subnet_pool_show-subnet-pool:
.. describe:: <subnet-pool>
Subnet pool to display (name or ID)
subnet pool unset
-----------------
Unset subnet pool properties
.. program:: subnet pool unset
.. code:: bash
openstack subnet pool unset
[--tag <tag> | --all-tag]
<subnet-pool>
.. option:: --tag <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:: <subnet-pool>
Subnet pool to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: subnet pool *

View File

@ -8,427 +8,23 @@ network.
Network v2
subnet create
-------------
.. NOTE(efried): have to list these out one by one; 'subnet *' pulls in
subnet pool *.
Create new subnet
.. autoprogram-cliff:: openstack.network.v2
:command: subnet create
.. program:: subnet create
.. code:: bash
.. autoprogram-cliff:: openstack.network.v2
:command: subnet delete
openstack subnet create
[--project <project> [--project-domain <project-domain>]]
[--subnet-pool <subnet-pool> | --use-default-subnet-pool [--prefix-length <prefix-length>] | --use-prefix-delegation]
[--subnet-range <subnet-range>]
[--allocation-pool start=<ip-address>,end=<ip-address>]
[--dhcp | --no-dhcp]
[--dns-nameserver <dns-nameserver>]
[--gateway <gateway>]
[--host-route destination=<subnet>,gateway=<ip-address>]
[--ip-version {4,6}]
[--description <description>]
[--ipv6-ra-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
[--ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
[--network-segment <network-segment>]
[--service-type <service-type>]
[--tag <tag> | --no-tag]
--network <network>
<name>
.. autoprogram-cliff:: openstack.network.v2
:command: subnet list
.. option:: --project <project>
.. autoprogram-cliff:: openstack.network.v2
:command: subnet set
Owner's project (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: subnet show
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --subnet-pool <subnet-pool>
Subnet pool from which this subnet will obtain a CIDR (name or ID)
.. option:: --use-prefix-delegation
Use 'prefix-delegation' if IP is IPv6 format and IP would be delegated
externally
.. option:: --use-default-subnet-pool
Use default subnet pool for :option:`--ip-version`
.. option:: --prefix-length <prefix-length>
Prefix length for subnet allocation from subnet pool
.. option:: --subnet-range <subnet-range>
Subnet range in CIDR notation
(required if :option:`--subnet-pool` is not specified, optional otherwise)
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
Allocation pool IP addresses for this subnet e.g.:
``start=192.168.199.2,end=192.168.199.254``
(repeat option to add multiple IP addresses)
.. option:: --dhcp
Enable DHCP (default)
.. option:: --no-dhcp
Disable DHCP
.. option:: --dns-nameserver <dns-nameserver>
DNS server for this subnet (repeat option to set multiple DNS servers)
.. option:: --gateway <gateway>
Specify a gateway for the subnet. The three options are:
<ip-address>: Specific IP address to use as the gateway,
'auto': Gateway address should automatically be chosen from
within the subnet itself, 'none': This subnet will not use
a gateway, e.g.: ``--gateway 192.168.9.1``, ``--gateway auto``,
``--gateway none`` (default is 'auto').
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
Additional route for this subnet e.g.:
``destination=10.10.0.0/16,gateway=192.168.71.254``
destination: destination subnet (in CIDR notation)
gateway: nexthop IP address
(repeat option to add multiple routes)
.. option:: --ip-version {4,6}
IP version (default is 4). Note that when subnet pool is specified,
IP version is determined from the subnet pool and this option
is ignored.
.. option:: --description <description>
Set subnet description
.. option:: --ipv6-ra-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}
IPv6 RA (Router Advertisement) mode,
valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]
.. option:: --ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}
IPv6 address mode, valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]
.. option:: --network-segment <network-segment>
Network segment to associate with this subnet (name or ID)
.. option:: --service-type <service-type>
Service type for this subnet e.g.:
``network:floatingip_agent_gateway``.
Must be a valid device owner value for a network port
(repeat option to set multiple service types)
.. option:: --tag <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>
Network this subnet belongs to (name or ID)
.. _subnet_create-name:
.. describe:: <name>
Name of subnet to create
subnet delete
-------------
Delete subnet(s)
.. program:: subnet delete
.. code:: bash
openstack subnet delete
<subnet> [<subnet> ...]
.. _subnet_delete-subnet:
.. describe:: <subnet>
Subnet(s) to delete (name or ID)
subnet list
-----------
List subnets
.. program:: subnet list
.. code:: bash
openstack subnet list
[--long]
[--ip-version {4,6}]
[--dhcp | --no-dhcp]
[--project <project> [--project-domain <project-domain>]]
[--network <network>]
[--gateway <gateway>]
[--name <name>]
[--subnet-range <subnet-range>]
[--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
[--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
.. option:: --long
List additional fields in output
.. option:: --ip-version {4, 6}
List only subnets of given IP version in output.
Allowed values for IP version are 4 and 6.
.. option:: --dhcp
List subnets which have DHCP enabled
.. option:: --no-dhcp
List subnets which have DHCP disabled
.. option:: --service-type <service-type>
List only subnets of a given service type in output
e.g.: ``network:floatingip_agent_gateway``.
Must be a valid device owner value for a network port
(repeat option to list multiple service types)
.. option:: --project <project>
List only subnets which belong to a given project in output (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --network <network>
List only subnets which belong to a given network in output (name or ID)
.. option:: --gateway <gateway>
List only subnets of given gateway IP in output
.. option:: --name <name>
List only subnets of given name in output
.. option:: --subnet-range <subnet-range>
List only subnets of given subnet range (in CIDR notation) in output
e.g.: ``--subnet-range 10.10.0.0/16``
.. option:: --tags <tag>[,<tag>,...]
List subnets which have all given tag(s)
.. option:: --any-tags <tag>[,<tag>,...]
List subnets which have any given tag(s)
.. option:: --not-tags <tag>[,<tag>,...]
Exclude subnets which have all given tag(s)
.. option:: --not-any-tags <tag>[,<tag>,...]
Exclude subnets which have any given tag(s)
subnet set
----------
Set subnet properties
.. program:: subnet set
.. code:: bash
openstack subnet set
[--allocation-pool start=<ip-address>,end=<ip-address>]
[--no-allocation-pool]
[--dhcp | --no-dhcp]
[--dns-nameserver <dns-nameserver>]
[--no-dns-nameserver]
[--gateway <gateway-ip>]
[--network-segment <network-segment>]
[--host-route destination=<subnet>,gateway=<ip-address>]
[--no-host-route]
[--service-type <service-type>]
[--name <new-name>]
[--description <description>]
[--tag <tag>] [--no-tag]
<subnet>
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
Allocation pool IP addresses for this subnet e.g.:
``start=192.168.199.2,end=192.168.199.254``
(repeat option to add multiple IP addresses)
.. option:: --no-allocation-pool
Clear associated allocation pools from this subnet.
Specify both :option:`--allocation-pool` and :option:`--no-allocation-pool`
to overwrite the current allocation pool information.
.. option:: --dhcp
Enable DHCP
.. option:: --no-dhcp
Disable DHCP
.. option:: --dns-nameserver <dns-nameserver>
DNS server for this subnet (repeat option to set multiple DNS servers)
.. option:: --no-dns-nameservers
Clear existing information of DNS servers.
Specify both :option:`--dns-nameserver` and :option:`--no-dns-nameservers`
to overwrite the current DNS server information.
.. option:: --gateway <gateway>
Specify a gateway for the subnet. The options are:
<ip-address>: Specific IP address to use as the gateway,
'none': This subnet will not use a gateway,
e.g.: ``--gateway 192.168.9.1``, ``--gateway none``.
.. option:: --network-segment <network-segment>
Network segment to associate with this subnet (name or ID). It is only
allowed to set the segment if the current value is `None`, the network
must also have only one segment and only one subnet can exist on the
network.
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
Additional route for this subnet e.g.:
``destination=10.10.0.0/16,gateway=192.168.71.254``
destination: destination subnet (in CIDR notation)
gateway: nexthop IP address
.. option:: --no-host-route
Clear associated host routes from this subnet.
Specify both :option:`--host-route` and :option:`--no-host-route`
to overwrite the current host route information.
.. option:: --service-type <service-type>
Service type for this subnet e.g.:
``network:floatingip_agent_gateway``.
Must be a valid device owner value for a network port
(repeat option to set multiple service types)
.. option:: --description <description>
Set subnet description
.. option:: --name
Updated name of the subnet
.. option:: --tag <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:: <subnet>
Subnet to modify (name or ID)
subnet show
-----------
Display subnet details
.. program:: subnet show
.. code:: bash
openstack subnet show
<subnet>
.. _subnet_show-subnet:
.. describe:: <subnet>
Subnet to display (name or ID)
subnet unset
------------
Unset subnet properties
.. program:: subnet unset
.. code:: bash
openstack subnet unset
[--allocation-pool start=<ip-address>,end=<ip-address> [...]]
[--dns-nameserver <dns-nameserver> [...]]
[--host-route destination=<subnet>,gateway=<ip-address> [...]]
[--service-type <service-type>]
[--tag <tag> | --all-tag]
<subnet>
.. option:: --dns-nameserver <dns-nameserver>
DNS server to be removed from this subnet
(repeat option to unset multiple DNS servers)
.. option:: --allocation-pool start=<ip-address>,end=<ip-address>
Allocation pool IP addresses to be removed from this
subnet e.g.: ``start=192.168.199.2,end=192.168.199.254``
(repeat option to unset multiple allocation pools)
.. option:: --host-route destination=<subnet>,gateway=<ip-address>
Route to be removed from this subnet e.g.:
``destination=10.10.0.0/16,gateway=192.168.71.254``
destination: destination subnet (in CIDR notation)
gateway: nexthop IP address
(repeat option to unset multiple host routes)
.. option:: --service-type <service-type>
Service type to be removed from this subnet e.g.:
``network:floatingip_agent_gateway``.
Must be a valid device owner value for a network port
(repeat option to unset multiple service types)
.. option:: --tag <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:: <subnet>
Subnet to modify (name or ID)
.. autoprogram-cliff:: openstack.network.v2
:command: subnet unset

View File

@ -233,13 +233,13 @@ def add_group_domain_option_to_parser(parser):
)
def add_project_domain_option_to_parser(parser):
def add_project_domain_option_to_parser(parser, enhance_help=lambda _h: _h):
parser.add_argument(
'--project-domain',
metavar='<project-domain>',
help=_('Domain the project belongs to (name or ID). '
'This can be used in case collisions between project names '
'exist.'),
help=enhance_help(_('Domain the project belongs to (name or ID). This '
'can be used in case collisions between project '
'names exist.')),
)

View File

@ -34,6 +34,10 @@ _required_opt_extensions_map = {
'security_groups': 'security-groups',
}
_NET_TYPE_NEUTRON = 'neutron'
_NET_TYPE_COMPUTE = 'nova-network'
_QUALIFIER_FMT = "%s\n\n*%s*"
@contextlib.contextmanager
def check_missing_extension_if_error(client_manager, attrs):
@ -51,35 +55,87 @@ def check_missing_extension_if_error(client_manager, attrs):
@six.add_metaclass(abc.ABCMeta)
class NetworkAndComputeCommand(command.Command):
"""Network and Compute Command
class NetDetectionMixin(object):
"""Convenience methods for nova-network vs. neutron decisions.
Command class for commands that support implementation via
the network or compute endpoint. Such commands have different
implementations for take_action() and may even have different
arguments.
A live environment detects which network type it is running and creates its
parser with only the options relevant to that network type.
But the command classes are used for docs builds as well, and docs must
present the options for both network types, often qualified accordingly.
"""
@property
def _network_type(self):
"""Discover whether the running cloud is using neutron or nova-network.
def take_action(self, parsed_args):
if self.app.client_manager.is_network_endpoint_enabled():
return self.take_action_network(self.app.client_manager.network,
parsed_args)
else:
return self.take_action_compute(self.app.client_manager.compute,
parsed_args)
:return:
* ``NET_TYPE_NEUTRON`` if neutron is detected
* ``NET_TYPE_COMPUTE`` if running in a cloud but neutron is not
detected.
* ``None`` if not running in a cloud, which hopefully means we're
building docs.
"""
# Have we set it up yet for this command?
if not hasattr(self, '_net_type'):
# import pdb; pdb.set_trace()
try:
if self.app.client_manager.is_network_endpoint_enabled():
net_type = _NET_TYPE_NEUTRON
else:
net_type = _NET_TYPE_COMPUTE
except AttributeError:
LOG.warning(
"%s: Could not detect a network type. Assuming we are "
"building docs.", self.__class__.__name__)
net_type = None
self._net_type = net_type
return self._net_type
@property
def is_neutron(self):
return self._network_type is _NET_TYPE_NEUTRON
@property
def is_nova_network(self):
return self._network_type is _NET_TYPE_COMPUTE
@property
def is_docs_build(self):
return self._network_type is None
def enhance_help_neutron(self, _help):
if self.is_docs_build:
# Why can't we say 'neutron'?
return _QUALIFIER_FMT % (_help, _("Network version 2 only"))
return _help
def enhance_help_nova_network(self, _help):
if self.is_docs_build:
# Why can't we say 'nova-network'?
return _QUALIFIER_FMT % (_help, _("Compute version 2 only"))
return _help
@staticmethod
def split_help(network_help, compute_help):
return (
"*%(network_qualifier)s:*\n %(network_help)s\n\n"
"*%(compute_qualifier)s:*\n %(compute_help)s" % dict(
network_qualifier=_("Network version 2"),
network_help=network_help,
compute_qualifier=_("Compute version 2"),
compute_help=compute_help))
def get_parser(self, prog_name):
LOG.debug('get_parser(%s)', prog_name)
parser = super(NetworkAndComputeCommand, self).get_parser(prog_name)
parser = super(NetDetectionMixin, self).get_parser(prog_name)
parser = self.update_parser_common(parser)
LOG.debug('common parser: %s', parser)
if (
self.app is None or
self.app.client_manager.is_network_endpoint_enabled()
):
return self.update_parser_network(parser)
else:
return self.update_parser_compute(parser)
if self.is_neutron or self.is_docs_build:
parser = self.update_parser_network(parser)
if self.is_nova_network or self.is_docs_build:
# Add nova-net options if running nova-network or building docs
parser = self.update_parser_compute(parser)
return parser
def update_parser_common(self, parser):
"""Default is no updates to parser."""
@ -93,17 +149,35 @@ class NetworkAndComputeCommand(command.Command):
"""Default is no updates to parser."""
return parser
@abc.abstractmethod
def take_action(self, parsed_args):
if self.is_neutron:
return self.take_action_network(self.app.client_manager.network,
parsed_args)
elif self.is_nova_network:
return self.take_action_compute(self.app.client_manager.compute,
parsed_args)
def take_action_network(self, client, parsed_args):
"""Override to do something useful."""
pass
@abc.abstractmethod
def take_action_compute(self, client, parsed_args):
"""Override to do something useful."""
pass
@six.add_metaclass(abc.ABCMeta)
class NetworkAndComputeCommand(NetDetectionMixin, command.Command):
"""Network and Compute Command
Command class for commands that support implementation via
the network or compute endpoint. Such commands have different
implementations for take_action() and may even have different
arguments.
"""
pass
@six.add_metaclass(abc.ABCMeta)
class NetworkAndComputeDelete(NetworkAndComputeCommand):
"""Network and Compute Delete
@ -149,7 +223,7 @@ class NetworkAndComputeDelete(NetworkAndComputeCommand):
@six.add_metaclass(abc.ABCMeta)
class NetworkAndComputeLister(command.Lister):
class NetworkAndComputeLister(NetDetectionMixin, command.Lister):
"""Network and Compute Lister
Lister class for commands that support implementation via
@ -157,50 +231,11 @@ class NetworkAndComputeLister(command.Lister):
implementations for take_action() and may even have different
arguments.
"""
def take_action(self, parsed_args):
if self.app.client_manager.is_network_endpoint_enabled():
return self.take_action_network(self.app.client_manager.network,
parsed_args)
else:
return self.take_action_compute(self.app.client_manager.compute,
parsed_args)
def get_parser(self, prog_name):
LOG.debug('get_parser(%s)', prog_name)
parser = super(NetworkAndComputeLister, self).get_parser(prog_name)
parser = self.update_parser_common(parser)
LOG.debug('common parser: %s', parser)
if self.app.client_manager.is_network_endpoint_enabled():
return self.update_parser_network(parser)
else:
return self.update_parser_compute(parser)
def update_parser_common(self, parser):
"""Default is no updates to parser."""
return parser
def update_parser_network(self, parser):
"""Default is no updates to parser."""
return parser
def update_parser_compute(self, parser):
"""Default is no updates to parser."""
return parser
@abc.abstractmethod
def take_action_network(self, client, parsed_args):
"""Override to do something useful."""
pass
@abc.abstractmethod
def take_action_compute(self, client, parsed_args):
"""Override to do something useful."""
pass
pass
@six.add_metaclass(abc.ABCMeta)
class NetworkAndComputeShowOne(command.ShowOne):
class NetworkAndComputeShowOne(NetDetectionMixin, command.ShowOne):
"""Network and Compute ShowOne
ShowOne class for commands that support implementation via
@ -222,35 +257,3 @@ class NetworkAndComputeShowOne(command.ShowOne):
if exc.details:
msg += ", " + six.text_type(exc.details)
raise exceptions.CommandError(msg)
def get_parser(self, prog_name):
LOG.debug('get_parser(%s)', prog_name)
parser = super(NetworkAndComputeShowOne, self).get_parser(prog_name)
parser = self.update_parser_common(parser)
LOG.debug('common parser: %s', parser)
if self.app.client_manager.is_network_endpoint_enabled():
return self.update_parser_network(parser)
else:
return self.update_parser_compute(parser)
def update_parser_common(self, parser):
"""Default is no updates to parser."""
return parser
def update_parser_network(self, parser):
"""Default is no updates to parser."""
return parser
def update_parser_compute(self, parser):
"""Default is no updates to parser."""
return parser
@abc.abstractmethod
def take_action_network(self, client, parsed_args):
"""Override to do something useful."""
pass
@abc.abstractmethod
def take_action_compute(self, client, parsed_args):
"""Override to do something useful."""
pass

View File

@ -22,34 +22,39 @@ class _CommaListAction(argparse.Action):
setattr(namespace, self.dest, values.split(','))
def add_tag_filtering_option_to_parser(parser, collection_name):
def add_tag_filtering_option_to_parser(parser, collection_name,
enhance_help=lambda _h: _h):
parser.add_argument(
'--tags',
metavar='<tag>[,<tag>,...]',
action=_CommaListAction,
help=_('List %s which have all given tag(s) '
'(Comma-separated list of tags)') % collection_name
help=enhance_help(
_('List %s which have all given tag(s) (Comma-separated list of '
'tags)') % collection_name)
)
parser.add_argument(
'--any-tags',
metavar='<tag>[,<tag>,...]',
action=_CommaListAction,
help=_('List %s which have any given tag(s) '
'(Comma-separated list of tags)') % collection_name
help=enhance_help(
_('List %s which have any given tag(s) (Comma-separated list of '
'tags)') % collection_name)
)
parser.add_argument(
'--not-tags',
metavar='<tag>[,<tag>,...]',
action=_CommaListAction,
help=_('Exclude %s which have all given tag(s) '
'(Comma-separated list of tags)') % collection_name
help=enhance_help(
_('Exclude %s which have all given tag(s) (Comma-separated list '
'of tags)') % collection_name)
)
parser.add_argument(
'--not-any-tags',
metavar='<tag>[,<tag>,...]',
action=_CommaListAction,
help=_('Exclude %s which have any given tag(s) '
'(Comma-separated list of tags)') % collection_name
help=enhance_help(
_('Exclude %s which have any given tag(s) (Comma-separated list '
'of tags)') % collection_name)
)
@ -64,37 +69,42 @@ def get_tag_filtering_args(parsed_args, args):
args['not_any_tags'] = ','.join(parsed_args.not_any_tags)
def add_tag_option_to_parser_for_create(parser, resource_name):
def add_tag_option_to_parser_for_create(parser, resource_name,
enhance_help=lambda _h: _h):
tag_group = parser.add_mutually_exclusive_group()
tag_group.add_argument(
'--tag',
action='append',
dest='tags',
metavar='<tag>',
help=_("Tag to be added to the %s "
"(repeat option to set multiple tags)") % resource_name
help=enhance_help(
_("Tag to be added to the %s "
"(repeat option to set multiple tags)") % resource_name)
)
tag_group.add_argument(
'--no-tag',
action='store_true',
help=_("No tags associated with the %s") % resource_name
help=enhance_help(_("No tags associated with the %s") % resource_name)
)
def add_tag_option_to_parser_for_set(parser, resource_name):
def add_tag_option_to_parser_for_set(parser, resource_name,
enhance_help=lambda _h: _h):
parser.add_argument(
'--tag',
action='append',
dest='tags',
metavar='<tag>',
help=_("Tag to be added to the %s "
"(repeat option to set multiple tags)") % resource_name
help=enhance_help(
_("Tag to be added to the %s (repeat option to set multiple "
"tags)") % resource_name)
)
parser.add_argument(
'--no-tag',
action='store_true',
help=_("Clear tags associated with the %s. Specify both "
"--tag and --no-tag to overwrite current tags") % resource_name
help=enhance_help(
_("Clear tags associated with the %s. Specify both --tag and "
"--no-tag to overwrite current tags") % resource_name)
)

View File

@ -114,57 +114,65 @@ class CreateFloatingIP(common.NetworkAndComputeShowOne):
parser.add_argument(
'--subnet',
metavar='<subnet>',
help=_("Subnet on which you want to create the floating IP "
"(name or ID)")
help=self.enhance_help_neutron(
_("Subnet on which you want to create the floating IP "
"(name or ID)"))
)
parser.add_argument(
'--port',
metavar='<port>',
help=_("Port to be associated with the floating IP "
"(name or ID)")
help=self.enhance_help_neutron(
_("Port to be associated with the floating IP "
"(name or ID)"))
)
parser.add_argument(
'--floating-ip-address',
metavar='<ip-address>',
dest='floating_ip_address',
help=_("Floating IP address")
help=self.enhance_help_neutron(_("Floating IP address"))
)
parser.add_argument(
'--fixed-ip-address',
metavar='<ip-address>',
dest='fixed_ip_address',
help=_("Fixed IP address mapped to the floating IP")
help=self.enhance_help_neutron(
_("Fixed IP address mapped to the floating IP"))
)
parser.add_argument(
'--qos-policy',
metavar='<qos-policy>',
help=_("Attach QoS policy to the floating IP (name or ID)")
help=self.enhance_help_neutron(
_("Attach QoS policy to the floating IP (name or ID)"))
)
parser.add_argument(
'--description',
metavar='<description>',
help=_('Set floating IP description')
help=self.enhance_help_neutron(_('Set floating IP description'))
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("Owner's project (name or ID)")
help=self.enhance_help_neutron(_("Owner's project (name or ID)"))
)
parser.add_argument(
'--dns-domain',
metavar='<dns-domain>',
dest='dns_domain',
help=_("Set DNS domain for this floating IP")
help=self.enhance_help_neutron(
_("Set DNS domain for this floating IP"))
)
parser.add_argument(
'--dns-name',
metavar='<dns-name>',
dest='dns_name',
help=_("Set DNS name for this floating IP")
help=self.enhance_help_neutron(
_("Set DNS name for this floating IP"))
)
identity_common.add_project_domain_option_to_parser(parser)
_tag.add_tag_option_to_parser_for_create(parser, _('floating IP'))
identity_common.add_project_domain_option_to_parser(
parser, enhance_help=self.enhance_help_neutron)
_tag.add_tag_option_to_parser_for_create(
parser, _('floating IP'), enhance_help=self.enhance_help_neutron)
return parser
def take_action_network(self, client, parsed_args):
@ -217,60 +225,68 @@ class DeleteFloatingIP(common.NetworkAndComputeDelete):
class ListFloatingIP(common.NetworkAndComputeLister):
# TODO(songminglong): Use SDK resource mapped attribute names once
# the OSC minimum requirements include SDK 1.0
_description = _("List floating IP(s)")
def update_parser_network(self, parser):
parser.add_argument(
'--network',
metavar='<network>',
help=_("List floating IP(s) according to "
"given network (name or ID)")
help=self.enhance_help_neutron(
_("List floating IP(s) according to "
"given network (name or ID)"))
)
parser.add_argument(
'--port',
metavar='<port>',
help=_("List floating IP(s) according to "
"given port (name or ID)")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given port (name or ID)"))
)
parser.add_argument(
'--fixed-ip-address',
metavar='<ip-address>',
help=_("List floating IP(s) according to "
"given fixed IP address")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given fixed IP address"))
)
parser.add_argument(
'--floating-ip-address',
metavar='<ip-address>',
help=_("List floating IP(s) according to "
"given floating IP address")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given floating IP "
"address"))
)
parser.add_argument(
'--long',
action='store_true',
default=False,
help=_("List additional fields in output")
help=self.enhance_help_neutron(
_("List additional fields in output"))
)
parser.add_argument(
'--status',
metavar='<status>',
choices=['ACTIVE', 'DOWN'],
help=_("List floating IP(s) according to "
"given status ('ACTIVE', 'DOWN')")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given status ('ACTIVE', "
"'DOWN')"))
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("List floating IP(s) according to "
"given project (name or ID)")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given project (name or "
"ID)"))
)
identity_common.add_project_domain_option_to_parser(parser)
parser.add_argument(
'--router',
metavar='<router>',
help=_("List floating IP(s) according to "
"given router (name or ID)")
help=self.enhance_help_neutron(
_("List floating IP(s) according to given router (name or "
"ID)"))
)
_tag.add_tag_filtering_option_to_parser(parser, _('floating IP'))
_tag.add_tag_filtering_option_to_parser(
parser, _('floating IP'), enhance_help=self.enhance_help_neutron)
return parser

View File

@ -219,27 +219,27 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
'--enable',
action='store_true',
default=True,
help=_("Enable network (default)")
help=self.enhance_help_neutron(_("Enable network (default)"))
)
admin_group.add_argument(
'--disable',
action='store_true',
help=_("Disable network")
help=self.enhance_help_neutron(_("Disable network"))
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("Owner's project (name or ID)")
help=self.enhance_help_neutron(_("Owner's project (name or ID)"))
)
parser.add_argument(
'--description',
metavar='<description>',
help=_("Set network description")
help=self.enhance_help_neutron(_("Set network description"))
)
parser.add_argument(
'--mtu',
metavar='<mtu>',
help=_("Set network mtu")
help=self.enhance_help_neutron(_("Set network mtu"))
)
identity_common.add_project_domain_option_to_parser(parser)
parser.add_argument(
@ -247,65 +247,76 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
action='append',
dest='availability_zone_hints',
metavar='<availability-zone>',
help=_("Availability Zone in which to create this network "
"(Network Availability Zone extension required, "
"repeat option to set multiple availability zones)")
help=self.enhance_help_neutron(
_("Availability Zone in which to create this network "
"(Network Availability Zone extension required, "
"repeat option to set multiple availability zones)"))
)
port_security_group = parser.add_mutually_exclusive_group()
port_security_group.add_argument(
'--enable-port-security',
action='store_true',
help=_("Enable port security by default for ports created on "
"this network (default)")
help=self.enhance_help_neutron(
_("Enable port security by default for ports created on "
"this network (default)"))
)
port_security_group.add_argument(
'--disable-port-security',
action='store_true',
help=_("Disable port security by default for ports created on "
"this network")
help=self.enhance_help_neutron(
_("Disable port security by default for ports created on "
"this network"))
)
external_router_grp = parser.add_mutually_exclusive_group()
external_router_grp.add_argument(
'--external',
action='store_true',
help=_("Set this network as an external network "
"(external-net extension required)")
help=self.enhance_help_neutron(
_("Set this network as an external network "
"(external-net extension required)"))
)
external_router_grp.add_argument(
'--internal',
action='store_true',
help=_("Set this network as an internal network (default)")
help=self.enhance_help_neutron(
_("Set this network as an internal network (default)"))
)
default_router_grp = parser.add_mutually_exclusive_group()
default_router_grp.add_argument(
'--default',
action='store_true',
help=_("Specify if this network should be used as "
"the default external network")
help=self.enhance_help_neutron(
_("Specify if this network should be used as the default "
"external network"))
)
default_router_grp.add_argument(
'--no-default',
action='store_true',
help=_("Do not use the network as the default external network "
"(default)")
help=self.enhance_help_neutron(
_("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)")
help=self.enhance_help_neutron(
_("QoS policy to attach to this network (name or ID)"))
)
vlan_transparent_grp = parser.add_mutually_exclusive_group()
vlan_transparent_grp.add_argument(
'--transparent-vlan',
action='store_true',
help=_("Make the network VLAN transparent"))
help=self.enhance_help_neutron(
_("Make the network VLAN transparent")))
vlan_transparent_grp.add_argument(
'--no-transparent-vlan',
action='store_true',
help=_("Do not make the network VLAN transparent"))
help=self.enhance_help_neutron(
_("Do not make the network VLAN transparent")))
_add_additional_network_options(parser)
_tag.add_tag_option_to_parser_for_create(parser, _('network'))
_tag.add_tag_option_to_parser_for_create(
parser, _('network'), enhance_help=self.enhance_help_neutron)
return parser
def update_parser_compute(self, parser):
@ -313,7 +324,8 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
'--subnet',
metavar='<subnet>',
required=True,
help=_("IPv4 subnet for fixed IPs (in CIDR notation)")
help=self.enhance_help_nova_network(
_("IPv4 subnet for fixed IPs (in CIDR notation)"))
)
return parser
@ -376,87 +388,98 @@ class ListNetwork(common.NetworkAndComputeLister):
router_ext_group.add_argument(
'--external',
action='store_true',
help=_("List external networks")
help=self.enhance_help_neutron(_("List external networks"))
)
router_ext_group.add_argument(
'--internal',
action='store_true',
help=_("List internal networks")
help=self.enhance_help_neutron(_("List internal networks"))
)
parser.add_argument(
'--long',
action='store_true',
help=_("List additional fields in output")
help=self.enhance_help_neutron(
_("List additional fields in output"))
)
parser.add_argument(
'--name',
metavar='<name>',
help=_("List networks according to their name")
help=self.enhance_help_neutron(
_("List networks according to their name"))
)
admin_state_group = parser.add_mutually_exclusive_group()
admin_state_group.add_argument(
'--enable',
action='store_true',
help=_("List enabled networks")
help=self.enhance_help_neutron(_("List enabled networks"))
)
admin_state_group.add_argument(
'--disable',
action='store_true',
help=_("List disabled networks")
help=self.enhance_help_neutron(_("List disabled networks"))
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("List networks according to their project (name or ID)")
)
identity_common.add_project_domain_option_to_parser(parser)
identity_common.add_project_domain_option_to_parser(
parser, enhance_help=self.enhance_help_neutron)
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
'--share',
action='store_true',
help=_("List networks shared between projects")
help=self.enhance_help_neutron(
_("List networks shared between projects"))
)
shared_group.add_argument(
'--no-share',
action='store_true',
help=_("List networks not shared between projects")
help=self.enhance_help_neutron(
_("List networks not shared between projects"))
)
parser.add_argument(
'--status',
metavar='<status>',
choices=['ACTIVE', 'BUILD', 'DOWN', 'ERROR'],
help=_("List networks according to their status "
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')")
help=self.enhance_help_neutron(
_("List networks according to their status "
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')"))
)
parser.add_argument(
'--provider-network-type',
metavar='<provider-network-type>',
choices=['flat', 'geneve', 'gre', 'local',
'vlan', 'vxlan'],
help=_("List networks according to their physical mechanisms. "
"The supported options are: flat, geneve, gre, local, "
"vlan, vxlan.")
help=self.enhance_help_neutron(
_("List networks according to their physical mechanisms. The "
"supported options are: flat, geneve, gre, local, vlan, "
"vxlan."))
)
parser.add_argument(
'--provider-physical-network',
metavar='<provider-physical-network>',
dest='physical_network',
help=_("List networks according to name of the physical network")
help=self.enhance_help_neutron(
_("List networks according to name of the physical network"))
)
parser.add_argument(
'--provider-segment',
metavar='<provider-segment>',
dest='segmentation_id',
help=_("List networks according to VLAN ID for VLAN networks "
"or Tunnel ID for GENEVE/GRE/VXLAN networks")
help=self.enhance_help_neutron(
_("List networks according to VLAN ID for VLAN networks or "
"Tunnel ID for GENEVE/GRE/VXLAN networks"))
)
parser.add_argument(
'--agent',
metavar='<agent-id>',
dest='agent_id',
help=_('List networks hosted by agent (ID only)')
help=self.enhance_help_neutron(
_('List networks hosted by agent (ID only)'))
)
_tag.add_tag_filtering_option_to_parser(parser, _('networks'))
_tag.add_tag_filtering_option_to_parser(
parser, _('networks'), enhance_help=self.enhance_help_neutron)
return parser
def take_action_network(self, client, parsed_args):

View File

@ -119,10 +119,13 @@ class CreateSecurityGroup(common.NetworkAndComputeShowOne):
parser.add_argument(
'--project',
metavar='<project>',
help=_("Owner's project (name or ID)")
help=self.enhance_help_neutron(_("Owner's project (name or ID)"))
)
identity_common.add_project_domain_option_to_parser(parser)
_tag.add_tag_option_to_parser_for_create(parser, _('security group'))
identity_common.add_project_domain_option_to_parser(
parser, enhance_help=self.enhance_help_neutron)
_tag.add_tag_option_to_parser_for_create(
parser, _('security group'),
enhance_help=self.enhance_help_neutron)
return parser
def _get_description(self, parsed_args):
@ -202,22 +205,28 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
_description = _("List security groups")
def update_parser_network(self, parser):
# Maintain and hide the argument for backwards compatibility.
# Network will always return all projects for an admin.
parser.add_argument(
'--all-projects',
action='store_true',
default=False,
help=argparse.SUPPRESS,
)
if not self.is_docs_build:
# Maintain and hide the argument for backwards compatibility.
# Network will always return all projects for an admin.
parser.add_argument(
'--all-projects',
action='store_true',
default=False,
help=argparse.SUPPRESS,
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("List security groups according to the project "
"(name or ID)")
help=self.enhance_help_neutron(
_("List security groups according to the project (name or "
"ID)"))
)
identity_common.add_project_domain_option_to_parser(parser)
_tag.add_tag_filtering_option_to_parser(parser, _('security group'))
identity_common.add_project_domain_option_to_parser(
parser, enhance_help=self.enhance_help_neutron)
_tag.add_tag_filtering_option_to_parser(
parser, _('security group'),
enhance_help=self.enhance_help_neutron)
return parser
def update_parser_compute(self, parser):
@ -225,7 +234,8 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
'--all-projects',
action='store_true',
default=False,
help=_("Display information from all projects (admin only)")
help=self.enhance_help_nova_network(
_("Display information from all projects (admin only)"))
)
return parser
@ -307,7 +317,9 @@ class SetSecurityGroup(common.NetworkAndComputeCommand):
return parser
def update_parser_network(self, parser):
_tag.add_tag_option_to_parser_for_set(parser, _('security group'))
_tag.add_tag_option_to_parser_for_set(
parser, _('security group'),
enhance_help=self.enhance_help_neutron)
return parser
def take_action_network(self, client, parsed_args):

View File

@ -133,109 +133,120 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
metavar="<group>",
help=_("Remote security group (name or ID)"),
)
# NOTE(efried): The --dst-port, --protocol, and --proto options exist
# for both nova-network and neutron, but differ slightly. For the sake
# of the docs build, which has to account for both variants, but only
# add each to the parser once, they are handled here rather than in the
# _network- or _compute-specific methods below.
# --dst-port has a default for nova-net only
if self.is_nova_network:
dst_port_default = dict(default=(0, 0))
else:
dst_port_default = {}
parser.add_argument(
'--dst-port',
metavar='<port-range>',
action=parseractions.RangeAction,
help=_("Destination port, may be a single port or a starting and "
"ending port range: 137:139. Required for IP protocols TCP "
"and UDP. Ignored for ICMP IP protocols."),
**dst_port_default
)
# NOTE(rtheis): Support either protocol option name for now.
# However, consider deprecating and then removing --proto in
# a future release.
protocol_group = parser.add_mutually_exclusive_group()
# --proto[col] has choices for nova-network only
if self.is_nova_network:
proto_choices = dict(choices=['icmp', 'tcp', 'udp'])
else:
proto_choices = {}
protocol_help_compute = _("IP protocol (icmp, tcp, udp; default: tcp)")
protocol_help_network = _(
"IP protocol (ah, dccp, egp, esp, gre, icmp, igmp, ipv6-encap, "
"ipv6-frag, ipv6-icmp, ipv6-nonxt, ipv6-opts, ipv6-route, ospf, "
"pgm, rsvp, sctp, tcp, udp, udplite, vrrp and integer "
"representations [0-255] or any; default: any (all protocols))")
if self.is_nova_network:
protocol_help = protocol_help_compute
elif self.is_neutron:
protocol_help = protocol_help_network
else:
# Docs build: compose help for both nova-network and neutron
protocol_help = self.split_help(
protocol_help_network, protocol_help_compute)
protocol_group.add_argument(
'--protocol',
metavar='<protocol>',
type=_convert_to_lowercase,
help=protocol_help,
**proto_choices
)
if not self.is_docs_build:
protocol_group.add_argument(
'--proto',
metavar='<proto>',
type=_convert_to_lowercase,
help=argparse.SUPPRESS,
**proto_choices
)
return parser
def update_parser_network(self, parser):
parser.add_argument(
'--description',
metavar='<description>',
help=_("Set security group rule description")
)
parser.add_argument(
'--dst-port',
metavar='<port-range>',
action=parseractions.RangeAction,
help=_("Destination port, may be a single port or a starting and "
"ending port range: 137:139. Required for IP protocols TCP "
"and UDP. Ignored for ICMP IP protocols.")
help=self.enhance_help_neutron(
_("Set security group rule description"))
)
parser.add_argument(
'--icmp-type',
metavar='<icmp-type>',
type=int,
help=_("ICMP type for ICMP IP protocols")
help=self.enhance_help_neutron(
_("ICMP type for ICMP IP protocols"))
)
parser.add_argument(
'--icmp-code',
metavar='<icmp-code>',
type=int,
help=_("ICMP code for ICMP IP protocols")
)
# NOTE(rtheis): Support either protocol option name for now.
# However, consider deprecating and then removing --proto in
# a future release.
protocol_group = parser.add_mutually_exclusive_group()
protocol_group.add_argument(
'--protocol',
metavar='<protocol>',
type=_convert_to_lowercase,
help=_("IP protocol (ah, dccp, egp, esp, gre, icmp, igmp, "
"ipv6-encap, ipv6-frag, ipv6-icmp, ipv6-nonxt, "
"ipv6-opts, ipv6-route, ospf, pgm, rsvp, sctp, tcp, "
"udp, udplite, vrrp and integer representations [0-255] "
"or any; default: any (all protocols))")
)
protocol_group.add_argument(
'--proto',
metavar='<proto>',
type=_convert_to_lowercase,
help=argparse.SUPPRESS
help=self.enhance_help_neutron(
_("ICMP code for ICMP IP protocols"))
)
direction_group = parser.add_mutually_exclusive_group()
direction_group.add_argument(
'--ingress',
action='store_true',
help=_("Rule applies to incoming network traffic (default)")
help=self.enhance_help_neutron(
_("Rule applies to incoming network traffic (default)"))
)
direction_group.add_argument(
'--egress',
action='store_true',
help=_("Rule applies to outgoing network traffic")
help=self.enhance_help_neutron(
_("Rule applies to outgoing network traffic"))
)
parser.add_argument(
'--ethertype',
metavar='<ethertype>',
choices=['IPv4', 'IPv6'],
type=_convert_ipvx_case,
help=_("Ethertype of network traffic "
"(IPv4, IPv6; default: based on IP protocol)")
help=self.enhance_help_neutron(
_("Ethertype of network traffic "
"(IPv4, IPv6; default: based on IP protocol)"))
)
parser.add_argument(
'--project',
metavar='<project>',
help=_("Owner's project (name or ID)")
)
identity_common.add_project_domain_option_to_parser(parser)
return parser
def update_parser_compute(self, parser):
parser.add_argument(
'--dst-port',
metavar='<port-range>',
default=(0, 0),
action=parseractions.RangeAction,
help=_("Destination port, may be a single port or a starting and "
"ending port range: 137:139. Required for IP protocols TCP "
"and UDP. Ignored for ICMP IP protocols.")
)
# NOTE(rtheis): Support either protocol option name for now.
# However, consider deprecating and then removing --proto in
# a future release.
protocol_group = parser.add_mutually_exclusive_group()
protocol_group.add_argument(
'--protocol',
metavar='<protocol>',
choices=['icmp', 'tcp', 'udp'],
type=_convert_to_lowercase,
help=_("IP protocol (icmp, tcp, udp; default: tcp)")
)
protocol_group.add_argument(
'--proto',
metavar='<proto>',
choices=['icmp', 'tcp', 'udp'],
type=_convert_to_lowercase,
help=argparse.SUPPRESS
help=self.enhance_help_neutron(_("Owner's project (name or ID)"))
)
identity_common.add_project_domain_option_to_parser(
parser, enhance_help=self.enhance_help_neutron)
return parser
def _get_protocol(self, parsed_args, default_protocol='any'):
@ -424,47 +435,53 @@ class ListSecurityGroupRule(common.NetworkAndComputeLister):
return parser
def update_parser_network(self, parser):
# Accept but hide the argument for consistency with compute.
# Network will always return all projects for an admin.
parser.add_argument(
'--all-projects',
action='store_true',
default=False,
help=argparse.SUPPRESS
)
if not self.is_docs_build:
# Accept but hide the argument for consistency with compute.
# Network will always return all projects for an admin.
parser.add_argument(
'--all-projects',
action='store_true',
default=False,
help=argparse.SUPPRESS
)
parser.add_argument(
'--protocol',
metavar='<protocol>',
type=_convert_to_lowercase,
help=_("List rules by the IP protocol ("
"ah, dhcp, egp, esp, gre, icmp, igmp, "
"ipv6-encap, ipv6-frag, ipv6-icmp, ipv6-nonxt, "
"ipv6-opts, ipv6-route, ospf, pgm, rsvp, sctp, tcp, "
"udp, udplite, vrrp and integer representations [0-255] "
"or any; default: any (all protocols))")
help=self.enhance_help_neutron(
_("List rules by the IP protocol (ah, dhcp, egp, esp, gre, "
"icmp, igmp, ipv6-encap, ipv6-frag, ipv6-icmp, ipv6-nonxt, "
"ipv6-opts, ipv6-route, ospf, pgm, rsvp, sctp, tcp, udp, "
"udplite, vrrp and integer representations [0-255] or any; "
"default: any (all protocols))"))
)
parser.add_argument(
'--ethertype',
metavar='<ethertype>',
type=_convert_to_lowercase,
help=_("List rules by the Ethertype (IPv4 or IPv6)")
help=self.enhance_help_neutron(
_("List rules by the Ethertype (IPv4 or IPv6)"))
)
direction_group = parser.add_mutually_exclusive_group()
direction_group.add_argument(
'--ingress',
action='store_true',
help=_("List rules applied to incoming network traffic")
help=self.enhance_help_neutron(
_("List rules applied to incoming network traffic"))
)
direction_group.add_argument(
'--egress',
action='store_true',
help=_("List rules applied to outgoing network traffic")
help=self.enhance_help_neutron(
_("List rules applied to outgoing network traffic"))
)
parser.add_argument(
'--long',
action='store_true',
default=False,
help=_("List additional fields in output")
help=self.enhance_help_neutron(
_("List additional fields in output"))
)
return parser
@ -473,16 +490,18 @@ class ListSecurityGroupRule(common.NetworkAndComputeLister):
'--all-projects',
action='store_true',
default=False,
help=_("Display information from all projects (admin only)")
)
# Accept but hide the argument for consistency with network.
# There are no additional fields to display at this time.
parser.add_argument(
'--long',
action='store_false',
default=False,
help=argparse.SUPPRESS
help=self.enhance_help_nova_network(
_("Display information from all projects (admin only)"))
)
if not self.is_docs_build:
# Accept but hide the argument for consistency with network.
# There are no additional fields to display at this time.
parser.add_argument(
'--long',
action='store_false',
default=False,
help=argparse.SUPPRESS
)
return parser
def _get_column_headers(self, parsed_args):