Skip to content

Commit ea46a4e

Browse files
committed
ovn-nbctl: Update logical switch commands.
A few minor changes related to logical switch commands: - Use "ls" instead of "lswitch" to be more consistent with other command changes. - Use commands where possible in ovn unit tests. - Update references from "lswitch" to "ls" (code) or "switch" (user). Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
1 parent 31ed119 commit ea46a4e

18 files changed

Lines changed: 283 additions & 287 deletions

INSTALL.Docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ You can also look at this logical switch in OVN's northbound database by
138138
running the following command.
139139

140140
```
141-
ovn-nbctl --db=tcp:$CENTRAL_IP:6640 lswitch-list
141+
ovn-nbctl --db=tcp:$CENTRAL_IP:6640 ls-list
142142
```
143143

144144
* Docker creates your logical port and attaches it to the logical network

ovn/utilities/ovn-docker-overlay-driver

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ def create_network():
167167
return jsonify({'Err': error})
168168

169169
try:
170-
ovn_nbctl("lswitch-add", network, "--", "set", "Logical_Switch",
170+
ovn_nbctl("ls-add", network, "--", "set", "Logical_Switch",
171171
network, "external_ids:subnet=" + subnet,
172172
"external_ids:gateway_ip=" + gateway_ip)
173173
except Exception as e:
174-
error = "create_network: lswitch-add %s" % (str(e))
174+
error = "create_network: ls-add %s" % (str(e))
175175
return jsonify({'Err': error})
176176

177177
return jsonify({})
@@ -189,9 +189,9 @@ def delete_network():
189189
abort(400)
190190

191191
try:
192-
ovn_nbctl("lswitch-del", nid)
192+
ovn_nbctl("ls-del", nid)
193193
except Exception as e:
194-
error = "delete_network: lswitch-del %s" % (str(e))
194+
error = "delete_network: ls-del %s" % (str(e))
195195
return jsonify({'Err': error})
196196

197197
return jsonify({})

ovn/utilities/ovn-nbctl.8.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<h1>General Commands</h1>
1313

1414
<dl>
15-
<dt><code>show [<var>lswitch</var> | <var>router</var>]</code></dt>
15+
<dt><code>show [<var>switch</var> | <var>router</var>]</code></dt>
1616
<dd>
1717
Prints a brief overview of the database contents. If
18-
<var>lswitch</var> is provided, only records related to that
18+
<var>switch</var> is provided, only records related to that
1919
logical switch are shown. If
2020
<var>router</var> is provided, only records related to that
2121
logical router are shown.
@@ -25,7 +25,7 @@
2525
<h1>Logical Switch Commands</h1>
2626

2727
<dl>
28-
<dt><code>lswitch-add</code></dt>
28+
<dt><code>ls-add</code></dt>
2929
<dd>
3030
<p>
3131
Creates a new, unnamed logical switch, which initially has no ports.
@@ -34,10 +34,10 @@
3434
</p>
3535
</dd>
3636

37-
<dt>[<code>--may-exist</code> | <code>--add-duplicate</code>] <code>lswitch-add</code> <var>lswitch</var></dt>
37+
<dt>[<code>--may-exist</code> | <code>--add-duplicate</code>] <code>ls-add</code> <var>switch</var></dt>
3838
<dd>
3939
<p>
40-
Creates a new logical switch named <var>lswitch</var>, which
40+
Creates a new logical switch named <var>switch</var>, which
4141
initially has no ports.
4242
</p>
4343

@@ -46,57 +46,57 @@
4646
names to be unique, but the whole point to the names is to provide an
4747
easy way for humans to refer to the switches, making duplicate names
4848
unhelpful. Thus, without any options, this command regards it as an
49-
error if <var>lswitch</var> is a duplicate name. With
49+
error if <var>switch</var> is a duplicate name. With
5050
<code>--may-exist</code>, adding a duplicate name succeeds but does
5151
not create a new logical switch. With <code>--add-duplicate</code>,
5252
the command really creates a new logical switch with a duplicate
5353
name. It is an error to specify both options.
5454
</p>
5555
</dd>
5656

57-
<dt>[<code>--if-exists</code>] <code>lswitch-del</code> <var>lswitch</var></dt>
57+
<dt>[<code>--if-exists</code>] <code>ls-del</code> <var>switch</var></dt>
5858
<dd>
59-
Deletes <var>lswitch</var>. It is an error if <var>lswitch</var> does
59+
Deletes <var>switch</var>. It is an error if <var>switch</var> does
6060
not exist, unless <code>--if-exists</code> is specified.
6161
</dd>
6262

63-
<dt><code>lswitch-list</code></dt>
63+
<dt><code>ls-list</code></dt>
6464
<dd>
6565
Lists all existing switches on standard output, one per line.
6666
</dd>
6767
</dl>
6868

69-
<h1>ACL Commands</h1>
69+
<h1>Logical Switch ACL Commands</h1>
7070
<dl>
71-
<dt>[<code>--log</code>] <code>acl-add</code> <var>lswitch</var> <var>direction</var> <var>priority</var> <var>match</var> <var>action</var></dt>
71+
<dt>[<code>--log</code>] <code>acl-add</code> <var>switch</var> <var>direction</var> <var>priority</var> <var>match</var> <var>action</var></dt>
7272
<dd>
73-
Adds the specified ACL to <var>lswitch</var>.
73+
Adds the specified ACL to <var>switch</var>.
7474
<var>direction</var> must be either <code>from-lport</code> or
7575
<code>to-lport</code>. <var>priority</var> must be between
7676
<code>1</code> and <code>65534</code>, inclusive. If
7777
<code>--log</code> is specified, packet logging is enabled for the
7878
ACL. A full description of the fields are in <code>ovn-nb</code>(5).
7979
</dd>
8080

81-
<dt><code>acl-del</code> <var>lswitch</var> [<var>direction</var> [<var>priority</var> <var>match</var>]]</dt>
81+
<dt><code>acl-del</code> <var>switch</var> [<var>direction</var> [<var>priority</var> <var>match</var>]]</dt>
8282
<dd>
83-
Deletes ACLs from <var>lswitch</var>. If only
84-
<var>lswitch</var> is supplied, all the ACLs from the logical
83+
Deletes ACLs from <var>switch</var>. If only
84+
<var>switch</var> is supplied, all the ACLs from the logical
8585
switch are deleted. If <var>direction</var> is also specified,
8686
then all the flows in that direction will be deleted from the
8787
logical switch. If all the fields are given, then a single flow
8888
that matches all the fields will be deleted.
8989
</dd>
9090

91-
<dt><code>acl-list</code> <var>lswitch</var></dt>
91+
<dt><code>acl-list</code> <var>switch</var></dt>
9292
<dd>
93-
Lists the ACLs on <var>lswitch</var>.
93+
Lists the ACLs on <var>switch</var>.
9494
</dd>
9595
</dl>
9696

9797
<h1>Logical Switch Port Commands</h1>
9898
<dl>
99-
<dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>lswitch</var> <var>port</var></dt>
99+
<dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>switch</var> <var>port</var></dt>
100100
<dd>
101101
<p>
102102
Creates on <var>lswitch</var> a new logical switch port named
@@ -107,15 +107,15 @@
107107
It is an error if a logical port named <var>port</var> already
108108
exists, unless <code>--may-exist</code> is specified. Regardless of
109109
<code>--may-exist</code>, it is an error if the existing port is in
110-
some logical switch other than <var>lswitch</var> or if it has a
110+
some logical switch other than <var>switch</var> or if it has a
111111
parent port.
112112
</p>
113113
</dd>
114114

115-
<dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>lswitch</var> <var>port</var> <var>parent</var> <var>tag</var></dt>
115+
<dt>[<code>--may-exist</code>] <code>lsp-add</code> <var>switch</var> <var>port</var> <var>parent</var> <var>tag</var></dt>
116116
<dd>
117117
<p>
118-
Creates on <var>lswitch</var> a logical switch port named
118+
Creates on <var>switch</var> a logical switch port named
119119
<var>port</var> that is a child of <var>parent</var> that is
120120
identifed with VLAN ID <var>tag</var>. This is useful in
121121
cases such as virtualized container environments where Open
@@ -127,7 +127,7 @@
127127
It is an error if a logical port named <var>port</var> already
128128
exists, unless <code>--may-exist</code> is specified. Regardless of
129129
<code>--may-exist</code>, it is an error if the existing port is not
130-
in <var>lswitch</var> or if it does not have the specified
130+
in <var>switch</var> or if it does not have the specified
131131
<var>parent</var> and <var>tag</var>.
132132
</p>
133133
</dd>
@@ -138,9 +138,9 @@
138138
not exist, unless <code>--if-exists</code> is specified.
139139
</dd>
140140

141-
<dt><code>lsp-list</code> <var>lswitch</var></dt>
141+
<dt><code>lsp-list</code> <var>switch</var></dt>
142142
<dd>
143-
Lists all the logical switch ports within <var>lswitch</var> on
143+
Lists all the logical switch ports within <var>switch</var> on
144144
standard output, one per line.
145145
</dd>
146146

0 commit comments

Comments
 (0)