Code

sysdbql(7): Documented arrays.
[sysdb.git] / doc / sysdbql.7.txt
index 03e09c7b20eb3b1a714ce11440545b2d3565a1bf..46abfd3e7f0c902dd5ec0222af4802887915dafc 100644 (file)
@@ -15,6 +15,7 @@ SYNOPSIS
   FETCH host 'some.host.name';
 
   LOOKUP hosts MATCHING attribute['architecture'] = 'amd64'
   FETCH host 'some.host.name';
 
   LOOKUP hosts MATCHING attribute['architecture'] = 'amd64'
+                   AND 'backend::collectd::unixsock' in backend
                FILTER age < 5 * interval;
 
 DESCRIPTION
                FILTER age < 5 * interval;
 
 DESCRIPTION
@@ -127,7 +128,9 @@ Boolean expressions may use the following operators:
        of the second expression which has to be an array value (e.g., *backend*
        field). If the second value is not an array or if the type of the first
        value does not match the array's element type, the expression always
        of the second expression which has to be an array value (e.g., *backend*
        field). If the second value is not an array or if the type of the first
        value does not match the array's element type, the expression always
-       evaluates to false.
+       evaluates to false. The first value may also be an array. In this case,
+       the expression evaluates to true if all elements of that array are
+       included in the second array where order does not matter.
 
 Parentheses ('()') may be used around subexpressions to group them and enforce
 precedence.
 
 Parentheses ('()') may be used around subexpressions to group them and enforce
 precedence.
@@ -246,6 +249,12 @@ all types may be used in any place where a value is expected.
        (minutes), *s* (seconds), *ms* (milliseconds), *us* (microseconds), or
        *ns* (nanoseconds). Note that years and months are approximations.
 
        (minutes), *s* (seconds), *ms* (milliseconds), *us* (microseconds), or
        *ns* (nanoseconds). Note that years and months are approximations.
 
+*Array constants*::
+       An array stores of one or more values of the same type. It may be
+       specified as a comma-separated list of constant values enclosed in square
+       brackets ('[<elem1>,<elem2>,...]'). For each value, the same rules apply
+       as for a regular constant value of that type.
+
 RESPONSE FORMAT
 ---------------
 The JavaScript Object Notation (JSON) format, as specified in RFC 4627, is
 RESPONSE FORMAT
 ---------------
 The JavaScript Object Notation (JSON) format, as specified in RFC 4627, is
@@ -260,11 +269,13 @@ replies look like. The replies are pretty-printed to more easily follow them.
   [{
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
   [{
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
-      "update_interval": "5m4s"
+      "update_interval": "5m4s",
+      "backend": ['backend::mk-livestatus']
     },{
       "name": "host2.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
     },{
       "name": "host2.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
-      "update_interval": "5m4s"
+      "update_interval": "10s",
+      "backend": ['backend::mk-livestatus','backend::collectd::unixsock']
     }]
 
   FETCH host 'host1.example.com';
     }]
 
   FETCH host 'host1.example.com';
@@ -272,18 +283,21 @@ replies look like. The replies are pretty-printed to more easily follow them.
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s",
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s",
+      "backend": ['backend::mk-livestatus'],
       "attributes": [{
           "name": "architecture",
           "value": "amd64",
           "last_update": "2001-02-03 04:05:06 +0700",
       "attributes": [{
           "name": "architecture",
           "value": "amd64",
           "last_update": "2001-02-03 04:05:06 +0700",
-          "update_interval": "5m4s"
+          "update_interval": "5m4s",
+          "backend": ['backend::mk-livestatus']
         },{
           ...
         }],
       "services": [{
           "name": "some service",
           "last_update": "2001-02-03 04:05:06 +0700",
         },{
           ...
         }],
       "services": [{
           "name": "some service",
           "last_update": "2001-02-03 04:05:06 +0700",
-          "update_interval": "5m4s"
+          "update_interval": "5m4s",
+          "backend": ['backend::mk-livestatus']
         },{
           ...
         }]}
         },{
           ...
         }]}
@@ -293,18 +307,21 @@ replies look like. The replies are pretty-printed to more easily follow them.
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s",
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s",
+      "backend": ['backend::mk-livestatus'],
       "attributes": [{
           "name": "architecture",
           "value": "amd64",
           "last_update": "2001-02-03 04:05:06 +0700",
       "attributes": [{
           "name": "architecture",
           "value": "amd64",
           "last_update": "2001-02-03 04:05:06 +0700",
-          "update_interval": "5m4s"
+          "update_interval": "5m4s",
+          "backend": ['backend::mk-livestatus']
         },{
           ...
         }],
       "services": [{
           "name": "some service",
           "last_update": "2001-02-03 04:05:06 +0700",
         },{
           ...
         }],
       "services": [{
           "name": "some service",
           "last_update": "2001-02-03 04:05:06 +0700",
-          "update_interval": "5m4s"
+          "update_interval": "5m4s",
+          "backend": ['backend::mk-livestatus']
         },{
           ...
     }]},{
         },{
           ...
     }]},{