1 ===================================================
2 Open vSwitch Configuration Database Specification
3 ===================================================
8 OVSDB uses JSON, as defined by RFC 4627, for its schema format and its
9 wire protocol format. The JSON implementation in Open vSwitch has the
10 following limitations:
12 - Null bytes (\u0000) are not allowed in strings.
14 - Only UTF-8 encoding is supported. (RFC 4627 also mentions
15 UTF-16BE, UTF-16LE, and UTF-32.)
17 - RFC 4627 says that names within a JSON object should be unique.
18 The Open vSwitch JSON parser discards all but the last value
19 for a name that is specified more than once.
21 The descriptions below use the following shorthand notations for JSON
22 values. Additional notation is presented later.
26 A JSON string. Any Unicode string is allowed, as specified by RFC
27 4627. Implementations may disallow null bytes.
31 A JSON string matching [a-zA-Z_][a-zA-Z0-9_]*.
33 <id>s that begin with _ are reserved to the implementation and may
34 not be used by the user.
38 A JSON string that contains a version number that matches
39 [0-9]+\.[0-9]+\.[0-9]+
43 A JSON true or false value.
51 A JSON number with an integer value, within a certain range
52 (currently -2**63...+2**63-1).
60 Any JSON value except null.
64 A JSON object with the following members:
66 "error": <string> required
67 "details": <string> optional
69 The value of the "error" member is a short string, specified in
70 this document, that broadly indicates the class of the error.
71 Most "error" strings are specific to contexts described elsewhere
72 in this document, but the following "error" strings may appear in
73 any context where an <error> is permitted:
75 "error": "resources exhausted"
77 The operation requires more resources (memory, disk, CPU,
78 etc.) than are currently available to the database server.
82 Problems accessing the disk, network, or other required
83 resources prevented the operation from completing.
85 Database implementations may use "error" strings not specified
86 in this document to indicate errors that do not fit into any of
87 the specified categories.
89 Optionally, an <error> may include a "details" member, whose value
90 is a string that describes the error in more detail for the
91 benefit of a human user or administrator. This document does not
92 specify the format or content of the "details" string.
94 An <error> may also have other members that describe the error in
95 more detail. This document does not specify the names or values
101 An Open vSwitch configuration database consists of a set of tables,
102 each of which has a number of columns and zero or more rows. A schema
103 is represented by <database-schema>, as described below.
107 A JSON object with the following members:
109 "name": <id> required
110 "version": <version> required
111 "cksum": <string> optional
112 "tables": {<id>: <table-schema>, ...} required
114 The "name" identifies the database as a whole. It must be
115 provided to most JSON-RPC requests to identify the database being
116 operated on. The value of "tables" is a JSON object whose names
117 are table names and whose values are <table-schema>s.
119 The "version" reports the version of the database schema. Because
120 this is a recent addition to the schema format, OVSDB permits it
121 to be omitted, but future versions of OVSDB will require it to be
122 present. Open vSwitch semantics for "version" are described in
123 ovs-vswitchd.conf.db(5).
125 The "cksum" optionally reports an implementation-defined checksum
126 for the database schema.
130 A JSON object with the following members:
132 "columns": {<id>: <column-schema>, ...} required
133 "maxRows": <integer> optional
134 "isRoot": <boolean> optional
136 The value of "columns" is a JSON object whose names are column
137 names and whose values are <column-schema>s.
139 Every table has the following columns whose definitions are not
140 included in the schema:
142 "_uuid": This column, which contains exactly one UUID value,
143 is initialized to a random value by the database engine when
144 it creates a row. It is read-only, and its value never
145 changes during the lifetime of a row.
147 "_version": Like "_uuid", this column contains exactly one
148 UUID value, initialized to a random value by the database
149 engine when it creates a row, and it is read-only. However,
150 its value changes to a new random value whenever any other
151 field in the row changes. Furthermore, its value is
152 ephemeral: when the database is closed and reopened, or when
153 the database process is stopped and then started again, each
154 "_version" also changes to a new random value.
156 If "isRoot" is omitted or specified as false, then any given row
157 in the table may exist only when there is at least one reference
158 to it, with refType "strong", from a different row (in the same
159 table or a different table). This is a "deferred" action:
160 unreferenced rows in the table are deleted just before transaction
161 commit. If "isRoot" is specified as true, then rows in the table
162 exist independent of any references (they can be thought of as
163 part of the "root set" in a garbage collector).
165 For compatibility with schemas created before "isRoot" was
166 introduced, if "isRoot" is omitted or false in every
167 <table-schema> in a given <database-schema>, then every table is
168 part of the root set.
170 If "maxRows" is specified, as a positive integer, it limits the
171 maximum number of rows that may be present in the table. This is
172 a "deferred" constraint, enforced only at transaction commit time
173 (see the "transact" request below). If "maxRows" is not
174 specified, the size of the table is limited only by the resources
175 available to the database server. "maxRows" constraints are
176 enforced after unreferenced rows are deleted from tables with a
181 A JSON object with the following members:
183 "type": <type> required
184 "ephemeral": <boolean> optional
185 "mutable": <boolean> optional
187 The "type" specifies the type of data stored in this column. If
188 "ephemeral" is specified as true, then this column's values are
189 not guaranteed to be durable; they may be lost when the database
190 restarts. If "mutable" is specified as false, then this column's
191 values may not be modified after they are initially set with the
196 The type of a database column. Either an <atomic-type> or a JSON
197 object that describes the type of a database column, with the
200 "key": <base-type> required
201 "value": <base-type> optional
202 "min": <integer> optional
203 "max": <integer> or "unlimited" optional
205 If "min" or "max" is not specified, each defaults to 1. If "max"
206 is specified as "unlimited", then there is no specified maximum
207 number of elements, although the implementation will enforce some
208 limit. After considering defaults, "min" must be exactly 0 or
209 exactly 1, "max" must be at least 1, and "max" must be greater
210 than or equal to "min".
212 If "min" and "max" are both 1 and "value" is not specified, the
213 type is the scalar type specified by "key".
215 If "min" is not 1 or "max" is not 1, or both, and "value" is not
216 specified, the type is a set of scalar type "key".
218 If "value" is specified, the type is a map from type "key" to type
223 The type of a key or value in a database column. Either an
224 <atomic-type> or a JSON object with the following members:
226 "type": <atomic-type> required
227 "enum": <value> optional
228 "minInteger": <integer> optional, integers only
229 "maxInteger": <integer> optional, integers only
230 "minReal": <real> optional, reals only
231 "maxReal": <real> optional, reals only
232 "minLength": <integer> optional, strings only
233 "maxLength": <integer> optional, strings only
234 "refTable": <id> optional, uuids only
235 "refType": "strong" or "weak" optional, only with "refTable"
237 An <atomic-type> by itself is equivalent to a JSON object with a
238 single member "type" whose value is the <atomic-type>.
240 "enum" may be specified as a <value> whose type is a set of one
241 or more values specified for the member "type". If "enum" is
242 specified, then the valid values of the <base-type> are limited to
243 those in the <value>.
245 "enum" is mutually exclusive with the following constraints.
247 If "type" is "integer", then "minInteger" or "maxInteger" or both
248 may also be specified, restricting the valid integer range. If
249 both are specified, then the maxInteger must be greater than or
252 If "type" is "real", then "minReal" or "maxReal" or both may also
253 be specified, restricting the valid real range. If both are
254 specified, then the maxReal must be greater than or equal to
257 If "type" is "string", then "minLength" and "maxLength" or both
258 may be specified, restricting the valid length of value strings.
259 If both are specified, then maxLength must be greater than or
260 equal to minLength. String length is measured in characters (not
261 bytes or UTF-16 code units).
263 If "type" is "uuid", then "refTable", if present, must be the name
264 of a table within this database. If "refTable" is specified, then
265 "refType" may also be specified. If "refTable" is set, the effect
266 depends on "refType":
268 - If "refType" is "strong" or if "refType" is omitted, the
269 allowed UUIDs are limited to UUIDs for rows in the named
272 - If "refType" is "weak", then any UUIDs are allowed, but
273 UUIDs that do not correspond to rows in the named table will
274 be automatically deleted.
276 "refTable" constraints are "deferred" constraints: they are
277 enforced only at transaction commit time (see the "transact"
278 request below). The other contraints on <base-type> are
279 "immediate", enforced immediately by each operation.
283 One of the strings "integer", "real", "boolean", "string", or
284 "uuid", representing the specified scalar type.
289 The database wire protocol is implemented in JSON-RPC 1.0. We
290 encourage use of JSON-RPC over stream connections instead of JSON-RPC
291 over HTTP, for these reasons:
293 * JSON-RPC is a peer-to-peer protocol, but HTTP is a client-server
294 protocol, which is a poor match. Thus, JSON-RPC over HTTP
295 requires the client to periodically poll the server to receive
298 * HTTP is more complicated than stream connections and doesn't
299 provide any corresponding advantage.
301 * The JSON-RPC specification for HTTP transport is incomplete.
303 We are using TCP port 6632 for the database JSON-RPC connection.
305 The database wire protocol consists of the following JSON-RPC methods:
310 Request object members:
312 "method": "list_dbs" required
313 "params": [] required
314 "id": <nonnull-json-value> required
316 Response object members:
318 "result": [<db-name>, ...]
320 "id": same "id" as request
322 This operation retrieves an array whose elements are <db-name>s
323 that name the databases that can be accessed over this JSON-RPC
329 Request object members:
331 "method": "get_schema" required
332 "params": [<db-name>] required
333 "id": <nonnull-json-value> required
335 Response object members:
337 "result": <database-schema>
339 "id": same "id" as request
341 This operation retrieves a <database-schema> that describes hosted
347 Request object members:
349 "method": "transact" required
350 "params": [<db-name>, <operation>*] required
351 "id": <nonnull-json-value> required
353 Response object members:
355 "result": [<object>*]
357 "id": same "id" as request
359 The "params" array for this method consists of a <db-name> that
360 identifies the database to which the transaction applies, followed by
361 zero or more JSON objects, each of which represents a single database
362 operation. The "Operations" section below describes the valid
365 The value of "id" must be unique among all in-flight transactions
366 within the current JSON-RPC session. Otherwise, the server may return
369 The database server executes each of the specified operations in the
370 specified order, except that if an operation fails, then the remaining
371 operations are not executed.
373 The set of operations is executed as a single atomic, consistent,
374 isolated transaction. The transaction is committed only if every
375 operation succeeds. Durability of the commit is not guaranteed unless
376 the "commit" operation, with "durable" set to true, is included in the
377 operation set (see below).
379 Regardless of whether errors occur, the response is always a JSON-RPC
380 response with null "error" and a "result" member that is an array with
381 the same number of elements as "params". Each element of the "result"
382 array corresponds to the same element of the "params" array. The
383 "result" array elements may be interpreted as follows:
385 - A JSON object that does not contain an "error" member indicates
386 that the operation completed successfully. The specific members
387 of the object are specified below in the descriptions of
388 individual operations. Some operations do not produce any
389 results, in which case the object will have no members.
391 - An <error>, which indicates that the operation completed with an
394 - A JSON null value indicates that the operation was not attempted
395 because a prior operation failed.
397 In general, "result" contains some number of successful results,
398 possibly followed by an error, in turn followed by enough JSON null
399 values to match the number of elements in "params". There is one
400 exception: if all of the operations succeed, but the results cannot be
401 committed, then "result" will have one more element than "params",
402 with the additional element an <error>. The possible "error" strings
403 include at least the following:
405 "error": "referential integrity violation"
407 When the commit was attempted, a column's value referenced the
408 UUID for a row that did not exist in the table named by the
409 column's <base-type> key or value "refTable" that has a
410 "refType" of "strong". (This can be caused by inserting a row
411 that references a nonexistent row, by deleting a row that is
412 still referenced by another row, by specifying the UUID for a
413 row in the wrong table, and other ways.)
415 "error": "constraint violation"
417 A column with a <base-type> key or value "refTable" whose
418 "refType" is "weak" became empty due to deletion(s) caused
419 because the rows that it referenced were deleted (or never
420 existed, if the column's row was inserted within the
421 transaction), and this column is not allowed to be empty
422 because its <type> has a "min" of 1.
424 "error": "constraint violation"
426 The number of rows in a table exceeds the maximum number
427 permitted by the table's "maxRows" value (see <table-schema>).
429 If "params" contains one or more "wait" operations, then the
430 transaction may take an arbitrary amount of time to complete. The
431 database implementation must be capable of accepting, executing, and
432 replying to other transactions and other JSON-RPC requests while a
433 transaction or transactions containing "wait" operations are
434 outstanding on the same or different JSON-RPC sessions.
436 The section "Notation for the Wire Protocol" below describes
437 additional notation for use with the wire protocol. After that, the
438 "Operations" section describes each operation.
443 Request object members:
445 "method": "cancel" required
446 "params": [the "id" for an outstanding request] required
449 Response object members:
453 This JSON-RPC notification instructs the database server to
454 immediately complete or cancel the "transact" request whose "id" is
455 the same as the notification's "params" value.
457 If the "transact" request can be completed immediately, then the
458 server sends a response in the form described for "transact", above.
459 Otherwise, the server sends a JSON-RPC error response of the following
464 "id": the request "id" member
466 The "cancel" notification itself has no reply.
471 Request object members:
473 "method": "monitor" required
474 "params": [<db-name>, <json-value>, <monitor-requests>] required
475 "id": <nonnull-json-value> required
477 <monitor-requests> is an object that maps from a table name to an
478 array of <monitor-request> objects. For backward compatibility, a
479 single <monitor-request> may be used instead of an array; it is
480 treated as a single-element array.
482 Each <monitor-request> is an object with the following members:
484 "columns": [<column>*] optional
485 "select": <monitor-select> optional
487 <monitor-select> is an object with the following members:
489 "initial": <boolean> optional
490 "insert": <boolean> optional
491 "delete": <boolean> optional
492 "modify": <boolean> optional
494 Response object members:
496 "result": <table-updates>
498 "id": same "id" as request
500 This JSON-RPC request enables a client to replicate tables or subsets
501 of tables within database <db-name>. Each element of
502 <monitor-requests> specifies a table to be replicated. The JSON-RPC
503 response to the "monitor" includes the initial contents of each table,
504 unless disabled (see below). Afterward, when changes to those tables
505 are committed, the changes are automatically sent to the client using
506 the "update" monitor notification. This monitoring persists until the
507 JSON-RPC session terminates or until the client sends a
508 "monitor_cancel" JSON-RPC request.
510 Each <monitor-request> describes how to monitor columns in a table:
512 The circumstances in which an "update" notification is sent for a
513 row within the table are determined by <monitor-select>:
515 If "initial" is omitted or true, every row in the table is
516 sent as part of the reply to the "monitor" request.
518 If "insert" is omitted or true, "update" notifications are
519 sent for rows newly inserted into the table.
521 If "delete" is omitted or true, "update" notifications are
522 sent for rows deleted from the table.
524 If "modify" is omitted or true, "update" notifications are
525 sent whenever when a row in the table is modified.
527 The "columns" member specifies the columns whose values are
528 monitored. It must not contain duplicates. If "columns" is
529 omitted, all columns in the table, except for "_uuid", are
532 If there is more than one <monitor-request> in an array of them, then
533 each <monitor-request> in the array should specify both "columns" and
534 "select", and the "columns" must be non-overlapping sets.
536 The "result" in the JSON-RPC response to the "monitor" request is a
537 <table-updates> object (see below) that contains the contents of the
538 tables for which "initial" rows are selected. If no tables' initial
539 contents are requested, then "result" is an empty object.
544 Notification object members:
547 "params": [<json-value>, <table-updates>]
550 The <json-value> in "params" is the same as the value passed as the
551 <json-value> in "params" for the "monitor" request.
553 <table-updates> is an object that maps from a table name to a
556 A <table-update> is an object that maps from the row's UUID (as a
557 36-byte string) to a <row-update> object.
559 A <row-update> is an object with the following members:
561 "old": <row> present for "delete" and "modify" updates
562 "new": <row> present for "initial", "insert", and "modify" updates
564 This JSON-RPC notification is sent from the server to the client to
565 tell it about changes to a monitored table (or the initial state of a
566 modified table). Each table in which one or more rows has changed (or
567 whose initial view is being presented) is represented in "updates".
568 Each row that has changed (or whose initial view is being presented)
569 is represented in its <table-update> as a member with its name taken
570 from the row's _uuid member. The corresponding value is a
573 The "old" member is present for "delete" and "modify" updates.
574 For "delete" updates, each monitored column is included. For
575 "modify" updates, the prior value of each monitored column whose
576 value has changed is included (monitored columns that have not
577 changed are represented in "new").
579 The "new" member is present for "initial", "insert", and "modify"
580 updates. For "initial" and "insert" updates, each monitored
581 column is included. For "modify" updates, the new value of each
582 monitored column is included.
587 Request object members:
589 "method": "monitor_cancel" required
590 "params": [<json-value>] required
591 "id": <nonnull-json-value> required
593 Response object members:
597 "id": the request "id" member
599 Cancels the ongoing table monitor request, identified by the
600 <json-value> in "params" matching the <json-value> in "params" for an
601 ongoing "monitor" request. No more "update" messages will be sent for
607 Request object members:
609 "method": "echo" required
610 "params": JSON array with any contents required
611 "id": <json-value> required
613 Response object members:
615 "result": same as "params"
617 "id": the request "id" member
619 Both the JSON-RPC client and the server must implement this request.
621 This JSON-RPC request and response can be used to implement connection
622 keepalives, by allowing the server to check that the client is still
626 Notation for the Wire Protocol
627 ------------------------------
631 An <id> that names a database. The valid <db-name>s can be
632 obtained using a "list-db" request. The <db-name> is taken from
633 the "name" member of <database-schema>.
637 An <id> that names a table.
641 An <id> that names a table column.
645 A JSON object that describes a table row or a subset of a table
646 row. Each member is the name of a table column paired with the
647 <value> of that column.
651 A JSON value that represents the value of a column in a table row,
652 one of <atom>, a <set>, or a <map>.
656 A JSON value that represents a scalar value for a column, one of
657 <string>, <number>, <boolean>, <uuid>, <named-uuid>.
661 Either an <atom>, representing a set with exactly one element, or
662 a 2-element JSON array that represents a database set value. The
663 first element of the array must be the string "set" and the second
664 element must be an array of zero or more <atom>s giving the values
665 in the set. All of the <atom>s must have the same type.
669 A 2-element JSON array that represents a database map value. The
670 first element of the array must be the string "map" and the second
671 element must be an array of zero or more <pair>s giving the values
672 in the map. All of the <pair>s must have the same key and value
675 (JSON objects are not used to represent <map> because JSON only
676 allows string names in an object.)
680 A 2-element JSON array that represents a pair within a database
681 map. The first element is an <atom> that represents the key, the
682 second element is an <atom> that represents the value.
686 A 2-element JSON array that represents a UUID. The first element
687 of the array must be the string "uuid" and the second element must
688 be a 36-character string giving the UUID in the format described
689 by RFC 4122. For example, the following <uuid> represents the
690 UUID 550e8400-e29b-41d4-a716-446655440000:
692 ["uuid", "550e8400-e29b-41d4-a716-446655440000"]
696 A 2-element JSON array that represents the UUID of a row inserted
697 in an "insert" operation within the same transaction. The first
698 element of the array must be the string "named-uuid" and the
699 second element should be the <id> specified as the "uuid-name"
700 for an "insert" operation within the same transaction. For
701 example, if an "insert" operation within this transaction
702 specifies a "uuid-name" of "myrow", the following <named-uuid>
703 represents the UUID created by that operation:
705 ["named-uuid", "myrow"]
707 A <named-uuid> may be used anywhere a <uuid> is valid.
711 A 3-element JSON array of the form [<column>, <function>,
712 <value>] that represents a test on a column value.
714 Except as otherwise specified below, <value> must have the same
717 The meaning depends on the type of <column>:
722 <function> must be "<", "<=", "==", "!=", ">=", ">",
723 "includes", or "excludes".
725 The test is true if the column's value satisfies the
726 relation <function> <value>, e.g. if the column has value
727 1 and <value> is 2, the test is true if <function> is "<",
728 "<=" or "!=", but not otherwise.
730 "includes" is equivalent to "=="; "excludes" is equivalent
737 <function> must be "!=", "==", "includes", or "excludes".
739 If <function> is "==" or "includes", the test is true if
740 the column's value equals <value>. If <function> is "!="
741 or "excludes", the test is inverted.
746 <function> must be "!=", "==", "includes", or "excludes".
748 If <function> is "==", the test is true if the column's
749 value contains exactly the same values (for sets) or pairs
750 (for maps). If <function> is "!=", the test is inverted.
752 If <function> is "includes", the test is true if the
753 column's value contains all of the values (for sets) or
754 pairs (for maps) in <value>. The column's value may also
755 contain other values or pairs.
757 If <function> is "excludes", the test is true if the
758 column's value does not contain any of the values (for
759 sets) or pairs (for maps) in <value>. The column's value
760 may contain other values or pairs not in <value>.
762 If <function> is "includes" or "excludes", then the
763 required type of <value> is slightly relaxed, in that it
764 may have fewer than the minimum number of elements
765 specified by the column's type. If <function> is
766 "excludes", then the required type is additionally relaxed
767 in that <value> may have more than the maximum number of
768 elements specified by the column's type.
772 One of "<", "<=", "==", "!=", ">=", ">", "includes", "excludes".
776 A 3-element JSON array of the form [<column>, <mutator>, <value>]
777 that represents a change to a column value.
779 Except as otherwise specified below, <value> must have the same
782 The meaning depends on the type of <column>:
787 <mutator> must be "+=", "-=", "*=", "/=" or (integer only)
788 "%=". The value of <column> is changed to the sum,
789 difference, product, quotient, or remainder, respectively,
790 of <column> and <value>.
792 Constraints on <column> are ignored when parsing <value>.
798 No valid <mutator>s are currently defined for these types.
802 Any <mutator> valid for the set's element type may be
803 applied to the set, in which case the mutation is applied
804 to each member of the set individually. <value> must be a
805 scalar value of the same type as the set's element type,
806 except that contraints are ignored.
808 If <mutator> is "insert", then each of the values in the
809 set in <value> is added to <column> if it is not already
810 present. The required type of <value> is slightly
811 relaxed, in that it may have fewer than the minimum number
812 of elements specified by the column's type.
814 If <mutator> is "delete", then each of the values in the
815 set in <value> is removed from <column> if it is present
816 there. The required type is slightly relaxed in that
817 <value> may have more or less than the maximum number of
818 elements specified by the column's type.
822 <mutator> must be "insert" or "delete".
824 If <mutator> is "insert", then each of the key-value pairs
825 in the map in <value> is added to <column> only if its key
826 is not already present. The required type of <value> is
827 slightly relaxed, in that it may have fewer than the
828 minimum number of elements specified by the column's type.
830 If <mutator> is "delete", then <value> may have the same
831 type as <column> (a map type) or it may be a set whose
832 element type is the same as <column>'s key type:
834 - If <value> is a map, the mutation deletes each
835 key-value pair in <column> whose key and value equal
836 one of the key-value pairs in <value>.
838 - If <value> is a set, the mutation deletes each
839 key-value pair in <column> whose key equals one of
840 the values in <value>.
842 For "delete", <value> may have any number of elements,
843 regardless of restrictions on the number of elements in
848 One of "+=", "-=", "*=", "/=", "%=", "insert", "delete".
853 Each of the available operations is described below.
858 Request object members:
860 "op": "insert" required
861 "table": <table> required
862 "row": <row> required
863 "uuid-name": <id> optional
865 Result object members:
871 Inserts "row" into "table".
873 If "row" does not specify values for all the columns in "table",
874 those columns receive default values. The default value for a
875 column depends on its type. The default for a column whose <type>
876 specifies a "min" of 0 is an empty set or empty map. Otherwise,
877 the default is a single value or a single key-value pair, whose
878 value(s) depend on its <atomic-type>:
880 - "integer" or "real": 0
884 - "string": "" (the empty string)
886 - "uuid": 00000000-0000-0000-0000-000000000000
888 The new row receives a new, randomly generated UUID.
890 If "uuid-name" is supplied, then it is an error if <id> is not
891 unique among the "uuid-name"s supplied on all the "insert"
892 operations within this transaction.
894 The UUID for the new row is returned as the "uuid" member of the
899 "error": "duplicate uuid-name"
901 The same "uuid-name" appears on another "insert" operation
902 within this transaction.
904 "error": "constraint violation"
906 One of the values in "row" does not satisfy the immediate
907 constraints for its column's <base-type>. This error will
908 occur for columns that are not explicitly set by "row" if the
909 default value does not satisfy the column's constraints.
914 Request object members:
916 "op": "select" required
917 "table": <table> required
918 "where": [<condition>*] required
919 "columns": [<column>*] optional
921 Result object members:
927 Searches "table" for rows that match all the conditions specified
928 in "where". If "where" is an empty array, every row in "table" is
931 The "rows" member of the result is an array of objects. Each
932 object corresponds to a matching row, with each column
933 specified in "columns" as a member, the column's name as the
934 member name and its value as the member value. If "columns"
935 is not specified, all the table's columns are included. If
936 two rows of the result have the same values for all included
937 columns, only one copy of that row is included in "rows".
938 Specifying "_uuid" within "columns" will avoid dropping
939 duplicates, since every row has a unique UUID.
941 The ordering of rows within "rows" is unspecified.
946 Request object members:
948 "op": "update" required
949 "table": <table> required
950 "where": [<condition>*] required
951 "row": <row> required
953 Result object members:
959 Updates rows in a table.
961 Searches "table" for rows that match all the conditions
962 specified in "where". For each matching row, changes the
963 value of each column specified in "row" to the value for that
964 column specified in "row".
966 The "_uuid" and "_version" columns of a table may not be directly
967 updated with this operation. Columns designated read-only in the
968 schema also may not be updated.
970 The "count" member of the result specifies the number of rows
975 "error": "constraint violation"
977 One of the values in "row" does not satisfy the immediate
978 constraints for its column's <base-type>.
982 Request object members:
984 "op": "mutate" required
985 "table": <table> required
986 "where": [<condition>*] required
987 "mutations": [<mutation>*] required
989 Result object members:
995 Mutates rows in a table.
997 Searches "table" for rows that match all the conditions specified
998 in "where". For each matching row, mutates its columns as
999 specified by each <mutation> in "mutations", in the order
1002 The "_uuid" and "_version" columns of a table may not be directly
1003 modified with this operation. Columns designated read-only in the
1004 schema also may not be updated.
1006 The "count" member of the result specifies the number of rows
1011 "error": "domain error"
1013 The result of the mutation is not mathematically defined,
1014 e.g. division by zero.
1016 "error": "range error"
1018 The result of the mutation is not representable within the
1019 database's format, e.g. an integer result outside the range
1020 INT64_MIN...INT64_MAX or a real result outside the range
1023 "error": "constraint violation"
1025 The mutation caused the column's value to violate a
1026 constraint, e.g. it caused a column to have more or fewer
1027 values than are allowed, an arithmetic operation caused a set
1028 or map to have duplicate elements, or it violated a constraint
1029 specified by a column's <base-type>.
1034 Request object members:
1036 "op": "delete" required
1037 "table": <table> required
1038 "where": [<condition>*] required
1040 Result object members:
1046 Deletes all the rows from "table" that match all the conditions
1047 specified in "where".
1049 The "count" member of the result specifies the number of deleted
1055 Request object members:
1057 "op": "wait" required
1058 "timeout": <integer> optional
1059 "table": <table> required
1060 "where": [<condition>*] required
1061 "columns": [<column>*] required
1062 "until": "==" or "!=" required
1063 "rows": [<row>*] required
1065 Result object members:
1071 Waits until a condition becomes true.
1073 If "until" is "==", checks whether the query on "table" specified
1074 by "where" and "columns", which is evaluated in the same way as
1075 specified for "select", returns the result set specified by
1076 "rows". If it does, then the operation completes successfully.
1077 Otherwise, the entire transaction rolls back. It is automatically
1078 restarted later, after a change in the database makes it possible
1079 for the operation to succeed. The client will not receive a
1080 response until the operation permanently succeeds or fails.
1082 If "until" is "!=", the sense of the test is negated. That is, as
1083 long as the query on "table" specified by "where" and "columns"
1084 returns "rows", the transaction will be rolled back and restarted
1087 If "timeout" is specified, then the transaction aborts after the
1088 specified number of milliseconds. The transaction is guaranteed
1089 to be attempted at least once before it aborts. A "timeout" of 0
1090 will abort the transaction on the first mismatch.
1094 "error": "not supported"
1096 One or more of the columns in this table do not support
1097 triggers. This error will not occur if "timeout" is 0.
1099 "error": "timed out"
1101 The "timeout" was reached before the transaction was able to
1107 Request object members:
1109 "op": "commit" required
1110 "durable": <boolean> required
1112 Result object members:
1118 If "durable" is specified as true, then the transaction, if it
1119 commits, will be stored durably (to disk) before the reply is sent
1124 "error": "not supported"
1126 When "durable" is true, this database implementation does not
1127 support durable commits.
1132 Request object members:
1134 "op": "abort" required
1136 Result object members:
1142 Aborts the transaction with an error. This may be useful for
1149 This operation always fails with this error.
1155 Request object members:
1157 "op": "comment" required
1158 "comment": <string> required
1160 Result object members:
1166 Provides information to a database administrator on the purpose of
1167 a transaction. The OVSDB server, for example, adds comments in
1168 transactions that modify the database to the database journal.