Calamari Web Service

The Calamari Web Service application is the back-end to the Calamari UI. The back end is responsible for importing the Squid Proxy Cache Server's access log files, and running queries against the database to provide information to clients. The application makes use of a restful style for its web service. There are two services categories provided by the back end service namely:

  • Admin Service
    • /Calamari-1.0/resources/admin/importhistory/yyyymmdd/yyyymmdd (start and end date)
    • /Calamari-1.0/resources/admin/importlogfilesstatus (current status of files being imported, if any)
    • /Calamari-1.0/resources/admin/settings/squidlogfolder (current value of the log file folder variable. i.e where the server looks for squid log files)
    • /Calamari-1.0/resources/admin/importlogfiles (start importing available log files)
    • /Calamari-1.0/resources/admin/initdb?dropifexists=false (or true, create the calamari database. dropifexists determines if an existing database should be dropped.)
    • /Calamari-1.0/resources/admin/settings/squidlogfolder?path= (Using the put method with a parameter of path to be search for log files.)
  • Data Service
    • Queries used by the pie chart:
      • /Calamari-1.0/resources/dataservice/topsitesbyhits/yyyymmdd/yyyymmdd/count - get top  {count} sites by number of hits between yyyyymmdd and yyyyymmdd,
      • /Calamari-1.0/resources/dataservice/topsitesbysize/yyyymmdd/yyyymmdd/count - get top  {count} sites by size of data between {yyyyymmdd} and {yyyyymmdd},
      • /Calamari-1.0/resources/dataservice/topusersbysize/yyyymmdd/yyyymmdd/count - get top  {count} user by size of data between {yyyyymmdd} and {yyyyymmdd},
      • /Calamari-1.0/resources/dataservice/topusersbyhits//yyyymmdd/yyyymmdd/count - get top  {count} sites by number of hits between {yyyyymmdd} and {yyyyymmdd},
    • Queries used by the time series chart:
      • /Calamari-1.0/resources/dataservice/domainhitsbyhour/yyyymmdd/yyyymmdd/parameter - get time series  hit data from {yyyymmdd} to {yyyymmdd} for domain {parameter} aggregated by hour
      • /Calamari-1.0/resources/dataservice/userhitsbyhour/yyyymmdd/yyyymmdd/parameter - get time series hit data from {yyyymmdd} to {yyyymmdd} for user {parameter} aggregated by hour
      • /Calamari-1.0/resources/dataservice/domainhitsbyday/yyyymmdd/yyyymmdd/parameter - get time series hit data from {yyyymmdd} to {yyyymmdd} for domain {parameter} aggregated by day
      • /Calamari-1.0/resources/dataservice/userhitsbyday/yyyymmdd/yyyymmdd/parameter - - get time series hit data from {yyyymmdd} to {yyyymmdd} for domain {parameter} aggregated by day
      • /Calamari-1.0/resources/dataservice/domainsizebyhour/yyyymmdd/yyyymmdd/parameter - get time series size data from {yyyymmdd} to {yyyymmdd} for domain {parameter} aggregated by hour
      • /Calamari-1.0/resources/dataservice/usersizebyhour/yyyymmdd/yyyymmdd/parameter - get time series size data from {yyyymmdd} to {yyyymmdd} for user {parameter} aggregated by hour
      • /Calamari-1.0/resources/dataservice/domainsizebyday/yyyymmdd/yyyymmdd/parameter - get time series size data from {yyyymmdd} to {yyyymmdd} for domain {parameter} aggregated by day
      • /Calamari-1.0/resources/dataservice/usersizebyday/yyyymmdd/yyyymmdd/parameter - - get time series size data from {yyyymmdd} to {yyyymmdd} for user {parameter} aggregated by day
    • Queries used by tabular view
      • /Calamari-1.0/resources/dataservice/userdetails/yyyymmdd/yyyymmdd/parameter - Get detail records from {yyyymmdd} to {yyyymmdd} for user {parameter}
      • /Calamari-1.0/resources/dataservice/domaindetails/yyyymmdd/yyyymmdd/parameter - Get detail records from {yyyymmdd} to {yyyymmdd} for domain {parameter}
      • /Calamari-1.0/resources/dataservice/details/yyyymmdd/yyyymmdd/parameter-- Get detail records from {yyyymmdd} to {yyyymmdd} for content type {parameter}
      • /Calamari-1.0/resources/dataservice/details/yyyymmdd/yyyymmdd - Get detail records from {yyyymmdd} to {yyyymmdd} 

  In most cases where a paramter is expected a wild card match will be made on the domain or username. So a call like:  

/Calamari-1.0/resources/dataservice/domainhitsbyhour/20100401/20100430/google Will result in all hits on domains with google in the url such as www.google.co.za, mail.google.com etc.