ovsdb-client(1)

NAME
ovsdb-client - command-line interface to ovsdb-server(1)

SYNOPSIS
ovsdb-client [options] list-dbs [server]
ovsdb-client [options] get-schema [server] [database]
ovsdb-client [options] get-schema-version [server] [database]
ovsdb-client [options] list-tables [server] [database]
ovsdb-client [options] list-columns [server] [database] [table]
ovsdb-client [options] transact [server] transaction
ovsdb-client [options] dump [server] [database] [table [column...]]
ovsdb-client [options] monitor [server] [database] table [column[,column]...]...
ovsdb-client [options] monitor [server] [database] ALL
ovsdb-client [options] monitor-cond [server] [database] conditions table [column[,column]...]...
ovsdb-client [options] lock [server] lock
ovsdb-client [options] steal [server] lock
ovsdb-client [options] unlock [server] lock
ovsdb-client help

Output formatting options:
    [--format=format] [--data=format] [--no-heading] [--pretty] [--bare] [--no-heading] [--timestamp]

DESCRIPTION
The ovsdb-client program is a command-line client for interacting with a running ovsdb-server process. Each command connects to an OVSDB server, which is unix:@RUNDIR@/db.sock by default, or may be specified as server in one of the following forms:

The default database is Open_vSwitch.

  Commands
The following commands are implemented:

list-dbs [server]
    Connects to server, retrieves the list of known databases, and prints them one per line. These database names are the ones that may be used for database in the following commands.

get-schema [server] [database]
    Connects to server, retrieves the schema for database, and prints it in JSON format.

get-schema-version [server] [database]
    Connects to server, retrieves the schema for database, and prints its version number on stdout. A schema version number has the form x.y.z. See ovs-vswitchd.conf.db(5) for details.

    Schema version numbers and Open vSwitch version numbers are independent.

    If database was created before schema versioning was introduced, then it will not have a version number and this command will print a blank line.

list-tables [server] [database]
    Connects to server, retrieves the schema for database, and prints a table listing the name of each table within the database.

list-columns [server] [database] table
    Connects to server, retrieves the schema for database, and prints a table listing the name and type of each column. If table is specified, only columns in that table are listed; otherwise, the tables include columns in all tables.

transact [server] transaction
    Connects to server, sends it the specified transaction, which must be a JSON array containing one or more valid OVSDB operations, and prints the received reply on stdout.

dump [server] [database] [table [column...]]
    Connects to server, retrieves all of the data in database, and prints it on stdout as a series of tables. If table is specified, only that table is retrieved. If at least one column is specified, only those columns are retrieved.

monitor [server] [database] table [column[,column]...]...
    Connects to server and monitors the contents of rows that match conditions in table in database. By default, the initial contents of table are printed, followed by each change as it occurs. If conditions empty, all rows will be monitored. If at least one column is specified, only those columns are monitored. The following column names have special meanings:

    !initial
        Do not print the initial contents of the specified columns.

    !insert
        Do not print newly inserted rows.

    !delete
        Do not print deleted rows.

    !modify
        Do not print modifications to existing rows.

    Multiple [column[,column]...] groups may be specified as separate arguments, e.g. to apply different reporting parameters to each group. Whether multiple groups or only a single group is specified, any given column may only be mentioned once on the command line.

    conditions is a JSON array of <condition> as defined in RFC 7047 5.1 with the following change: A condition can be either a 3-element JSON array as deescribed in the RFC or a boolean value..

    If --detach is used with monitor or monitor-cond, then ovsdb-client detaches after it has successfully received and printed the initial contents of table.

    The monitor command uses RFC 7047 "monitor" method to open a monitor session with the server. The monitor-cond command uses RFC 7047 extension "monitor_cond" method. See ovsdb-server(1) for details.

monitor [server] [database] ALL
    Connects to server and monitors the contents of all tables in database. Prints initial values and all kinds of changes to all columns in the database. The --detach option causes ovsdb-client to detach after it successfully receives and prints the initial database contents.

    The monitor command uses RFC 7047 "monitor" method to open a monitor session with the server.

TESTING COMMANDS
The following commands are mostly of interest for testing the correctness of the OVSDB server.

ovsdb-client [options] lock [server] lock
    Connects to server and issues corresponding RFC 7047 lock operations on lock. Prints json reply or subsequent update messages. The --detach option causes ovsdb-client to detach after it successfully receives and prints the initial reply.

    When running with the --detach option, lock, steal, unlock and exit commands can be issued by using ovs-appctl. exit command causes the ovsdb-client to close its ovsdb-server connection before exit. The lock, steal and unlock commands can be used to issue additional lock operations over the same ovsdb-server connection. All above commands take a single lock argument, which does not have to be the same as the lock that ovsdb-client started with.

OPTIONS

  Output Formatting Options
Much of the output from ovsdb-client is in the form of tables. The following options controlling output formatting:

--timestamp
    For the monitor and monitor-cond commands, add a timestamp to each table update. Most output formats add the timestamp on a line of its own just above the table. The JSON output format puts the timestamp in a member of the top-level JSON object named time.

  Daemon Options
The daemon options apply only to the monitor and monitor-cond commands. With any other command, they have no effect.

  Logging Options

  Public Key Infrastructure Options

  Other Options

SEE ALSO
ovsdb-server(1), ovsdb-client(1), and the OVSDB specification.