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