ovsdb: Add support for referential integrity in the database itself.
[sliver-openvswitch.git] / ovsdb / SPECS
1          ===================================================
2           Open vSwitch Configuration Database Specification
3          ===================================================
4
5 Basic Notation
6 --------------
7
8 The descriptions below use the following shorthand notations for JSON
9 values.  Additional notation is presented later.
10
11 <string>
12
13     A JSON string.  Any Unicode string is allowed, as specified by RFC
14     4627.  Implementations may disallow null bytes.
15
16 <id>
17
18     A JSON string matching [a-zA-Z_][a-zA-Z0-9_]*.
19
20     <id>s that begin with _ are reserved to the implementation and may
21     not be used by the user.
22
23 <boolean>
24
25     A JSON true or false value.
26
27 <number>
28
29     A JSON number.
30
31 <integer>
32
33     A JSON number with an integer value, within a certain range
34     (currently -2**63...+2**63-1).
35
36 <value>
37
38     Any JSON value.
39
40 <error>
41
42     A JSON object with the following members:
43
44         "error": <string>                       required
45         "details": <string>                     optional
46
47     The value of the "error" member is a short string, specified in
48     this document, that broadly indicates the class of the error.
49     Most "error" strings are specific to contexts described elsewhere
50     in this document, but the following "error" strings may appear in
51     any context where an <error> is permitted:
52
53     "error": "resources exhausted"
54
55         The operation requires more resources (memory, disk, CPU,
56         etc.) than are currently available to the database server.
57
58     "error": "I/O error"
59
60         Problems accessing the disk, network, or other required
61         resources prevented the operation from completing.
62
63     Database implementations may use "error" strings not specified
64     in this document to indicate errors that do not fit into any of
65     the specified categories.
66
67     Optionally, an <error> may include a "details" member, whose value
68     is a string that describes the error in more detail for the
69     benefit of a human user or administrator.  This document does not
70     specify the format or content of the "details" string.
71
72     An <error> may also have other members that describe the error in
73     more detail.  This document does not specify the names or values
74     of these members.
75
76 Schema Format
77 -------------
78
79 An Open vSwitch configuration database consists of a set of tables,
80 each of which has a number of columns and zero or more rows.  A schema
81 is represented by <database-schema>, as described below.
82
83 <database-schema>
84
85     A JSON object with the following members:
86
87         "name": <id>                            required
88         "comment": <string>                     optional
89         "tables": {<id>: <table-schema>, ...}   required
90
91     The "name" identifies the database as a whole.  The "comment"
92     optionally provides more information about the database.  The
93     value of "tables" is a JSON object whose names are table names and
94     whose values are <table-schema>s.
95
96 <table-schema>
97
98     A JSON object with the following members:
99
100         "comment": <string>                       optional
101         "columns": {<id>: <column-schema>, ...}   required
102
103     The "comment" optionally provides information about this table for
104     a human reader.  The value of "columns" is a JSON object whose
105     names are column names and whose values are <column-schema>s.
106
107     Every table has the following columns whose definitions are not
108     included in the schema:
109
110         "_uuid": This column, which contains exactly one UUID value,
111         is initialized to a random value by the database engine when
112         it creates a row.  It is read-only, and its value never
113         changes during the lifetime of a row.
114
115         "_version": Like "_uuid", this column contains exactly one
116         UUID value, initialized to a random value by the database
117         engine when it creates a row, and it is read-only.  However,
118         its value changes to a new random value whenever any other
119         field in the row changes.  Furthermore, its value is
120         ephemeral: when the database is closed and reopened, or when
121         the database process is stopped and then started again, each
122         "_version" also changes to a new random value.
123
124 <column-schema>
125
126     A JSON object with the following members:
127
128         "comment": <string>                       optional
129         "type": <type>                            required
130         "ephemeral": <boolean>                    optional
131
132     The "comment" optionally provides information about this column
133     for a human reader.  The "type" specifies the type of data stored
134     in this column.  If "ephemeral" is specified as true, then this
135     column's values are not guaranteed to be durable; they may be lost
136     when the database restarts.
137
138 <type>
139
140     The type of a database column.  Either an <atomic-type> or a JSON
141     object that describes the type of a database column, with the
142     following members:
143
144         "key": <base-type>                 required
145         "value": <base-type>               optional
146         "min": <integer>                   optional
147         "max": <integer> or "unlimited"    optional
148
149     If "min" or "max" is not specified, each defaults to 1.  If "max"
150     is specified as "unlimited", then there is no specified maximum
151     number of elements, although the implementation will enforce some
152     limit.  After considering defaults, "min" must be exactly 0 or
153     exactly 1, "max" must be at least 1, and "max" must be greater
154     than or equal to "min".
155
156     If "min" and "max" are both 1 and "value" is not specified, the
157     type is the scalar type specified by "key".
158
159     If "min" is not 1 or "max" is not 1, or both, and "value" is not
160     specified, the type is a set of scalar type "key".
161
162     If "value" is specified, the type is a map from type "key" to type
163     "value".
164
165 <base-type>
166
167     The type of a key or value in a database column.  Either an
168     <atomic-type> or a JSON object with the following members:
169
170         "type": <atomic-type>              required
171         "minInteger": <integer>            optional, integers only
172         "maxInteger": <integer>            optional, integers only
173         "minReal": <real>                  optional, reals only
174         "maxReal": <real>                  optional, reals only 
175         "reMatch": <string>                optional, strings only
176         "reComment": <string>              optional, strings only
177         "minLength": <integer>             optional, strings only
178         "maxLength": <integer>             optional, strings only
179         "refTable": <id>                   optional, uuids only
180
181     An <atomic-type> by itself is equivalent to a JSON object with a
182     single member "type" whose value is the <atomic-type>.
183
184     If "type" is "integer", then "minInteger" or "maxInteger" or both
185     may also be specified, restricting the valid integer range.  If
186     both are specified, then the maxInteger must be greater than or
187     equal to minInteger.
188
189     If "type" is "real", then "minReal" or "maxReal" or both may also
190     be specified, restricting the valid real range.  If both are
191     specified, then the maxReal must be greater than or equal to
192     minReal.
193
194     If "type" is "string", then:
195
196         "reMatch" may be a JavaScript (Perl 5-like) regular expression
197         that restricts the allowed values.  The regular expression
198         must match the entire string value, that is, it is treated as
199         if it begins with ^ and ends with $, regardless of whether it
200         really does.
201
202         If "reMatch" is specified, then "reComment" may be a string
203         that describes the allowed values, phrased so that it fits
204         into a sentence such as "This value must be...".
205
206         "minLength" and "maxLength" or both may be specified,
207         restricting the valid length of value strings.  If both are
208         specified, then maxLength must be greater than or equal to
209         minLength.  String length is measured in characters (not bytes
210         or UTF-16 code units).
211
212     If "type" is "uuid", then "refTable", if present, must be the name
213     of a table within this database.  If "refTable" is set, the
214     allowed UUIDs are limited to UUIDs for rows in the named table.
215
216     "refTable" constraints are "deferred" constraints: they are
217     enforced only at transaction commit time (see the "transact"
218     request below).  The other contraints on <base-type> are
219     "immediate", enforced immediately by each operation.
220
221 <atomic-type>
222
223     One of the strings "integer", "real", "boolean", "string", or
224     "uuid", representing the specified scalar type.
225
226 Wire Protocol
227 -------------
228
229 The database wire protocol is implemented in JSON-RPC 1.0.  We
230 encourage use of JSON-RPC over stream connections instead of JSON-RPC
231 over HTTP, for these reasons:
232
233     * JSON-RPC is a peer-to-peer protocol, but HTTP is a client-server
234       protocol, which is a poor match.  Thus, JSON-RPC over HTTP
235       requires the client to periodically poll the server to receive
236       server requests.
237
238     * HTTP is more complicated than stream connections and doesn't
239       provide any corresponding advantage.
240
241     * The JSON-RPC specification for HTTP transport is incomplete.
242
243 The database wire protocol consists of the following JSON-RPC methods:
244
245 get_schema
246 ..........
247
248 Request object members:
249
250     "method": "get_schema"            required
251     "params": []                      required
252     "id": any JSON value except null  required
253
254 Response object members:
255
256     "result": <database-schema>
257     "error": null
258     "id": same "id" as request
259
260 This operation retrieves a <database-schema> that describes the
261 hosted database.
262
263 transact
264 ........
265
266 Request object members:
267
268     "method": "transact"              required
269     "params": [<operation>*]          required
270     "id": any JSON value except null  required
271
272 Response object members:
273
274     "result": [<object>*]
275     "error": null
276     "id": same "id" as request
277
278 The "params" array for this method consists of zero or more JSON
279 objects, each of which represents a single database operation.  The
280 "Operations" section below describes the valid operations.
281
282 The value of "id" must be unique among all in-flight transactions
283 within the current JSON-RPC session.  Otherwise, the server may return
284 a JSON-RPC error.
285
286 The database server executes each of the specified operations in the
287 specified order, except that if an operation fails, then the remaining
288 operations are not executed.
289
290 The set of operations is executed as a single atomic, consistent,
291 isolated transaction.  The transaction is committed only if every
292 operation succeeds.  Durability of the commit is not guaranteed unless
293 the "commit" operation, with "durable" set to true, is included in the
294 operation set (see below).
295
296 Regardless of whether errors occur, the response is always a JSON-RPC
297 response with null "error" and a "result" member that is an array with
298 the same number of elements as "params".  Each element of the "result"
299 array corresponds to the same element of the "params" array.  The
300 "result" array elements may be interpreted as follows:
301
302     - A JSON object that does not contain an "error" member indicates
303       that the operation completed successfully.  The specific members
304       of the object are specified below in the descriptions of
305       individual operations.  Some operations do not produce any
306       results, in which case the object will have no members.
307
308     - An <error>, which indicates that the operation completed with an
309       error.
310
311     - A JSON null value indicates that the operation was not attempted
312       because a prior operation failed.
313
314 In general, "result" contains some number of successful results,
315 possibly followed by an error, in turn followed by enough JSON null
316 values to match the number of elements in "params".  There is one
317 exception: if all of the operations succeed, but the results cannot be
318 committed, then "result" will have one more element than "params",
319 with the additional element an <error>.  The possible "error" strings
320 include at least the following:
321
322     "error": "referential integrity violation"
323
324         When the commit was attempted, a column's value referenced the
325         UUID for a row that did not exist in the table named by the
326         column's <base-type> key or value "refTable".  (This can be
327         caused by inserting a row that references a nonexistent row,
328         by deleting a row that is still referenced by another row, by
329         specifying the UUID for a row in the wrong table, and other
330         ways.)
331
332 If "params" contains one or more "wait" operations, then the
333 transaction may take an arbitrary amount of time to complete.  The
334 database implementation must be capable of accepting, executing, and
335 replying to other transactions and other JSON-RPC requests while a
336 transaction or transactions containing "wait" operations are
337 outstanding on the same or different JSON-RPC sessions.
338
339 The section "Notation for the Wire Protocol" below describes
340 additional notation for use with the wire protocol.  After that, the
341 "Operations" section describes each operation.
342
343 cancel
344 ......
345
346 Request object members:
347
348     "method": "cancel"                              required
349     "params": [the "id" for an outstanding request] required
350     "id": null                                      required
351
352 Response object members:
353
354     <no response>
355
356 This JSON-RPC notification instructs the database server to
357 immediately complete or cancel the "transact" request whose "id" is
358 the same as the notification's "params" value.  
359
360 If the "transact" request can be completed immediately, then the
361 server sends a response in the form described for "transact", above.
362 Otherwise, the server sends a JSON-RPC error response of the following
363 form:
364
365     "result": null
366     "error": "canceled"
367     "id": the request "id" member
368
369 The "cancel" notification itself has no reply.
370
371 monitor
372 .......
373
374 Request object members:
375
376     "method": "monitor"                        required
377     "params": [<value>, <monitor-requests>]    required
378     "id": any JSON value except null           required
379
380 <monitor-requests> is an object that maps from a table name to a
381 <monitor-request>.
382
383 Each <monitor-request> is an object with the following members:
384
385     "columns": [<column>*]            optional
386     "select": <monitor-select>        optional
387
388 <monitor-select> is an object with the following members:
389
390     "initial": <boolean>              optional
391     "insert": <boolean>               optional
392     "delete": <boolean>               optional
393     "modify": <boolean>               optional
394
395 Response object members:
396
397     "result": <table-updates>
398     "error": null
399     "id": same "id" as request
400
401 This JSON-RPC request enables a client to replicate tables or subsets
402 of tables.  Each <monitor-request> specifies a table to be replicated.
403 The JSON-RPC response to the "monitor" includes the initial contents
404 of each table.  Afterward, when changes to those tables are committed,
405 the changes are automatically sent to the client using the "update"
406 monitor notification.  This monitoring persists until the JSON-RPC
407 session terminates or until the client sends a "monitor_cancel"
408 JSON-RPC request.
409
410 Each <monitor-request> describes how to monitor a table:
411
412     The circumstances in which an "update" notification is sent for a
413     row within the table are determined by <monitor-select>:
414
415         If "initial" is omitted or true, every row in the table is
416         sent as part of the reply to the "monitor" request.
417
418         If "insert" is omitted or true, "update" notifications are
419         sent for rows newly inserted into the table.
420
421         If "delete" is omitted or true, "update" notifications are
422         sent for rows deleted from the table.
423
424         If "modify" is omitted or true, "update" notifications are
425         sent whenever when a row in the table is modified.
426
427     The "columns" member specifies the columns whose values are
428     monitored.  If "columns" is omitted, all columns in the table,
429     except for "_uuid", are monitored.
430
431 The "result" in the JSON-RPC response to the "monitor" request is a
432 <table-updates> object (see below) that contains the contents of the
433 tables for which "initial" rows are selected.  If no tables' initial
434 contents are requested, then "result" is an empty object.
435
436 update
437 ......
438
439 Notification object members:
440
441     "method": "update"
442     "params": [<value>, <table-updates>]
443     "id": null
444
445 The <value> in "params" is the same as the value passed as the <value>
446 in "params" for the "monitor" request.
447
448 <table-updates> is an object that maps from a table name to a
449 <table-update>.
450
451 A <table-update> is an object that maps from the row's UUID (as a
452 36-byte string) to a <row-update> object.
453
454 A <row-update> is an object with the following members:
455
456     "old": <row>         present for "delete" and "modify" updates
457     "new": <row>         present for "initial", "insert", and "modify" updates
458
459 This JSON-RPC notification is sent from the server to the client to
460 tell it about changes to a monitored table (or the initial state of a
461 modified table).  Each table in which one or more rows has changed (or
462 whose initial view is being presented) is represented in "updates".
463 Each row that has changed (or whose initial view is being presented)
464 is represented in its <table-update> as a member with its name taken
465 from the row's _uuid member.  The corresponding value is a
466 <row-update>:
467
468     The "old" member is present for "delete" and "modify" updates.
469     For "delete" updates, each monitored column is included.  For
470     "modify" updates, the prior value of each monitored column whose
471     value has changed is included (monitored columns that have not
472     changed are represented in "new").
473
474     The "new" member is present for "initial", "insert", and "modify"
475     updates.  For "initial" and "insert" updates, each monitored
476     column is included.  For "modify" updates, the new value of each
477     monitored column is included.
478
479 monitor_cancel
480 ..............
481
482 Request object members:
483
484     "method": "monitor_cancel"                              required
485     "params": [<value>]                                     required
486     "id": any JSON value except null                        required
487
488 Response object members:
489
490     "result": {}
491     "error": null
492     "id": the request "id" member
493
494 Cancels the ongoing table monitor request, identified by the <value>
495 in "params" matching the <value> in "params" for an ongoing "monitor"
496 request.  No more "update" messages will be sent for this table
497 monitor.
498
499 echo
500 ....
501
502 Request object members:
503
504     "method": "echo"                                required
505     "params": JSON array with any contents          required
506     "id": <value>                                   required
507
508 Response object members:
509
510     "result": same as "params"
511     "error": null
512     "id": the request "id" member
513
514 Both the JSON-RPC client and the server must implement this request.
515
516 This JSON-RPC request and response can be used to implement connection
517 keepalives, by allowing the server to check that the client is still
518 there or vice versa.
519
520
521 Notation for the Wire Protocol
522 ------------------------------
523
524 <table>
525
526     An <id> that names a table.
527
528 <column>
529
530     An <id> that names a table column.
531
532 <row>
533
534     A JSON object that describes a table row or a subset of a table
535     row.  Each member is the name of a table column paired with the
536     <value> of that column.
537
538 <value>
539
540     A JSON value that represents the value of a column in a table row,
541     one of <atom>, a <set>, or a <map>.
542
543 <atom>
544
545     A JSON value that represents a scalar value for a column, one of
546     <string>, <number>, <boolean>, <uuid>, <named-uuid>.
547
548 <set>
549
550     A 2-element JSON array that represents a database set value.  The
551     first element of the array must be the string "set" and the second
552     element must be an array of zero or more <atom>s giving the values
553     in the set.  All of the <atom>s must have the same type.
554
555 <map>
556
557     A 2-element JSON array that represents a database map value.  The
558     first element of the array must be the string "map" and the second
559     element must be an array of zero or more <pair>s giving the values
560     in the map.  All of the <pair>s must have the same key and value
561     types.
562
563     (JSON objects are not used to represent <map> because JSON only
564     allows string names in an object.)
565
566 <pair>
567
568     A 2-element JSON array that represents a pair within a database
569     map.  The first element is an <atom> that represents the key, the
570     second element is an <atom> that represents the value.
571
572 <uuid>
573
574     A 2-element JSON array that represents a UUID.  The first element
575     of the array must be the string "uuid" and the second element must
576     be a 36-character string giving the UUID in the format described
577     by RFC 4122.  For example, the following <uuid> represents the
578     UUID 550e8400-e29b-41d4-a716-446655440000:
579
580         ["uuid", "550e8400-e29b-41d4-a716-446655440000"]
581
582 <named-uuid>
583
584     A 2-element JSON array that represents the UUID of a row inserted
585     in a previous "insert" operation within the same transaction.  The
586     first element of the array must be the string "named-uuid" and the
587     second element must be the string specified on this "insert"
588     operation's "uuid-name" or on a preceding "insert" within the same
589     transaction.  For example, if this or a previous "insert"
590     operation specified a "uuid-name" of "myrow", the following
591     <named-uuid> represents the UUID created by that operation:
592
593         ["named-uuid", "myrow"]
594
595     A <named-uuid> may be used anywhere a <uuid> is valid.
596
597 <condition>
598
599     A 3-element JSON array of the form [<column>, <function>,
600     <value>] that represents a test on a column value.
601
602     Except as otherwise specified below, <value> must have the same
603     type as <column>.
604
605     The meaning depends on the type of <column>:
606
607         integer
608         real
609
610             <function> must be "<", "<=", "==", "!=", ">=", ">",
611             "includes", or "excludes".
612
613             The test is true if the column's value satisfies the
614             relation <function> <value>, e.g. if the column has value
615             1 and <value> is 2, the test is true if <function> is "<",
616             "<=" or "!=", but not otherwise.
617
618             "includes" is equivalent to "=="; "excludes" is equivalent
619             to "!=".
620
621         boolean
622         string
623         uuid
624
625             <function> must be "!=", "==", "includes", or "excludes".
626
627             If <function> is "==" or "includes", the test is true if
628             the column's value equals <value>.  If <function> is "!="
629             or "excludes", the test is inverted.
630
631         set
632         map
633
634             <function> must be "!=", "==", "includes", or "excludes".
635
636             If <function> is "==", the test is true if the column's
637             value contains exactly the same values (for sets) or pairs
638             (for maps).  If <function> is "!=", the test is inverted.
639
640             If <function> is "includes", the test is true if the
641             column's value contains all of the values (for sets) or
642             pairs (for maps) in <value>.  The column's value may also
643             contain other values or pairs.
644
645             If <function> is "excludes", the test is true if the
646             column's value does not contain any of the values (for
647             sets) or pairs (for maps) in <value>.  The column's value
648             may contain other values or pairs not in <value>.
649
650             If <function> is "includes" or "excludes", then the
651             required type of <value> is slightly relaxed, in that it
652             may have fewer than the minimum number of elements
653             specified by the column's type.  If <function> is
654             "excludes", then the required type is additionally relaxed
655             in that <value> may have more than the maximum number of
656             elements specified by the column's type.
657
658 <function>
659
660     One of "<", "<=", "==", "!=", ">=", ">", "includes", "excludes".
661
662 <mutation>
663
664     A 3-element JSON array of the form [<column>, <mutator>, <value>]
665     that represents a change to a column value.
666
667     Except as otherwise specified below, <value> must have the same
668     type as <column>.
669
670     The meaning depends on the type of <column>:
671
672         integer
673         real
674
675             <mutator> must be "+=", "-=", "*=", "/=" or (integer only)
676             "%=".  The value of <column> is changed to the sum,
677             difference, product, quotient, or remainder, respectively,
678             of <column> and <value>.
679
680             Constraints on <column> are ignored when parsing <value>.
681
682         boolean
683         string
684         uuid
685
686             No valid <mutator>s are currently defined for these types.
687
688         set
689
690             Any <mutator> valid for the set's element type may be
691             applied to the set, in which case the mutation is applied
692             to each member of the set individually.  <value> must be a
693             scalar value of the same type as the set's element type,
694             except that contraints are ignored.
695
696             If <mutator> is "insert", then each of the values in the
697             set in <value> is added to <column> if it is not already
698             present.  The required type of <value> is slightly
699             relaxed, in that it may have fewer than the minimum number
700             of elements specified by the column's type.
701
702             If <mutator> is "delete", then each of the values in the
703             set in <value> is removed from <column> if it is present
704             there.  The required type is slightly relaxed in that
705             <value> may have more or less than the maximum number of
706             elements specified by the column's type.
707
708         map
709
710             <mutator> must be "insert" or "delete".
711
712             If <mutator> is "insert", then each of the key-value pairs
713             in the map in <value> is added to <column> only if its key
714             is not already present.  The required type of <value> is
715             slightly relaxed, in that it may have fewer than the
716             minimum number of elements specified by the column's type.
717
718             If <mutator> is "delete", then <value> may have the same
719             type as <column> (a map type) or it may be a set whose
720             element type is the same as <column>'s key type:
721
722                 - If <value> is a map, the mutation deletes each
723                   key-value pair in <column> whose key and value equal
724                   one of the key-value pairs in <value>.
725
726                 - If <value> is a set, the mutation deletes each
727                   key-value pair in <column> whose key equals one of
728                   the values in <value>.
729
730             For "delete", <value> may have any number of elements,
731             regardless of restrictions on the number of elements in
732             <column>.
733
734 <mutator>
735
736     One of "+=", "-=", "*=", "/=", "%=", "insert", "delete".
737
738 Operations
739 ----------
740
741 Each of the available operations is described below.
742
743 insert
744 ......
745
746 Request object members:
747
748     "op": "insert"          required
749     "table": <table>        required
750     "row": <row>            required
751     "uuid-name": <id>       optional
752
753 Result object members:
754
755     "uuid": <uuid>
756
757 Semantics:
758
759     Inserts "row" into "table".
760
761     If "row" does not specify values for all the columns in "table",
762     those columns receive default values.  The default value for a
763     column depends on its type.  The default for a column whose <type>
764     specifies a "min" of 0 is an empty set or empty map.  Otherwise,
765     the default is a single value or a single key-value pair, whose
766     value(s) depend on its <atomic-type>:
767
768         - "integer" or "real": 0
769
770         - "boolean": false
771
772         - "string": "" (the empty string)
773
774         - "uuid": 00000000-0000-0000-0000-000000000000
775
776     If "uuid-name" is not supplied, the new row receives a new,
777     randomly generated UUID.
778
779     If "uuid-name" is supplied, then it is an error if <id> has
780     previously appeared as the "uuid-name" in an "insert" operation.
781
782     If "uuid-name" is supplied and its <id> previously appeared as the
783     "uuid-name" in a "declare" operation, then the new row receives
784     the UUID associated with that "uuid-name".
785
786     If "uuid-name" is supplied and its <id> has not previously
787     appeared as the "uuid-name" in a "declare" operation, then the new
788     row also receives a new, randomly generated UUID.  This UUID is
789     also made available under that name to this operation and later
790     operations within the same transaction.
791
792     The UUID for the new row is returned as the "uuid" member of the
793     result.
794
795 Errors:
796
797     "error": "duplicate uuid-name"
798
799         The same "uuid-name" appeared on an earlier "insert" operation
800         within this transaction.
801
802     "error": "constraint violation"
803
804         One of the values in "row" does not satisfy the immediate
805         constraints for its column's <base-type>.  This error will
806         occur for columns that are not explicitly set by "row" if the
807         default value does not satisfy the column's constraints.
808
809 select
810 ......
811
812 Request object members:
813
814     "op": "select"                required
815     "table": <table>              required
816     "where": [<condition>*]       required
817     "columns": [<column>*]        optional
818
819 Result object members:
820
821     "rows": [<row>*]
822
823 Semantics:
824
825     Searches "table" for rows that match all the conditions specified
826     in "where".  If "where" is an empty array, every row in "table" is
827     selected.
828
829     The "rows" member of the result is an array of objects.  Each
830     object corresponds to a matching row, with each column
831     specified in "columns" as a member, the column's name as the
832     member name and its value as the member value.  If "columns"
833     is not specified, all the table's columns are included.  If
834     two rows of the result have the same values for all included
835     columns, only one copy of that row is included in "rows".
836     Specifying "_uuid" within "columns" will avoid dropping
837     duplicates, since every row has a unique UUID.
838
839     The ordering of rows within "rows" is unspecified.
840
841 update
842 ......
843
844 Request object members:
845
846     "op": "update"                required
847     "table": <table>              required
848     "where": [<condition>*]       required
849     "row": <row>                  required
850
851 Result object members:
852
853     "count": <integer>
854
855 Semantics:
856
857     Updates rows in a table.
858
859     Searches "table" for rows that match all the conditions
860     specified in "where".  For each matching row, changes the
861     value of each column specified in "row" to the value for that
862     column specified in "row".
863
864     The "_uuid" and "_version" columns of a table may not be directly
865     updated with this operation.  Columns designated read-only in the 
866     schema also may not be updated.
867
868     The "count" member of the result specifies the number of rows
869     that matched.
870
871 Errors:
872
873     "error": "constraint violation"
874
875         One of the values in "row" does not satisfy the immediate
876         constraints for its column's <base-type>.
877 mutate
878 ......
879
880 Request object members:
881
882     "op": "mutate"                required
883     "table": <table>              required
884     "where": [<condition>*]       required
885     "mutations": [<mutation>*]    required
886
887 Result object members:
888
889     "count": <integer>
890
891 Semantics:
892
893     Mutates rows in a table.
894
895     Searches "table" for rows that match all the conditions specified
896     in "where".  For each matching row, mutates its columns as
897     specified by each <mutation> in "mutations", in the order
898     specified.
899
900     The "_uuid" and "_version" columns of a table may not be directly
901     modified with this operation.  Columns designated read-only in the
902     schema also may not be updated.
903
904     The "count" member of the result specifies the number of rows
905     that matched.
906
907 Errors:
908
909     "error": "domain error"
910
911         The result of the mutation is not mathematically defined,
912         e.g. division by zero.
913
914     "error": "range error"
915
916         The result of the mutation is not representable within the
917         database's format, e.g. an integer result outside the range
918         INT64_MIN...INT64_MAX or a real result outside the range
919         -DBL_MAX...DBL_MAX.
920
921     "error": "constraint violation"
922
923         The mutation caused the column's value to violate a
924         constraint, e.g. it caused a column to have more or fewer
925         values than are allowed, an arithmetic operation caused a set
926         or map to have duplicate elements, or it violated a constraint
927         specified by a column's <base-type>.
928
929 delete
930 ......
931
932 Request object members:
933
934     "op": "delete"                required
935     "table": <table>              required
936     "where": [<condition>*]       required
937
938 Result object members:
939
940     "count": <integer>
941
942 Semantics:
943
944     Deletes all the rows from "table" that match all the conditions
945     specified in "where".
946
947     The "count" member of the result specifies the number of deleted
948     rows.
949
950 wait
951 ....
952
953 Request object members:
954
955     "op": "wait"                        required
956     "timeout": <integer>                optional
957     "table": <table>                    required
958     "where": [<condition>*]             required
959     "columns": [<column>*]              required
960     "until": "==" or "!="               required
961     "rows": [<row>*]                    required
962
963 Result object members:
964
965     none
966
967 Semantics:
968
969     Waits until a condition becomes true.
970
971     If "until" is "==", checks whether the query on "table" specified
972     by "where" and "columns", which is evaluated in the same way as
973     specified for "select", returns the result set specified by
974     "rows".  If it does, then the operation completes successfully.
975     Otherwise, the entire transaction rolls back.  It is automatically
976     restarted later, after a change in the database makes it possible
977     for the operation to succeed.  The client will not receive a
978     response until the operation permanently succeeds or fails.
979     
980     If "until" is "!=", the sense of the test is negated.  That is, as
981     long as the query on "table" specified by "where" and "columns"
982     returns "rows", the transaction will be rolled back and restarted
983     later.
984
985     If "timeout" is specified, then the transaction aborts after the
986     specified number of milliseconds.  The transaction is guaranteed
987     to be attempted at least once before it aborts.  A "timeout" of 0
988     will abort the transaction on the first mismatch.
989
990 Errors:
991
992     "error": "not supported"
993
994         One or more of the columns in this table do not support
995         triggers.  This error will not occur if "timeout" is 0.
996
997     "error": "timed out"
998
999         The "timeout" was reached before the transaction was able to
1000         complete.
1001
1002 commit
1003 ......
1004
1005 Request object members:
1006
1007     "op": "commit"                      required
1008     "durable": <boolean>                required
1009
1010 Result object members:
1011
1012     none
1013
1014 Semantics:
1015
1016     If "durable" is specified as true, then the transaction, if it
1017     commits, will be stored durably (to disk) before the reply is sent
1018     to the client.
1019
1020 Errors:
1021
1022     "error": "not supported"
1023
1024         When "durable" is true, this database implementation does not
1025         support durable commits.
1026
1027 abort
1028 .....
1029
1030 Request object members:
1031
1032     "op": "abort"                      required
1033
1034 Result object members:
1035
1036     (never succeeds)
1037
1038 Semantics:
1039
1040     Aborts the transaction with an error.  This may be useful for
1041     testing.
1042
1043 Errors:
1044
1045     "error": "aborted"
1046
1047         This operation always fails with this error.
1048
1049 declare
1050 .......
1051
1052 Request object members:
1053
1054     "op": "declare"                    required
1055     "uuid-name": <id>                  required
1056
1057 Result object members:
1058
1059     "uuid": <uuid>
1060
1061 Semantics:
1062
1063     Predeclares a UUID named <id> that may be referenced in later
1064     operations as ["named-uuid", <id>] or (at most once) in an
1065     "insert" operation as "uuid-name".
1066
1067     It is an error if <id> has appeared as the "uuid-name" in a prior
1068     "insert" or "declare" operation within this transaction.
1069
1070     The generated UUID is returned as the "uuid" member of the result.
1071
1072 Errors:
1073
1074     "error": "duplicate uuid-name"
1075
1076         The same "uuid-name" appeared on an earlier "insert" or
1077         "declare" operation within this transaction.
1078
1079 comment
1080 .......
1081
1082
1083 Request object members:
1084
1085     "op": "comment"                    required
1086     "comment": <string>                required
1087
1088 Result object members:
1089
1090     none
1091
1092 Semantics:
1093
1094     Provides information to a database administrator on the purpose of
1095     a transaction.  The OVSDB server, for example, adds comments in
1096     transactions that modify the database to the database journal.