Skip to content

Commit cd6c285

Browse files
author
Eric Fried
committed
neutron: autogenerate docs
$namespace = openstack.network.v2 The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This one turned out to be quite involved, because we support both neutron and nova-network. When running in a real cloud, the command classes detect whether the neutron service is present, assume nova-network if that service is not found, and only add parser options relevant to the detected service. But the docs need to present both sets of options. This was easy enough when they were hardcoded, but required a bit of additional infrastructure for generated docs. Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402
1 parent 61ad83b commit cd6c285

32 files changed

Lines changed: 525 additions & 4904 deletions

doc/source/cli/command-objects/address-scope.rst

Lines changed: 2 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -7,143 +7,5 @@ to a given project and may be shared between projects.
77

88
Network v2
99

10-
address scope create
11-
--------------------
12-
13-
Create new address scope
14-
15-
.. program:: address scope create
16-
.. code:: bash
17-
18-
openstack address scope create
19-
[--project <project> [--project-domain <project-domain>]]
20-
[--ip-version <ip-version>]
21-
[--share | --no-share]
22-
<name>
23-
24-
.. option:: --project <project>
25-
26-
Owner's project (name or ID)
27-
28-
.. option:: --project-domain <project-domain>
29-
30-
Domain the project belongs to (name or ID).
31-
This can be used in case collisions between project names exist.
32-
33-
.. option:: --ip-version <ip-version>
34-
35-
IP version (4 or 6, default is 4)
36-
37-
.. option:: --share
38-
39-
Share the address scope between projects
40-
41-
.. option:: --no-share
42-
43-
Do not share the address scope between projects (default)
44-
45-
.. _address_scope_create-name:
46-
.. describe:: <name>
47-
48-
New address scope name
49-
50-
address scope delete
51-
--------------------
52-
53-
Delete address scope(s)
54-
55-
.. program:: address scope delete
56-
.. code:: bash
57-
58-
openstack address scope delete
59-
<address-scope> [<address-scope> ...]
60-
61-
.. _address_scope_delete-address-scope:
62-
.. describe:: <address-scope>
63-
64-
Address scope(s) to delete (name or ID)
65-
66-
address scope list
67-
------------------
68-
69-
List address scopes
70-
71-
.. program:: address scope list
72-
.. code:: bash
73-
74-
openstack address scope list
75-
[--name <name>]
76-
[--ip-version <ip-version>]
77-
[--project <project> [--project-domain <project-domain>]]
78-
[--share | --no-share]
79-
80-
.. option:: --name <name>
81-
82-
List only address scopes of given name in output
83-
84-
.. option:: --ip-version <ip-version>
85-
86-
List address scopes of given IP version networks (4 or 6)
87-
88-
.. option:: --project <project>
89-
90-
List address scopes according to their project (name or ID)
91-
92-
.. option:: --project-domain <project-domain>
93-
94-
Domain the project belongs to (name or ID).
95-
This can be used in case collisions between project names exist.
96-
97-
.. option:: --share
98-
99-
List address scopes shared between projects
100-
101-
.. option:: --no-share
102-
103-
List address scopes not shared between projects
104-
105-
address scope set
106-
-----------------
107-
108-
Set address scope properties
109-
110-
.. program:: address scope set
111-
.. code:: bash
112-
113-
openstack address scope set
114-
[--name <name>]
115-
[--share | --no-share]
116-
<address-scope>
117-
118-
.. option:: --name <name>
119-
120-
Set address scope name
121-
122-
.. option:: --share
123-
124-
Share the address scope between projects
125-
126-
.. option:: --no-share
127-
128-
Do not share the address scope between projects
129-
130-
.. _address_scope_set-address-scope:
131-
.. describe:: <address-scope>
132-
133-
Address scope to modify (name or ID)
134-
135-
address scope show
136-
------------------
137-
138-
Display address scope details
139-
140-
.. program:: address scope show
141-
.. code:: bash
142-
143-
openstack address scope show
144-
<address-scope>
145-
146-
.. _address_scope_show-address-scope:
147-
.. describe:: <address-scope>
148-
149-
Address scope to display (name or ID)
10+
.. autoprogram-cliff:: openstack.network.v2
11+
:command: address scope *

doc/source/cli/command-objects/floating-ip-pool.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,5 @@ floating ip pool
44

55
Network v2
66

7-
floating ip pool list
8-
---------------------
9-
10-
List pools of floating IP addresses
11-
12-
.. program:: floating ip pool list
13-
.. code:: bash
14-
15-
openstack floating ip pool list
7+
.. autoprogram-cliff:: openstack.network.v2
8+
:command: floating ip pool *

doc/source/cli/command-objects/floating-ip-port-forwarding.rst

Lines changed: 2 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -4,170 +4,6 @@ floating ip port forwarding
44

55
Network v2
66

7-
floating ip port forwarding create
8-
----------------------------------
7+
.. autoprogram-cliff:: openstack.network.v2
8+
:command: floating ip port forwarding *
99

