ovsdb: Document the "mutable" feature for columns.
[sliver-openvswitch.git] / ovsdb / SPECS
1          ===================================================
2           Open vSwitch Configuration Database Specification
3          ===================================================
4
5 Basic Notation
6 --------------
7
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:
11
12      - Null bytes (\u0000) are not allowed in strings.
13
14      - Only UTF-8 encoding is supported.  (RFC 4627 also mentions
15        UTF-16BE, UTF-16LE, and UTF-32.)
16
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.
20
21 The descriptions below use the following shorthand notations for JSON
22 values.  Additional notation is presented later.
23
24 <string>
25
26     A JSON string.  Any Unicode string is allowed, as specified by RFC
27     4627.  Implementations may disallow null bytes.
28
29 <id>
30
31     A JSON string matching [a-zA-Z_][a-zA-Z0-9_]*.
32
33     <id>s that begin with _ are reserved to the implementation and may
34     not be used by the user.
35
36 <boolean>
37
38     A JSON true or false value.
39
40 <number>
41
42     A JSON number.
43
44 <integer>
45
46     A JSON number with an integer value, within a certain range
47     (currently -2**63...+2**63-1).
48
49 <json-value>
50
51     Any JSON value.
52
53 <nonnull-json-value>
54
55     Any JSON value except null.
56
57 <error>
58
59     A JSON object with the following members:
60
61         "error": <string>                       required
62         "details": <string>                     optional
63
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:
69
70     "error": "resources exhausted"
71
72         The operation requires more resources (memory, disk, CPU,
73         etc.) than are currently available to the database server.
74
75     "error": "I/O error"
76
77         Problems accessing the disk, network, or other required
78         resources prevented the operation from completing.
79
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.
83
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.
88
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
91     of these members.
92
93 Schema Format
94 -------------
95
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.
99
100 <database-schema>
101
102     A JSON object with the following members:
103
104         "name": <id>                            required
105         "tables": {<id>: <table-schema>, ...}   required
106
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.
111
112 <table-schema>
113
114     A JSON object with the following members:
115
116         "columns": {<id>: <column-schema>, ...}   required
117         "maxRows": <integer>                      optional
118
119     The value of "columns" is a JSON object whose names are column
120     names and whose values are <column-schema>s.
121
122     Every table has the following columns whose definitions are not
123     included in the schema:
124
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.
129
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.
138
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.
145
146 <column-schema>
147
148     A JSON object with the following members:
149
150         "type": <type>                            required
151         "ephemeral": <boolean>                    optional
152         "mutable": <boolean>                      optional
153
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
159     "insert" operation.
160
161 <type>
162
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
165     following members:
166
167         "key": <base-type>                 required
168         "value": <base-type>               optional
169         "min": <integer>                   optional
170         "max": <integer> or "unlimited"    optional
171
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".
178
179     If "min" and "max" are both 1 and "value" is not specified, the
180     type is the scalar type specified by "key".
181
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".
184
185     If "value" is specified, the type is a map from type "key" to type
186     "value".
187
188 <base-type>
189
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:
192
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"
203
204     An <atomic-type> by itself is equivalent to a JSON object with a
205     single member "type" whose value is the <atomic-type>.
206
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>.
211
212     "enum" is mutually exclusive with the following constraints.
213
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
217     equal to minInteger.
218
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
222     minReal.
223
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).
229
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":
234
235         - If "refType" is "strong" or if "refType" is omitted, the
236           allowed UUIDs are limited to UUIDs for rows in the named
237           table.
238
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.
242
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.
247
248 <atomic-type>
249
250     One of the strings "integer", "real", "boolean", "string", or
251     "uuid", representing the specified scalar type.
252
253 Wire Protocol
254 -------------
255
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:
259
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
263       server requests.
264
265     * HTTP is more complicated than stream connections and doesn't
266       provide any corresponding advantage.
267
268     * The JSON-RPC specification for HTTP transport is incomplete.
269
270 We are using TCP port 6632 for the database JSON-RPC connection.
271
272 The database wire protocol consists of the following JSON-RPC methods:
273
274 list_dbs
275 ........
276
277 Request object members:
278
279     "method": "list_dbs"              required
280     "params": []                      required
281     "id": <nonnull-json-value>        required
282
283 Response object members:
284
285     "result": [<db-name>, ...]
286     "error": null
287     "id": same "id" as request
288
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
291 connection.
292
293 get_schema
294 ..........
295
296 Request object members:
297
298     "method": "get_schema"            required
299     "params": [<db-name>]             required
300     "id": <nonnull-json-value>        required
301
302 Response object members:
303
304     "result": <database-schema>
305     "error": null
306     "id": same "id" as request
307
308 This operation retrieves a <database-schema> that describes hosted
309 database <db-name>.
310
311 transact
312 ........
313
314 Request object members:
315
316     "method": "transact"                  required
317     "params": [<db-name>, <operation>*]   required
318     "id": <nonnull-json-value>            required
319
320 Response object members:
321
322     "result": [<object>*]
323     "error": null
324     "id": same "id" as request
325
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
330 operations.
331
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
334 a JSON-RPC error.
335
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.
339
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).
345
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:
351
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.
357
358     - An <error>, which indicates that the operation completed with an
359       error.
360
361     - A JSON null value indicates that the operation was not attempted
362       because a prior operation failed.
363
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:
371
372     "error": "referential integrity violation"
373
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.)
381
382     "error": "constraint violation"
383
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.
390
391     "error": "constraint violation"
392
393         The number of rows in a table exceeds the maximum number
394         permitted by the table's "maxRows" value (see <table-schema>).
395
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.
402
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.
406
407 cancel
408 ......
409
410 Request object members:
411
412     "method": "cancel"                              required
413     "params": [the "id" for an outstanding request] required
414     "id": null                                      required
415
416 Response object members:
417
418     <no response>
419
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.  
423
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
427 form:
428
429     "result": null
430     "error": "canceled"
431     "id": the request "id" member
432
433 The "cancel" notification itself has no reply.
434
435 monitor
436 .......
437
438 Request object members:
439
440     "method": "monitor"                                       required
441     "params": [<db-name>, <json-value>, <monitor-requests>]   required
442     "id": <nonnull-json-value>                                required
443
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.
448
449 Each <monitor-request> is an object with the following members:
450
451     "columns": [<column>*]            optional
452     "select": <monitor-select>        optional
453
454 <monitor-select> is an object with the following members:
455
456     "initial": <boolean>              optional
457     "insert": <boolean>               optional
458     "delete": <boolean>               optional
459     "modify": <boolean>               optional
460
461 Response object members:
462
463     "result": <table-updates>
464     "error": null
465     "id": same "id" as request
466
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.
476
477 Each <monitor-request> describes how to monitor columns in a table:
478
479     The circumstances in which an "update" notification is sent for a
480     row within the table are determined by <monitor-select>:
481
482         If "initial" is omitted or true, every row in the table is
483         sent as part of the reply to the "monitor" request.
484
485         If "insert" is omitted or true, "update" notifications are
486         sent for rows newly inserted into the table.
487
488         If "delete" is omitted or true, "update" notifications are
489         sent for rows deleted from the table.
490
491         If "modify" is omitted or true, "update" notifications are
492         sent whenever when a row in the table is modified.
493
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
497     monitored.
498
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.
502
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.
507
508 update
509 ......
510
511 Notification object members:
512
513     "method": "update"
514     "params": [<json-value>, <table-updates>]
515     "id": null
516
517 The <json-value> in "params" is the same as the value passed as the
518 <json-value> in "params" for the "monitor" request.
519
520 <table-updates> is an object that maps from a table name to a
521 <table-update>.
522
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.
525
526 A <row-update> is an object with the following members:
527
528     "old": <row>         present for "delete" and "modify" updates
529     "new": <row>         present for "initial", "insert", and "modify" updates
530
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
538 <row-update>:
539
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").
545
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.
550
551 monitor_cancel
552 ..............
553
554 Request object members:
555
556     "method": "monitor_cancel"                              required
557     "params": [<json-value>]                                required
558     "id": <nonnull-json-value>                              required
559
560 Response object members:
561
562     "result": {}
563     "error": null
564     "id": the request "id" member
565
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
569 this table monitor.
570
571 echo
572 ....
573
574 Request object members:
575
576     "method": "echo"                                required
577     "params": JSON array with any contents          required
578     "id": <json-value>                              required
579
580 Response object members:
581
582     "result": same as "params"
583     "error": null
584     "id": the request "id" member
585
586 Both the JSON-RPC client and the server must implement this request.
587
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
590 there or vice versa.
591
592
593 Notation for the Wire Protocol
594 ------------------------------
595
596 <db-name>
597
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>.
601
602 <table>
603
604     An <id> that names a table.
605
606 <column>
607
608     An <id> that names a table column.
609
610 <row>
611
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.
615
616 <value>
617
618     A JSON value that represents the value of a column in a table row,
619     one of <atom>, a <set>, or a <map>.
620
621 <atom>
622
623     A JSON value that represents a scalar value for a column, one of
624     <string>, <number>, <boolean>, <uuid>, <named-uuid>.
625
626 <set>
627
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.
633
634 <map>
635
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
640     types.
641
642     (JSON objects are not used to represent <map> because JSON only
643     allows string names in an object.)
644
645 <pair>
646
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.
650
651 <uuid>
652
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:
658
659         ["uuid", "550e8400-e29b-41d4-a716-446655440000"]
660
661 <named-uuid>
662
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:
671
672         ["named-uuid", "myrow"]
673
674     A <named-uuid> may be used anywhere a <uuid> is valid.
675
676 <condition>
677
678     A 3-element JSON array of the form [<column>, <function>,
679     <value>] that represents a test on a column value.
680
681     Except as otherwise specified below, <value> must have the same
682     type as <column>.
683
684     The meaning depends on the type of <column>:
685
686         integer
687         real
688
689             <function> must be "<", "<=", "==", "!=", ">=", ">",
690             "includes", or "excludes".
691
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.
696
697             "includes" is equivalent to "=="; "excludes" is equivalent
698             to "!=".
699
700         boolean
701         string
702         uuid
703
704             <function> must be "!=", "==", "includes", or "excludes".
705
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.
709
710         set
711         map
712
713             <function> must be "!=", "==", "includes", or "excludes".
714
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.
718
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.
723
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>.
728
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.
736
737 <function>
738
739     One of "<", "<=", "==", "!=", ">=", ">", "includes", "excludes".
740
741 <mutation>
742
743     A 3-element JSON array of the form [<column>, <mutator>, <value>]
744     that represents a change to a column value.
745
746     Except as otherwise specified below, <value> must have the same
747     type as <column>.
748
749     The meaning depends on the type of <column>:
750
751         integer
752         real
753
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>.
758
759             Constraints on <column> are ignored when parsing <value>.
760
761         boolean
762         string
763         uuid
764
765             No valid <mutator>s are currently defined for these types.
766
767         set
768
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.
774
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.
780
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.
786
787         map
788
789             <mutator> must be "insert" or "delete".
790
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.
796
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:
800
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>.
804
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>.
808
809             For "delete", <value> may have any number of elements,
810             regardless of restrictions on the number of elements in
811             <column>.
812
813 <mutator>
814
815     One of "+=", "-=", "*=", "/=", "%=", "insert", "delete".
816
817 Operations
818 ----------
819
820 Each of the available operations is described below.
821
822 insert
823 ......
824
825 Request object members:
826
827     "op": "insert"          required
828     "table": <table>        required
829     "row": <row>            required
830     "uuid-name": <id>       optional
831
832 Result object members:
833
834     "uuid": <uuid>
835
836 Semantics:
837
838     Inserts "row" into "table".
839
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>:
846
847         - "integer" or "real": 0
848
849         - "boolean": false
850
851         - "string": "" (the empty string)
852
853         - "uuid": 00000000-0000-0000-0000-000000000000
854
855     The new row receives a new, randomly generated UUID.
856
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.
860
861     The UUID for the new row is returned as the "uuid" member of the
862     result.
863
864 Errors:
865
866     "error": "duplicate uuid-name"
867
868         The same "uuid-name" appears on another "insert" operation
869         within this transaction.
870
871     "error": "constraint violation"
872
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.
877
878 select
879 ......
880
881 Request object members:
882
883     "op": "select"                required
884     "table": <table>              required
885     "where": [<condition>*]       required
886     "columns": [<column>*]        optional
887
888 Result object members:
889
890     "rows": [<row>*]
891
892 Semantics:
893
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
896     selected.
897
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.
907
908     The ordering of rows within "rows" is unspecified.
909
910 update
911 ......
912
913 Request object members:
914
915     "op": "update"                required
916     "table": <table>              required
917     "where": [<condition>*]       required
918     "row": <row>                  required
919
920 Result object members:
921
922     "count": <integer>
923
924 Semantics:
925
926     Updates rows in a table.
927
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".
932
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.
936
937     The "count" member of the result specifies the number of rows
938     that matched.
939
940 Errors:
941
942     "error": "constraint violation"
943
944         One of the values in "row" does not satisfy the immediate
945         constraints for its column's <base-type>.
946 mutate
947 ......
948
949 Request object members:
950
951     "op": "mutate"                required
952     "table": <table>              required
953     "where": [<condition>*]       required
954     "mutations": [<mutation>*]    required
955
956 Result object members:
957
958     "count": <integer>
959
960 Semantics:
961
962     Mutates rows in a table.
963
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
967     specified.
968
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.
972
973     The "count" member of the result specifies the number of rows
974     that matched.
975
976 Errors:
977
978     "error": "domain error"
979
980         The result of the mutation is not mathematically defined,
981         e.g. division by zero.
982
983     "error": "range error"
984
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
988         -DBL_MAX...DBL_MAX.
989
990     "error": "constraint violation"
991
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>.
997
998 delete
999 ......
1000
1001 Request object members:
1002
1003     "op": "delete"                required
1004     "table": <table>              required
1005     "where": [<condition>*]       required
1006
1007 Result object members:
1008
1009     "count": <integer>
1010
1011 Semantics:
1012
1013     Deletes all the rows from "table" that match all the conditions
1014     specified in "where".
1015
1016     The "count" member of the result specifies the number of deleted
1017     rows.
1018
1019 wait
1020 ....
1021
1022 Request object members:
1023
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
1031
1032 Result object members:
1033
1034     none
1035
1036 Semantics:
1037
1038     Waits until a condition becomes true.
1039
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.
1048     
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
1052     later.
1053
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.
1058
1059 Errors:
1060
1061     "error": "not supported"
1062
1063         One or more of the columns in this table do not support
1064         triggers.  This error will not occur if "timeout" is 0.
1065
1066     "error": "timed out"
1067
1068         The "timeout" was reached before the transaction was able to
1069         complete.
1070
1071 commit
1072 ......
1073
1074 Request object members:
1075
1076     "op": "commit"                      required
1077     "durable": <boolean>                required
1078
1079 Result object members:
1080
1081     none
1082
1083 Semantics:
1084
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
1087     to the client.
1088
1089 Errors:
1090
1091     "error": "not supported"
1092
1093         When "durable" is true, this database implementation does not
1094         support durable commits.
1095
1096 abort
1097 .....
1098
1099 Request object members:
1100
1101     "op": "abort"                      required
1102
1103 Result object members:
1104
1105     (never succeeds)
1106
1107 Semantics:
1108
1109     Aborts the transaction with an error.  This may be useful for
1110     testing.
1111
1112 Errors:
1113
1114     "error": "aborted"
1115
1116         This operation always fails with this error.
1117
1118 comment
1119 .......
1120
1121
1122 Request object members:
1123
1124     "op": "comment"                    required
1125     "comment": <string>                required
1126
1127 Result object members:
1128
1129     none
1130
1131 Semantics:
1132
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.