444937c4189a6b8aa8924e92eb662cee700d9c6c
[cascardo/ovs.git] / ovsdb / ovsdb-client.1.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .\" -*- nroff -*-
8 .TH ovsdb\-client 1 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
9 .\" This program's name:
10 .ds PN ovsdb\-client
11 .
12 .SH NAME
13 ovsdb\-client \- command-line interface to \fBovsdb-server\fR(1)
14 .
15 .SH SYNOPSIS
16 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-dbs \fR[\fIserver\fR]
17 .br
18 \fBovsdb\-client \fR[\fIoptions\fR] \fBget\-schema \fR[\fIserver\fR] \fR[\fIdatabase\fR]
19 .br
20 \fBovsdb\-client \fR[\fIoptions\fR] \fBget\-schema\-version\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]
21 .br
22 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-tables\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]
23 .br
24 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-columns\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] [\fItable\fR]
25 .br
26 \fBovsdb\-client \fR[\fIoptions\fR] \fBtransact\fI \fR[\fIserver\fR] \fItransaction\fR
27 .br
28 \fBovsdb\-client \fR[\fIoptions\fR] \fBdump\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]\fR [\fItable\fR
29 [\fIcolumn\fR...]]
30 .br
31 \fBovsdb\-client \fR[\fIoptions\fR] \fBmonitor\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fItable\fR
32 [\fIcolumn\fR[\fB,\fIcolumn\fR]...]...
33 .br
34 \fBovsdb\-client \fR[\fIoptions\fR] \fBmonitor\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fBALL\fR
35 .br
36 \fBovsdb\-client \fR[\fIoptions\fR] \fBmonitor-cond\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fIconditions
37 \fItable\fR [\fIcolumn\fR[\fB,\fIcolumn\fR]...]...
38 .br
39 \fBovsdb\-client help\fR
40 .IP "Output formatting options:"
41 [\fB\-\-format=\fIformat\fR]
42 [\fB\-\-data=\fIformat\fR]
43 [\fB\-\-no-heading\fR]
44 [\fB\-\-pretty\fR]
45 [\fB\-\-bare\fR]
46 [\fB\-\-no\-heading\fR]
47 [\fB\-\-timestamp\fR]
48 .so lib/daemon-syn.man
49 .so lib/vlog-syn.man
50 .so lib/ssl-syn.man
51 .so lib/ssl-bootstrap-syn.man
52 .so lib/common-syn.man
53 .
54 .SH DESCRIPTION
55 The \fBovsdb\-client\fR program is a command-line client for
56 interacting with a running \fBovsdb\-server\fR process.
57 Each command connects to an OVSDB server, which is
58 \fBunix:@RUNDIR@/db.sock\fR by default, or may be specified as
59 \fIserver\fR in one of the following forms:
60 .RS
61 .so ovsdb/remote-active.man
62 .so ovsdb/remote-passive.man
63 .RE
64 .PP
65 The default \fIdatabase\fR is \fBOpen_vSwitch\fR.
66 .
67 .SS "Commands"
68 The following commands are implemented:
69 .IP "\fBlist\-dbs \fR[\fIserver\fR]"
70 Connects to \fIserver\fR, retrieves the list of known databases, and
71 prints them one per line.  These database names are the ones that may
72 be used for \fIdatabase\fR in the following commands.
73 .
74 .IP "\fBget\-schema \fR[\fIserver\fR] \fR[\fIdatabase\fR]"
75 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
76 prints it in JSON format.
77 .
78 .IP "\fBget\-schema\-version\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]"
79 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
80 prints its version number on stdout.  A schema version number has the form
81 \fIx\fB.\fIy\fB.\fIz\fR.  See \fBovs\-vswitchd.conf.db\fR(5) for
82 details.
83 .IP
84 Schema version numbers and Open vSwitch version numbers are
85 independent.
86 .IP
87 If \fIdatabase\fR was created before schema versioning was introduced,
88 then it will not have a version number and this command will print a
89 blank line.
90 .
91 .IP "\fBlist\-tables\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]"
92 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
93 prints a table listing the name of each table
94 within the database.
95 .
96 .IP "\fBlist\-columns\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fItable\fR"
97 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
98 prints a table listing the name and type of each
99 column.  If \fItable\fR is specified, only columns in that table are
100 listed; otherwise, the tables include columns in all tables.
101 .
102 .IP "\fBtransact\fI \fR[\fIserver\fR] \fItransaction\fR"
103 Connects to \fIserver\fR, sends it the specified \fItransaction\fR,
104 which must be a JSON array containing one or more valid OVSDB
105 operations, and prints the received reply on stdout.
106 .
107 .IP "\fBdump\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR]\fR [\fItable \fR[\fIcolumn\fR...]]"
108 Connects to \fIserver\fR, retrieves all of the data in \fIdatabase\fR,
109 and prints it on stdout as a series of tables. If \fItable\fR is
110 specified, only that table is retrieved.  If at least one \fIcolumn\fR
111 is specified, only those columns are retrieved.
112 .
113 .IP "\fBmonitor\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fItable\fR [\fIcolumn\fR[\fB,\fIcolumn\fR]...]..."
114 .IQ "\fBmonitor-cond\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fIconditions\fR \fItable\fR [\fIcolumn\fR[\fB,\fIcolumn\fR]...]..."
115 Connects to \fIserver\fR and monitors the contents of rows that match conditions in
116 \fItable\fR in \fIdatabase\fR. By default, the initial contents of \fItable\fR are
117 printed, followed by each change as it occurs.  If conditions empty,
118 all rows will be monitored. If at least one \fIcolumn\fR is specified, only those
119 columns are monitored.  The following \fIcolumn\fR names have special meanings:
120 .RS
121 .IP "\fB!initial\fR"
122 Do not print the initial contents of the specified columns.
123 .IP "\fB!insert\fR"
124 Do not print newly inserted rows.
125 .IP "\fB!delete\fR"
126 Do not print deleted rows.
127 .IP "\fB!modify\fR"
128 Do not print modifications to existing rows.
129 .RE
130 .IP
131 Multiple [\fIcolumn\fR[\fB,\fIcolumn\fR]...] groups may be specified
132 as separate arguments, e.g. to apply different reporting parameters to
133 each group.  Whether multiple groups or only a single group is
134 specified, any given column may only be mentioned once on the command
135 line.
136 .IP
137 \fBconditions\fR is a JSON array of <condition> as defined in RFC 7047 5.1
138 with the following change: A condition can be either a 3-element JSON array
139 as deescribed in the RFC or a boolean value..
140 .IP
141 If \fB\-\-detach\fR is used with \fBmonitor\fR or \fBmonitor-cond\fR, then
142 \fBovsdb\-client\fR detaches after it has successfully received and
143 printed the initial contents of \fItable\fR.
144 .IP
145 The \fBmonitor\fR command uses RFC 7047 "monitor" method to open a monitor
146 session with the server. The \fBmonitor-cond\fR command uses RFC 7047
147 extension "monitor_cond" method. See \fBovsdb\-server\fR(1) for details.
148 .IP "\fBmonitor\fI \fR[\fIserver\fR] \fR[\fIdatabase\fR] \fBALL\fR"
149 Connects to \fIserver\fR and monitors the contents of all tables in
150 \fIdatabase\fR.  Prints initial values and all kinds of changes to all
151 columns in the database.  The \fB\-\-detach\fR option causes
152 \fBovsdb\-client\fR to detach after it successfully receives and
153 prints the initial database contents.
154 .IP
155 The \fBmonitor\fR command uses RFC 7047 "monitor" method to open a monitor
156 session with the server.
157 .
158 .SH OPTIONS
159 .SS "Output Formatting Options"
160 Much of the output from \fBovsdb\-client\fR is in the form of tables.
161 The following options controlling output formatting:
162 .
163 .ds TD (default)
164 .so lib/table.man
165 .
166 .IP "\fB\-\-timestamp\fR"
167 For the \fBmonitor\fR and \fBmonitor-cond\fR commands, add a timestamp to each
168 table update.  Most output formats add the timestamp on a line of its own
169 just above the table.  The JSON output format puts the timestamp in a
170 member of the top-level JSON object named \fBtime\fR.
171 .
172 .SS "Daemon Options"
173 The daemon options apply only to the \fBmonitor\fR and \fBmonitor-cond\fR commands.
174 With any other command, they have no effect.
175 .ds DD
176 .so lib/daemon.man
177 .SS "Logging Options"
178 .so lib/vlog.man
179 .SS "Public Key Infrastructure Options"
180 .so lib/ssl.man
181 .so lib/ssl-bootstrap.man
182 .SS "Other Options"
183 .so lib/common.man
184 .SH "SEE ALSO"
185 .
186 \fBovsdb\-server\fR(1),
187 \fBovsdb\-client\fR(1),
188 and the OVSDB specification.