The ovsdb-client query
command is used to send queries to an OVSDB server and receive responses. It has the following basic syntax:
ovsdb-client query [OPTIONS] DB QUERY
where:
OPTIONS
: Any additional options for theovsdb-client
tool, such as specifying the location of the OVSDB server or authentication credentials.DB
: The name of the OVSDB database to query.QUERY
: The actual query string in JSON format.
For example, a simple query to retrieve all rows from the “Bridge” table in the “Open_vSwitch” database would look like this:
ovsdb-client query tcp:127.0.0.1:6640 Open_vSwitch '{"op": "select", "table": "Bridge"}'
This would connect to an OVSDB server listening on localhost port 6640, select all rows from the Bridge table in the Open_vSwitch database, and return them as a JSON object.