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 true or false value.
46 A JSON number with an integer value, within a certain range
47 (currently -2**63...+2**63-1).
55 Any JSON value except null.
59 A JSON object with the following members:
61 "error": <string> required
62 "details": <string> optional
64 The value of the "error" member is a short string, specified in
65 this document, that broadly indicates the class of the error.
66 Most "error" strings are specific to contexts described elsewhere
67 in this document, but the following "error" strings may appear in
68 any context where an <error> is permitted:
70 "error": "resources exhausted"
72 The operation requires more resources (memory, disk, CPU,
73 etc.) than are currently available to the database server.
77 Problems accessing the disk, network, or other required
78 resources prevented the operation from completing.
80 Database implementations may use "error" strings not specified
81 in this document to indicate errors that do not fit into any of
82 the specified categories.
84 Optionally, an <error> may include a "details" member, whose value
85 is a string that describes the error in more detail for the
86 benefit of a human user or administrator. This document does not
87 specify the format or content of the "details" string.
89 An <error> may also have other members that describe the error in
90 more detail. This document does not specify the names or values
96 An Open vSwitch configuration database consists of a set of tables,
97 each of which has a number of columns and zero or more rows. A schema
98 is represented by <database-schema>, as described below.
102 A JSON object with the following members:
104 "name": <id> required
105 "tables": {<id>: <table-schema>, ...} required
107 The "name" identifies the database as a whole. It must be
108 provided to most JSON-RPC requests to identify the database being
109 operated on. The value of "tables" is a JSON object whose names
110 are table names and whose values are <table-schema>s.
114 A JSON object with the following members:
116 "columns": {<id>: <column-schema>, ...} required
117 "maxRows": <integer> optional
119 The value of "columns" is a JSON object whose names are column
120 names and whose values are <column-schema>s.
122 Every table has the following columns whose definitions are not
123 included in the schema:
125 "_uuid": This column, which contains exactly one UUID value,
126 is initialized to a random value by the database engine when
127 it creates a row. It is read-only, and its value never
128 changes during the lifetime of a row.
130 "_version": Like "_uuid", this column contains exactly one
131 UUID value, initialized to a random value by the database
132 engine when it creates a row, and it is read-only. However,
133 its value changes to a new random value whenever any other
134 field in the row changes. Furthermore, its value is
135 ephemeral: when the database is closed and reopened, or when
136 the database process is stopped and then started again, each
137 "_version" also changes to a new random value.
139 If "maxRows" is specified, as a positive integer, it limits the
140 maximum number of rows that may be present in the table. This is
141 a "deferred" constraint, enforced only at transaction commit time
142 (see the "transact" request below). If "maxRows" is not
143 specified, the size of the table is limited only by the resources
144 available to the database server.
148 A JSON object with the following members:
150 "type": <type> required
151 "ephemeral": <boolean> optional
152 "mutable": <boolean> optional
154 The "type" specifies the type of data stored in this column. If
155 "ephemeral" is specified as true, then this column's values are
156 not guaranteed to be durable; they may be lost when the database
157 restarts. If "mutable" is specified as false, then this column's
158 values may not be modified after they are initially set with the
163 The type of a database column. Either an <atomic-type> or a JSON
164 object that describes the type of a database column, with the
167 "key": <base-type> required
168 "value": <base-type> optional
169 "min": <integer> optional
170 "max": <integer> or "unlimited" optional
172 If "min" or "max" is not specified, each defaults to 1. If "max"
173 is specified as "unlimited", then there is no specified maximum
174 number of elements, although the implementation will enforce some
175 limit. After considering defaults, "min" must be exactly 0 or
176 exactly 1, "max" must be at least 1, and "max" must be greater
177 than or equal to "min".
179 If "min" and "max" are both 1 and "value" is not specified, the
180 type is the scalar type specified by "key".
182 If "min" is not 1 or "max" is not 1, or both, and "value" is not
183 specified, the type is a set of scalar type "key".
185 If "value" is specified, the type is a map from type "key" to type
190 The type of a key or value in a database column. Either an
191 <atomic-type> or a JSON object with the following members:
193 "type": <atomic-type> required
194 "enum": <value> optional
195 "minInteger": <integer> optional, integers only
196 "maxInteger": <integer> optional, integers only
197 "minReal": <real> optional, reals only
198 "maxReal": <real> optional, reals only
199 "minLength": <integer> optional, strings only
200 "maxLength": <integer> optional, strings only
201 "refTable": <id> optional, uuids only
202 "refType": "strong" or "weak" optional, only with "refTable"
204 An <atomic-type> by itself is equivalent to a JSON object with a
205 single member "type" whose value is the <atomic-type>.
207 "enum" may be specified as a <value> whose type is a set of one
208 or more values specified for the member "type". If "enum" is
209 specified, then the valid values of the <base-type> are limited to
210 those in the <value>.
212 "enum" is mutually exclusive with the following constraints.
214 If "type" is "integer", then "minInteger" or "maxInteger" or both
215 may also be specified, restricting the valid integer range. If
216 both are specified, then the maxInteger must be greater than or
219 If "type" is "real", then "minReal" or "maxReal" or both may also
220 be specified, restricting the valid real range. If both are
221 specified, then the maxReal must be greater than or equal to
224 If "type" is "string", then "minLength" and "maxLength" or both
225 may be specified, restricting the valid length of value strings.
226 If both are specified, then maxLength must be greater than or
227 equal to minLength. String length is measured in characters (not
228 bytes or UTF-16 code units).
230 If "type" is "uuid", then "refTable", if present, must be the name
231 of a table within this database. If "refTable" is specified, then
232 "refType" may also be specified. If "refTable" is set, the effect
233 depends on "refType":
235 - If "refType" is "strong" or if "refType" is omitted, the
236 allowed UUIDs are limited to UUIDs for rows in the named
239 - If "refType" is "weak", then any UUIDs are allowed, but
240 UUIDs that do not correspond to rows in the named table will
241 be automatically deleted.
243 "refTable" constraints are "deferred" constraints: they are
244 enforced only at transaction commit time (see the "transact"
245 request below). The other contraints on <base-type> are
246 "immediate", enforced immediately by each operation.
250 One of the strings "integer", "real", "boolean", "string", or
251 "uuid", representing the specified scalar type.
256 The database wire protocol is implemented in JSON-RPC 1.0. We
257 encourage use of JSON-RPC over stream connections instead of JSON-RPC
258 over HTTP, for these reasons:
260 * JSON-RPC is a peer-to-peer protocol, but HTTP is a client-server
261 protocol, which is a poor match. Thus, JSON-RPC over HTTP
262 requires the client to periodically poll the server to receive
265 * HTTP is more complicated than stream connections and doesn't
266 provide any corresponding advantage.
268 * The JSON-RPC specification for HTTP transport is incomplete.
270 We are using TCP port 6632 for the database JSON-RPC connection.
272 The database wire protocol consists of the following JSON-RPC methods:
277 Request object members:
279 "method": "list_dbs" required
280 "params": [] required
281 "id": <nonnull-json-value> required
283 Response object members:
285 "result": [<db-name>, ...]
287 "id": same "id" as request
289 This operation retrieves an array whose elements are <db-name>s
290 that name the databases that can be accessed over this JSON-RPC
296 Request object members:
298 "method": "get_schema" required
299 "params": [<db-name>] required
300 "id": <nonnull-json-value> required
302 Response object members:
304 "result": <database-schema>
306 "id": same "id" as request
308 This operation retrieves a <database-schema> that describes hosted
314 Request object members:
316 "method": "transact" required
317 "params": [<db-name>, <operation>*] required
318 "id": <nonnull-json-value> required
320 Response object members:
322 "result": [<object>*]
324 "id": same "id" as request
326 The "params" array for this method consists of a <db-name> that
327 identifies the database to which the transaction applies, followed by
328 zero or more JSON objects, each of which represents a single database
329 operation. The "Operations" section below describes the valid
332 The value of "id" must be unique among all in-flight transactions
333 within the current JSON-RPC session. Otherwise, the server may return
336 The database server executes each of the specified operations in the
337 specified order, except that if an operation fails, then the remaining
338 operations are not executed.
340 The set of operations is executed as a single atomic, consistent,
341 isolated transaction. The transaction is committed only if every
342 operation succeeds. Durability of the commit is not guaranteed unless
343 the "commit" operation, with "durable" set to true, is included in the
344 operation set (see below).
346 Regardless of whether errors occur, the response is always a JSON-RPC
347 response with null "error" and a "result" member that is an array with
348 the same number of elements as "params". Each element of the "result"
349 array corresponds to the same element of the "params" array. The
350 "result" array elements may be interpreted as follows:
352 - A JSON object that does not contain an "error" member indicates
353 that the operation completed successfully. The specific members
354 of the object are specified below in the descriptions of
355 individual operations. Some operations do not produce any
356 results, in which case the object will have no members.
358 - An <error>, which indicates that the operation completed with an
361 - A JSON null value indicates that the operation was not attempted
362 because a prior operation failed.
364 In general, "result" contains some number of successful results,
365 possibly followed by an error, in turn followed by enough JSON null
366 values to match the number of elements in "params". There is one
367 exception: if all of the operations succeed, but the results cannot be
368 committed, then "result" will have one more element than "params",
369 with the additional element an <error>. The possible "error" strings
370 include at least the following:
372 "error": "referential integrity violation"
374 When the commit was attempted, a column's value referenced the
375 UUID for a row that did not exist in the table named by the
376 column's <base-type> key or value "refTable" that has a
377 "refType" of "strong". (This can be caused by inserting a row
378 that references a nonexistent row, by deleting a row that is
379 still referenced by another row, by specifying the UUID for a
380 row in the wrong table, and other ways.)
382 "error": "constraint violation"
384 A column with a <base-type> key or value "refTable" whose
385 "refType" is "weak" became empty due to deletion(s) caused
386 because the rows that it referenced were deleted (or never
387 existed, if the column's row was inserted within the
388 transaction), and this column is not allowed to be empty
389 because its <type> has a "min" of 1.
391 "error": "constraint violation"
393 The number of rows in a table exceeds the maximum number
394 permitted by the table's "maxRows" value (see <table-schema>).
396 If "params" contains one or more "wait" operations, then the
397 transaction may take an arbitrary amount of time to complete. The
398 database implementation must be capable of accepting, executing, and
399 replying to other transactions and other JSON-RPC requests while a
400 transaction or transactions containing "wait" operations are
401 outstanding on the same or different JSON-RPC sessions.
403 The section "Notation for the Wire Protocol" below describes
404 additional notation for use with the wire protocol. After that, the
405 "Operations" section describes each operation.
410 Request object members:
412 "method": "cancel" required
413 "params": [the "id" for an outstanding request] required
416 Response object members:
420 This JSON-RPC notification instructs the database server to
421 immediately complete or cancel the "transact" request whose "id" is
422 the same as the notification's "params" value.
424 If the "transact" request can be completed immediately, then the
425 server sends a response in the form described for "transact", above.
426 Otherwise, the server sends a JSON-RPC error response of the following
431 "id": the request "id" member
433 The "cancel" notification itself has no reply.
438 Request object members:
440 "method": "monitor" required
441 "params": [<db-name>, <json-value>, <monitor-requests>] required
442 "id": <nonnull-json-value> required
444 <monitor-requests> is an object that maps from a table name to an
445 array of <monitor-request> objects. For backward compatibility, a
446 single <monitor-request> may be used instead of an array; it is
447 treated as a single-element array.
449 Each <monitor-request> is an object with the following members:
451 "columns": [<column>*] optional
452 "select": <monitor-select> optional
454 <monitor-select> is an object with the following members:
456 "initial": <boolean> optional
457 "insert": <boolean> optional
458 "delete": <boolean> optional
459 "modify": <boolean> optional
461 Response object members:
463 "result": <table-updates>
465 "id": same "id" as request
467 This JSON-RPC request enables a client to replicate tables or subsets
468 of tables within database <db-name>. Each element of
469 <monitor-requests> specifies a table to be replicated. The JSON-RPC
470 response to the "monitor" includes the initial contents of each table,
471 unless disabled (see below). Afterward, when changes to those tables
472 are committed, the changes are automatically sent to the client using
473 the "update" monitor notification. This monitoring persists until the
474 JSON-RPC session terminates or until the client sends a
475 "monitor_cancel" JSON-RPC request.
477 Each <monitor-request> describes how to monitor columns in a table:
479 The circumstances in which an "update" notification is sent for a
480 row within the table are determined by <monitor-select>:
482 If "initial" is omitted or true, every row in the table is
483 sent as part of the reply to the "monitor" request.
485 If "insert" is omitted or true, "update" notifications are
486 sent for rows newly inserted into the table.
488 If "delete" is omitted or true, "update" notifications are
489 sent for rows deleted from the table.
491 If "modify" is omitted or true, "update" notifications are
492 sent whenever when a row in the table is modified.
494 The "columns" member specifies the columns whose values are
495 monitored. It must not contain duplicates. If "columns" is
496 omitted, all columns in the table, except for "_uuid", are
499 If there is more than one <monitor-request> in an array of them, then
500 each <monitor-request> in the array should specify both "columns" and
501 "select", and the "columns" must be non-overlapping sets.
503 The "result" in the JSON-RPC response to the "monitor" request is a
504 <table-updates> object (see below) that contains the contents of the
505 tables for which "initial" rows are selected. If no tables' initial
506 contents are requested, then "result" is an empty object.
511 Notification object members:
514 "params": [<json-value>, <table-updates>]
517 The <json-value> in "params" is the same as the value passed as the
518 <json-value> in "params" for the "monitor" request.
520 <table-updates> is an object that maps from a table name to a
523 A <table-update> is an object that maps from the row's UUID (as a
524 36-byte string) to a <row-update> object.
526 A <row-update> is an object with the following members:
528 "old": <row> present for "delete" and "modify" updates
529 "new": <row> present for "initial", "insert", and "modify" updates
531 This JSON-RPC notification is sent from the server to the client to
532 tell it about changes to a monitored table (or the initial state of a
533 modified table). Each table in which one or more rows has changed (or
534 whose initial view is being presented) is represented in "updates".
535 Each row that has changed (or whose initial view is being presented)
536 is represented in its <table-update> as a member with its name taken
537 from the row's _uuid member. The corresponding value is a
540 The "old" member is present for "delete" and "modify" updates.
541 For "delete" updates, each monitored column is included. For
542 "modify" updates, the prior value of each monitored column whose
543 value has changed is included (monitored columns that have not
544 changed are represented in "new").
546 The "new" member is present for "initial", "insert", and "modify"
547 updates. For "initial" and "insert" updates, each monitored
548 column is included. For "modify" updates, the new value of each
549 monitored column is included.
554 Request object members:
556 "method": "monitor_cancel" required
557 "params": [<json-value>] required
558 "id": <nonnull-json-value> required
560 Response object members:
564 "id": the request "id" member
566 Cancels the ongoing table monitor request, identified by the
567 <json-value> in "params" matching the <json-value> in "params" for an
568 ongoing "monitor" request. No more "update" messages will be sent for
574 Request object members:
576 "method": "echo" required
577 "params": JSON array with any contents required
578 "id": <json-value> required
580 Response object members:
582 "result": same as "params"
584 "id": the request "id" member
586 Both the JSON-RPC client and the server must implement this request.
588 This JSON-RPC request and response can be used to implement connection
589 keepalives, by allowing the server to check that the client is still
593 Notation for the Wire Protocol
594 ------------------------------
598 An <id> that names a database. The valid <db-name>s can be
599 obtained using a "list-db" request. The <db-name> is taken from
600 the "name" member of <database-schema>.
604 An <id> that names a table.
608 An <id> that names a table column.
612 A JSON object that describes a table row or a subset of a table
613 row. Each member is the name of a table column paired with the
614 <value> of that column.
618 A JSON value that represents the value of a column in a table row,
619 one of <atom>, a <set>, or a <map>.
623 A JSON value that represents a scalar value for a column, one of
624 <string>, <number>, <boolean>, <uuid>, <named-uuid>.
628 Either an <atom>, representing a set with exactly one element, or
629 a 2-element JSON array that represents a database set value. The
630 first element of the array must be the string "set" and the second
631 element must be an array of zero or more <atom>s giving the values
632 in the set. All of the <atom>s must have the same type.
636 A 2-element JSON array that represents a database map value. The
637 first element of the array must be the string "map" and the second
638 element must be an array of zero or more <pair>s giving the values
639 in the map. All of the <pair>s must have the same key and value
642 (JSON objects are not used to represent <map> because JSON only
643 allows string names in an object.)
647 A 2-element JSON array that represents a pair within a database
648 map. The first element is an <atom> that represents the key, the
649 second element is an <atom> that represents the value.
653 A 2-element JSON array that represents a UUID. The first element
654 of the array must be the string "uuid" and the second element must
655 be a 36-character string giving the UUID in the format described
656 by RFC 4122. For example, the following <uuid> represents the
657 UUID 550e8400-e29b-41d4-a716-446655440000:
659 ["uuid", "550e8400-e29b-41d4-a716-446655440000"]
663 A 2-element JSON array that represents the UUID of a row inserted
664 in an "insert" operation within the same transaction. The first
665 element of the array must be the string "named-uuid" and the
666 second element should be the string specified as the "uuid-name"
667 for an "insert" operation within the same transaction. For
668 example, if an "insert" operation within this transaction
669 specifies a "uuid-name" of "myrow", the following <named-uuid>
670 represents the UUID created by that operation:
672 ["named-uuid", "myrow"]
674 A <named-uuid> may be used anywhere a <uuid> is valid.
678 A 3-element JSON array of the form [<column>, <function>,
679 <value>] that represents a test on a column value.
681 Except as otherwise specified below, <value> must have the same
684 The meaning depends on the type of <column>:
689 <function> must be "<", "<=", "==", "!=", ">=", ">",
690 "includes", or "excludes".
692 The test is true if the column's value satisfies the
693 relation <function> <value>, e.g. if the column has value
694 1 and <value> is 2, the test is true if <function> is "<",
695 "<=" or "!=", but not otherwise.
697 "includes" is equivalent to "=="; "excludes" is equivalent
704 <function> must be "!=", "==", "includes", or "excludes".
706 If <function> is "==" or "includes", the test is true if
707 the column's value equals <value>. If <function> is "!="
708 or "excludes", the test is inverted.
713 <function> must be "!=", "==", "includes", or "excludes".
715 If <function> is "==", the test is true if the column's
716 value contains exactly the same values (for sets) or pairs
717 (for maps). If <function> is "!=", the test is inverted.
719 If <function> is "includes", the test is true if the
720 column's value contains all of the values (for sets) or
721 pairs (for maps) in <value>. The column's value may also
722 contain other values or pairs.
724 If <function> is "excludes", the test is true if the
725 column's value does not contain any of the values (for
726 sets) or pairs (for maps) in <value>. The column's value
727 may contain other values or pairs not in <value>.
729 If <function> is "includes" or "excludes", then the
730 required type of <value> is slightly relaxed, in that it
731 may have fewer than the minimum number of elements
732 specified by the column's type. If <function> is
733 "excludes", then the required type is additionally relaxed
734 in that <value> may have more than the maximum number of
735 elements specified by the column's type.
739 One of "<", "<=", "==", "!=", ">=", ">", "includes", "excludes".
743 A 3-element JSON array of the form [<column>, <mutator>, <value>]
744 that represents a change to a column value.
746 Except as otherwise specified below, <value> must have the same
749 The meaning depends on the type of <column>:
754 <mutator> must be "+=", "-=", "*=", "/=" or (integer only)
755 "%=". The value of <column> is changed to the sum,
756 difference, product, quotient, or remainder, respectively,
757 of <column> and <value>.
759 Constraints on <column> are ignored when parsing <value>.
765 No valid <mutator>s are currently defined for these types.
769 Any <mutator> valid for the set's element type may be
770 applied to the set, in which case the mutation is applied
771 to each member of the set individually. <value> must be a
772 scalar value of the same type as the set's element type,
773 except that contraints are ignored.
775 If <mutator> is "insert", then each of the values in the
776 set in <value> is added to <column> if it is not already
777 present. The required type of <value> is slightly
778 relaxed, in that it may have fewer than the minimum number
779 of elements specified by the column's type.
781 If <mutator> is "delete", then each of the values in the
782 set in <value> is removed from <column> if it is present
783 there. The required type is slightly relaxed in that
784 <value> may have more or less than the maximum number of
785 elements specified by the column's type.
789 <mutator> must be "insert" or "delete".
791 If <mutator> is "insert", then each of the key-value pairs
792 in the map in <value> is added to <column> only if its key
793 is not already present. The required type of <value> is
794 slightly relaxed, in that it may have fewer than the
795 minimum number of elements specified by the column's type.
797 If <mutator> is "delete", then <value> may have the same
798 type as <column> (a map type) or it may be a set whose
799 element type is the same as <column>'s key type:
801 - If <value> is a map, the mutation deletes each
802 key-value pair in <column> whose key and value equal
803 one of the key-value pairs in <value>.
805 - If <value> is a set, the mutation deletes each
806 key-value pair in <column> whose key equals one of
807 the values in <value>.
809 For "delete", <value> may have any number of elements,
810 regardless of restrictions on the number of elements in
815 One of "+=", "-=", "*=", "/=", "%=", "insert", "delete".
820 Each of the available operations is described below.
825 Request object members:
827 "op": "insert" required
828 "table": <table> required
829 "row": <row> required
830 "uuid-name": <id> optional
832 Result object members:
838 Inserts "row" into "table".
840 If "row" does not specify values for all the columns in "table",
841 those columns receive default values. The default value for a
842 column depends on its type. The default for a column whose <type>
843 specifies a "min" of 0 is an empty set or empty map. Otherwise,
844 the default is a single value or a single key-value pair, whose
845 value(s) depend on its <atomic-type>:
847 - "integer" or "real": 0
851 - "string": "" (the empty string)
853 - "uuid": 00000000-0000-0000-0000-000000000000
855 The new row receives a new, randomly generated UUID.
857 If "uuid-name" is supplied, then it is an error if <id> is not
858 unique among the "uuid-name"s supplied on all the "insert"
859 operations within this transaction.
861 The UUID for the new row is returned as the "uuid" member of the
866 "error": "duplicate uuid-name"
868 The same "uuid-name" appears on another "insert" operation
869 within this transaction.
871 "error": "constraint violation"
873 One of the values in "row" does not satisfy the immediate
874 constraints for its column's <base-type>. This error will
875 occur for columns that are not explicitly set by "row" if the
876 default value does not satisfy the column's constraints.
881 Request object members:
883 "op": "select" required
884 "table": <table> required
885 "where": [<condition>*] required
886 "columns": [<column>*] optional
888 Result object members:
894 Searches "table" for rows that match all the conditions specified
895 in "where". If "where" is an empty array, every row in "table" is
898 The "rows" member of the result is an array of objects. Each
899 object corresponds to a matching row, with each column
900 specified in "columns" as a member, the column's name as the
901 member name and its value as the member value. If "columns"
902 is not specified, all the table's columns are included. If
903 two rows of the result have the same values for all included
904 columns, only one copy of that row is included in "rows".
905 Specifying "_uuid" within "columns" will avoid dropping
906 duplicates, since every row has a unique UUID.
908 The ordering of rows within "rows" is unspecified.
913 Request object members:
915 "op": "update" required
916 "table": <table> required
917 "where": [<condition>*] required
918 "row": <row> required
920 Result object members:
926 Updates rows in a table.
928 Searches "table" for rows that match all the conditions
929 specified in "where". For each matching row, changes the
930 value of each column specified in "row" to the value for that
931 column specified in "row".
933 The "_uuid" and "_version" columns of a table may not be directly
934 updated with this operation. Columns designated read-only in the
935 schema also may not be updated.
937 The "count" member of the result specifies the number of rows
942 "error": "constraint violation"
944 One of the values in "row" does not satisfy the immediate
945 constraints for its column's <base-type>.
949 Request object members:
951 "op": "mutate" required
952 "table": <table> required
953 "where": [<condition>*] required
954 "mutations": [<mutation>*] required
956 Result object members:
962 Mutates rows in a table.
964 Searches "table" for rows that match all the conditions specified
965 in "where". For each matching row, mutates its columns as
966 specified by each <mutation> in "mutations", in the order
969 The "_uuid" and "_version" columns of a table may not be directly
970 modified with this operation. Columns designated read-only in the
971 schema also may not be updated.
973 The "count" member of the result specifies the number of rows
978 "error": "domain error"
980 The result of the mutation is not mathematically defined,
981 e.g. division by zero.
983 "error": "range error"
985 The result of the mutation is not representable within the
986 database's format, e.g. an integer result outside the range
987 INT64_MIN...INT64_MAX or a real result outside the range
990 "error": "constraint violation"
992 The mutation caused the column's value to violate a
993 constraint, e.g. it caused a column to have more or fewer
994 values than are allowed, an arithmetic operation caused a set
995 or map to have duplicate elements, or it violated a constraint
996 specified by a column's <base-type>.
1001 Request object members:
1003 "op": "delete" required
1004 "table": <table> required
1005 "where": [<condition>*] required
1007 Result object members:
1013 Deletes all the rows from "table" that match all the conditions
1014 specified in "where".
1016 The "count" member of the result specifies the number of deleted
1022 Request object members:
1024 "op": "wait" required
1025 "timeout": <integer> optional
1026 "table": <table> required
1027 "where": [<condition>*] required
1028 "columns": [<column>*] required
1029 "until": "==" or "!=" required
1030 "rows": [<row>*] required
1032 Result object members:
1038 Waits until a condition becomes true.
1040 If "until" is "==", checks whether the query on "table" specified
1041 by "where" and "columns", which is evaluated in the same way as
1042 specified for "select", returns the result set specified by
1043 "rows". If it does, then the operation completes successfully.
1044 Otherwise, the entire transaction rolls back. It is automatically
1045 restarted later, after a change in the database makes it possible
1046 for the operation to succeed. The client will not receive a
1047 response until the operation permanently succeeds or fails.
1049 If "until" is "!=", the sense of the test is negated. That is, as
1050 long as the query on "table" specified by "where" and "columns"
1051 returns "rows", the transaction will be rolled back and restarted
1054 If "timeout" is specified, then the transaction aborts after the
1055 specified number of milliseconds. The transaction is guaranteed
1056 to be attempted at least once before it aborts. A "timeout" of 0
1057 will abort the transaction on the first mismatch.
1061 "error": "not supported"
1063 One or more of the columns in this table do not support
1064 triggers. This error will not occur if "timeout" is 0.
1066 "error": "timed out"
1068 The "timeout" was reached before the transaction was able to
1074 Request object members:
1076 "op": "commit" required
1077 "durable": <boolean> required
1079 Result object members:
1085 If "durable" is specified as true, then the transaction, if it
1086 commits, will be stored durably (to disk) before the reply is sent
1091 "error": "not supported"
1093 When "durable" is true, this database implementation does not
1094 support durable commits.
1099 Request object members:
1101 "op": "abort" required
1103 Result object members:
1109 Aborts the transaction with an error. This may be useful for
1116 This operation always fails with this error.
1122 Request object members:
1124 "op": "comment" required
1125 "comment": <string> required
1127 Result object members:
1133 Provides information to a database administrator on the purpose of
1134 a transaction. The OVSDB server, for example, adds comments in
1135 transactions that modify the database to the database journal.