Implement database schema versioning.
[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 "November 2009" "Open vSwitch" "Open vSwitch Manual"
9 .\" This program's name:
10 .ds PN ovsdb\-client
11 .\" SSL peer program's name:
12 .ds SN ovsdb\-server
13 .
14 .SH NAME
15 ovsdb\-client \- command-line interface to \fBovsdb-server\fR(1)
16 .
17 .SH SYNOPSIS
18 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-dbs\fI server\fR
19 .br
20 \fBovsdb\-client \fR[\fIoptions\fR] \fBget\-schema\fI server database\fR
21 .br
22 \fBovsdb\-client \fR[\fIoptions\fR] \fBget\-schema\-version\fI server database\fR
23 .br
24 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-tables\fI server database\fR
25 .br
26 \fBovsdb\-client \fR[\fIoptions\fR] \fBlist\-columns\fI server database \fR[\fItable\fR]
27 .br
28 \fBovsdb\-client \fR[\fIoptions\fR] \fBtransact\fI server transaction\fR
29 .br
30 \fBovsdb\-client \fR[\fIoptions\fR] \fBdump\fI server database\fR
31 .br
32 \fBovsdb\-client \fR[\fIoptions\fR] \fBmonitor\fI server database table\fR
33 [\fIcolumn\fR[\fB,\fIcolumn\fR]...]...
34 .br
35 \fBovsdb\-client help\fR
36 .IP "Output formatting options:"
37 [\fB\-\-format=\fIformat\fR]
38 [\fB\-\-no\-heading\fR]
39 .so lib/daemon-syn.man
40 .so lib/vlog-syn.man
41 .so lib/ssl-syn.man
42 .so lib/ssl-bootstrap-syn.man
43 .so lib/common-syn.man
44 .
45 .SH DESCRIPTION
46 The \fBovsdb\-client\fR program is a command-line client for
47 interacting with a running \fBovsdb\-server\fR process.  For each
48 command, the \fIserver\fR to connect to must be specified in one of
49 the following forms:
50 .RS
51 .so ovsdb/remote-active.man
52 .so ovsdb/remote-passive.man
53 .RE
54 .
55 .SS "Commands"
56 The following commands are implemented:
57 .IP "\fBlist\-dbs\fI server\fR"
58 Connects to \fIserver\fR, retrieves the list of known databases, and
59 prints them one per line.  These database names are the ones that may
60 be used for \fIdatabase\fR in the following commands.
61 .
62 .IP "\fBget\-schema\fI server database\fR"
63 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
64 prints it in JSON format.
65 .
66 .IP "\fBget\-schema\-version\fI server database\fR"
67 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
68 prints its version number on stdout.  A schema version number has the form
69 \fIx\fB.\fIy\fB.\fIz\fR.  See \fBovs\-vswitchd.conf.db\fR(5) for
70 details.
71 .IP
72 Schema version numbers and Open vSwitch version numbers are
73 independent.
74 .IP
75 If \fIdatabase\fR was created before schema versioning was introduced,
76 then it will not have a version number and this command will print a
77 blank line.
78 .
79 .IP "\fBlist\-tables\fI server database\fR"
80 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
81 prints a table listing the name of each table
82 within the database.
83 .
84 .IP "\fBlist\-columns\fI server database \fR[\fItable\fR]"
85 Connects to \fIserver\fR, retrieves the schema for \fIdatabase\fR, and
86 prints a table listing the name and type of each
87 column.  If \fItable\fR is specified, only columns in that table are
88 listed; otherwise, the tables include columns in all tables.
89 .
90 .IP "\fBtransact\fI server transaction\fR"
91 Connects to \fIserver\fR, sends it the specified \fItransaction\fR,
92 which must be a JSON array containing one or more valid OVSDB
93 operations, and prints the received reply on stdout.
94 .
95 .IP "\fBdump\fI server database\fR"
96 Connects to \fIserver\fR, retrieves all of the data in \fIdatabase\fR,
97 and prints it on stdout as a series of tables.
98 .
99 .IP "\fBmonitor\fI server database table\fR [\fIcolumn\fR[\fB,\fIcolumn\fR]...]..."
100 Connects to \fIserver\fR and monitors the contents of \fItable\fR in
101 \fIdatabase\fR.  By default, the initial contents of \fItable\fR are
102 printed, followed by each change as it occurs.  If at least one
103 \fIcolumn\fR is specified, only those columns are monitored.  The
104 following \fIcolumn\fR names have special meanings:
105 .RS
106 .IP "\fB!initial\fR"
107 Do not print the initial contents of the specified columns.
108 .IP "\fB!insert\fR"
109 Do not print newly inserted rows.
110 .IP "\fB!delete\fR"
111 Do not print deleted rows.
112 .IP "\fB!modify\fR"
113 Do not print modifications to existing rows.
114 .RE
115 .IP
116 Multiple [\fIcolumn\fR[\fB,\fIcolumn\fR]...] groups may be specified
117 as separate arguments, e.g. to apply different reporting parameters to
118 each group.  Whether multiple groups or only a single group is
119 specified, any given column may only be mentioned once on the command
120 line.
121 .IP
122 If \fB\-\-detach\fR is used with \fBmonitor\fR, then \fBovsdb\-client\fR
123 detaches after it has successfully received and printed the initial
124 contents of \fItable\fR.
125 .SH OPTIONS
126 .SS "Output Formatting Options"
127 Much of the output from \fBovsdb\-client\fR is in the form of tables.
128 The following options controlling output formatting:
129 .
130 .IP "\fB\-f \fIformat\fR"
131 .IQ "\fB\-\-format=\fIformat\fR"
132 Sets the type of table formatting.  The following types of
133 \fIformat\fR are available:
134 .RS
135 .IP "\fBtable\fR (default)"
136 Text-based tables with aligned columns.
137 .IP "\fBhtml\fR"
138 HTML tables.
139 .IP "\fBcvs\fR"
140 Comma-separated values as defined in RFC 4180.
141 .IP "\fBjson\fR"
142 JSON format as defined in RFC 4627.  The output is a sequence of JSON
143 objects, each of which corresponds to one table.  Each JSON object has
144 the following members with the noted values:
145 .RS
146 .IP "\fBcaption\fR"
147 The table's caption.  This member is omitted if the table has no
148 caption.
149 .IP "\fBheadings\fR"
150 An array with one element per table column.  Each array element is a
151 string giving the corresponding column's heading.
152 .IP "\fBdata\fR"
153 An array with one element per table row.  Each element is also an
154 array with one element per table column.  The elements of this
155 second-level array are the cells that constitute the table.  Cells
156 that represent OVSDB data or data types are expressed in the format
157 described in the OVSDB specification; other cells are simply expressed
158 as text strings.
159 .RE
160 .RE
161 .
162 .IP "\fB\-d \fIformat\fR"
163 .IP "\fB\-\-data=\fIformat\fR"
164 Sets the formatting for cells within output tables.  The following
165 types of \fIformat\fR are available:
166 .RS
167 .IP "\fBstring\fR (default)"
168 The simple format described in \fBovs\-vsctl\fR(8).
169 .IP "\fBjson\fR"
170 JSON.
171 .RE
172 .IP
173 The \fBjson\fR output format always outputs cells in JSON format,
174 ignoring this option.
175 .
176 .IP "\fB\-\-no\-heading\fR"
177 This option suppresses the heading row that otherwise appears in the
178 first row of table output.
179 .
180 .IP "\fB\-\-pretty\fR"
181 By default, JSON in output is printed as compactly as possible.  This
182 option causes JSON in output to be printed in a more readable
183 fashion.  Members of objects and elements of arrays are printed one
184 per line, with indentation.
185 .IP
186 This option does not affect JSON in tables, which is always printed
187 compactly.
188 .
189 .SS "Daemon Options"
190 The daemon options apply only to the \fBmonitor\fR command.  With any
191 other command, they have no effect.
192 .so lib/daemon.man
193 .SS "Logging Options"
194 .so lib/vlog.man
195 .SS "Public Key Infrastructure Options"
196 .so lib/ssl.man
197 .so lib/ssl-bootstrap.man
198 .SS "Other Options"
199 .so lib/common.man
200 .SH "SEE ALSO"
201 .
202 \fBovsdb\-server\fR(1),
203 \fBovsdb\-client\fR(1),
204 and the OVSDB specification.