Code

data_test: Removed unnecessary and possibly misleading checks.
[sysdb.git] / doc / sysdbql.7.txt
index 85aa205f5bdf7d2e01499180380bcd4cb559b580..88ce0974bf93eb6aca70d25ecd2071ce3c9d1493 100644 (file)
@@ -4,25 +4,26 @@ sysdbql(7)
 
 NAME
 ----
-sysdbql - the SysDB query language
+sysdbql - the SysDB query language (SysQL)
 
 SYNOPSIS
 --------
 
   LIST hosts;
+  LIST services;
 
   FETCH host 'some.host.name';
 
-  LOOKUP hosts MATCHING attribute.architecture = 'amd64'
-               FILTER :age < 5 * :interval;
+  LOOKUP hosts MATCHING attribute[architecture] = 'amd64'
+               FILTER .age < 5 * .interval;
 
 DESCRIPTION
 -----------
 include::sysdb-description.txt[]
 
-The SysDB query language is a human-readable format for describing a request
-to retrieve data from a SysDB daemon. It is very remotely similar to the
-Standard Query Language (SQL) supported by relational database management
+The SysDB query language (SysQL) is a human-readable format for describing a
+request to retrieve data from a SysDB daemon. It is very remotely similar to
+the Standard Query Language (SQL) supported by relational database management
 systems (RDBMS) but specialized for SysDB's use-case.
 
 QUERY COMMANDS
@@ -30,11 +31,13 @@ QUERY COMMANDS
 Each command is terminated by a semicolon. The following commands are
 available to retrieve information from SysDB:
 
-*LIST* hosts [*FILTER* '<filter_condition>']::
-Retrieve a sorted (by name) list of all hosts currently stored in SysDB. The
-return value is a list of hosts where each host specification includes its
-name, the timestamp of the last update of the object known to SysDB and an
-approximation of the interval with which the host was updated. If a filter
+*LIST* hosts|services|metrics [*FILTER* '<filter_condition>']::
+Retrieve a sorted (by name) list of all hosts currently stored in SysDB along
+with their services or metrics if requested. The return value is a list of
+hosts where each host specification includes its name, the timestamp of the
+last update of the object known to SysDB and an approximation of the interval
+with which the host was updated. When listing services or metrics, the
+respective objects will be included for each host as well. If a filter
 condition is specified, only objects matching that filter will be included in
 the reply. See the section "FILTER clause" for more details about how to
 specify the search and filter conditions.
@@ -96,11 +99,11 @@ The following fields may be queried:
 *attribute*::
        The full name of a host attribute.
 
-*attribute.*'<name>'::
+*attribute[*'<name>'*]*::
        The value of the named host attribute. If an attribute of the specified
-       does not exist, each comparison is treated as if the value does not match.
-       See the documentation for the *IS NULL* and *IS NOT NULL* operators for
-       ways to check if an attribute exists.
+       name does not exist, each comparison is treated as if the value does not
+       match. See the documentation for the *IS NULL* and *IS NOT NULL* operators
+       for ways to check if an attribute exists.
 
 '<value>' may either be a string (when matching by object names) or match the
 type of the attribute's value (when matching attribute values). Attribute
@@ -150,20 +153,20 @@ above).
 
 The following fields (core properties) of stored objects may be queried:
 
-*:last_update*::
+*.last_update*::
        The timestamp of the last update of the object. This value is based on
        information provided by the queried backend if possible.
 
-*:age*::
+*.age*::
        The amount of time since the last update of the object.
 
-*:interval*::
+*.interval*::
        The interval with which the object gets updated. This value is determined
        automatically based on a moving average determined from the update
        timestamps of an object. It depends on the update timestamps as provided
        by the backend (if available) and SysDB's query interval.
 
-*:backend*::
+*.backend*::
        The name of the backend (plugin) providing the data.
 
 The type of the *last_update*, *age*, and *interval* fields is date-time and
@@ -219,7 +222,7 @@ The following examples illustrate the use of the commands and what their
 replies look like. The replies are pretty-printed to more easily follow them.
 
   LIST hosts;
-  {"hosts":[{
+  [{
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s"
@@ -227,7 +230,7 @@ replies look like. The replies are pretty-printed to more easily follow them.
       "name": "host2.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
       "update_interval": "5m4s"
-    }]}
+    }]
 
   FETCH host 'host1.example.com';
   {
@@ -250,7 +253,7 @@ replies look like. The replies are pretty-printed to more easily follow them.
           ...
         }]}
 
-  LOOKUP hosts MATCHING attribute.architecture = 'amd64';
+  LOOKUP hosts MATCHING attribute[architecture] = 'amd64';
   [{
       "name": "host1.example.com",
       "last_update": "2001-02-03 04:05:06 +0700",
@@ -277,7 +280,7 @@ SEE ALSO
 --------
 manpage:sysdb[1], manpage:sysdb[7]
 
-The SysDB homepage: http://sysdb.io/
+The SysDB homepage: https://sysdb.io/
 
 AUTHOR
 ------