=pod =head1 NAME qdb-cgi - service http qdb requests =head1 SYNOPSIS Usage: qdb.cgi [-v] [-q] [-d] [-h] [-t [arg] ] option v : be verbose option q : be quiet option d : show debug info option h : show help option t : test ; set $ENV{PATH_INFO} = $arg ; =head1 DESCRIPTION Program B is a cgi script that handles L requests. The following is the help-message of the script. =head2 Intro This service provides access to CPAN's update history. =over 4 =item * CPAN's update history is a list of I. =item * An I is a tuple : C<[> I, I, I C<]> ; where =over 4 =item * I is some meaningless, (auto-increment) unique number, =item * I is either C or C, =item * I is a filesystem path in CPAN. =back =item * The history is updated by adding events. =item * In the history, I<$path> is I ; there can only be one event per I<$path>. When a I<$path>-event is added, it replaces a previous I<$path>-event. =back =head2 Usage To use the service, you must issue a I ; see the next section for an overview. Each request returns a json-text : { "cmd" : ... # the request , "err" : ... # any errors found , "res" : ... # the result } If I<$err> is defined, then =over 4 =item * I<$res> is not defined, and =item * the I is I<400 Bad Request>. =back =head2 Requests =head3 database queries =over 4 =item C The result is the number of events in the history. Example : C> =item C The result is the I of the first event. Example : C> =item C The result is the I of the last (most recent) event. Example : C> =item CI<$n> The result is an I-ordered list of the oldest events with I ; at most 1000 events are returned. Example : C> =item CI<$n>CI<$x> same as C but at most I events are returned. Example : C> =item CI<$x> The result is an I-ordered list of the last I events. Examples : C> ; C> =item CI<$path> The result is a list of (0 or 1) events pertaining to $path. Example : C> =back =head3 filesystem queries =over 4 =item CI<$path> The result is C<[stat "/path/to/cpan/$path"]> Example : C> =item CI<$path> The result is C<[lstat "/path/to/cpan/$path"]> Example : C> =item CI<$path> The result is C Example : C> =item CI<$path> The result is C, C, C, C or C. Example : C> =back =head2 Notes =over 4 =item * Updates of the I files are not represented in the event-stream. Updates of the I files must be reflected in the the qdb-database, so qdb-based I-clients know when to re-sync them. =item * a I server is always a I, although she normally only sleeps for a few minutes. Does a I server has to keep its own history? Or can queries be truthfully answered, given some valid local C>? =back =head1 FILES /etc/qdb/conf : qdb-configuration =head1 SEE ALSO L, L, L =head1 LICENSE You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl 5.10.0 README file. =head1 AUTHOR =for html qdb-cgi © 2015-2017 Henk P. Penning - All rights reserved ; qdb-0.04-p12 - Sat Jan 21 11:22:02 2017 =for man Henk P. Penning, ; qdb-0.04-p12 - Sat Jan 21 11:22:02 2017 =cut