10-
Create floating IP Port Forwarding
11-
12-
.. program:: floating ip port forwarding create
13-
.. code:: bash
14-
15-
openstack floating ip port forwarding create
16-
--internal-ip-address <internal-ip-address>
17-
--port <port>
18-
--internal-protocol-port <port-number>
19-
--external-protocol-port <port-number>
20-
--protocol <protocol>
21-
<floating-ip>
22-
23-
24-
.. describe:: --internal-ip-address <internal-ip-address>
25-
26-
The fixed IPv4 address of the network port associated
27-
to the floating IP port forwarding
28-
29-
.. describe:: --port <port>
30-
31-
The name or ID of the network port associated to the
32-
floating IP port forwarding
33-
34-
.. describe:: --internal-protocol-port <port-number>
35-
36-
The protocol port number of the network port fixed
37-
IPv4 address associated to the floating IP port
38-
forwarding
39-
40-
.. describe:: --external-protocol-port <port-number>
41-
42-
The protocol port number of the port forwarding's
43-
floating IP address
44-
45-
.. describe:: --protocol <protocol>
46-
47-
The protocol used in the floating IP port forwarding,
48-
for instance: TCP, UDP
49-
50-
.. describe:: <floating-ip>
51-
52-
Floating IP that the port forwarding belongs to (IP
53-
address or ID)
54-
55-
floating ip port forwarding delete
56-
----------------------------------
57-
58-
Delete floating IP Port Forwarding(s)
59-
60-
.. program:: floating ip port forwarding delete
61-
.. code:: bash
62-
63-
openstack floating ip port forwarding delete <floating-ip>
64-
<port-forwarding-id> [<port-forwarding-id> ...]
65-
66-
.. describe:: <floating-ip>
67-
68-
Floating IP that the port forwarding belongs to (IP
69-
address or ID)
70-
71-
.. describe:: <port-forwarding-id>
72-
73-
The ID of the floating IP port forwarding
74-
75-
floating ip port forwarding list
76-
--------------------------------
77-
78-
List floating IP Port Forwarding(s)
79-
80-
.. program:: floating ip port forwarding list
81-
.. code:: bash
82-
83-
openstack floating ip port forwarding list
84-
[--port <port>]
85-
[--external-protocol-port <port-number>]
86-
[--protocol protocol]
87-
<floating-ip>
88-
89-
.. option:: --port <port>
90-
91-
The ID of the network port associated to the floating
92-
IP port forwarding
93-
94-
.. option:: --protocol <protocol>
95-
96-
The IP protocol used in the floating IP port
97-
forwarding
98-
99-
.. describe:: <floating-ip>
100-
101-
Floating IP that the port forwarding belongs to (IP
102-
address or ID)
103-
104-
floating ip port forwarding set
105-
-------------------------------
106-
107-
Set floating IP Port Forwarding properties
108-
109-
.. program:: floating ip port forwarding set
110-
.. code:: bash
111-
112-
openstack floating ip port forwarding set
113-
[--port <port>]
114-
[--internal-ip-address <internal-ip-address>]
115-
[--internal-protocol-port <port-number>]
116-
[--external-protocol-port <port-number>]
117-
[--protocol <protocol>]
118-
<floating-ip>
119-
<port-forwarding-id>
120-
121-
.. option:: --port <port>
122-
123-
The ID of the network port associated to the floating
124-
IP port forwarding
125-
126-
.. option:: --internal-ip-address <internal-ip-address>
127-
128-
The fixed IPv4 address of the network port associated
129-
to the floating IP port forwarding
130-
131-
.. option:: --internal-protocol-port <port-number>
132-
133-
The TCP/UDP/other protocol port number of the network
134-
port fixed IPv4 address associated to the floating IP
135-
port forwarding
136-
137-
.. option:: --external-protocol-port <port-number>
138-
139-
The TCP/UDP/other protocol port number of the port
140-
forwarding's floating IP address
141-
142-
.. option:: --protocol <protocol>
143-
144-
The IP protocol used in the floating IP port
145-
forwarding
146-
147-
.. describe:: <floating-ip>
148-
149-
Floating IP that the port forwarding belongs to (IP
150-
address or ID)
151-
152-
.. describe:: <port-forwarding-id>
153-
154-
The ID of the floating IP port forwarding
155-
156-
floating ip port forwarding show
157-
--------------------------------
158-
159-
Display floating IP Port Forwarding details
160-
161-
.. program:: floating ip port forwarding show
162-
.. code:: bash
163-
164-
openstack floating ip show <floating-ip> <port-forwarding-id>
165-
166-
.. describe:: <floating-ip>
167-
168-
Floating IP that the port forwarding belongs to (IP
169-
address or ID)
170-
171-
.. describe:: <port-forwarding-id>
172-
173-
The ID of the floating IP port forwarding

0 commit comments

Comments
 (0)