bareos: bareos-17.2 3ea179f4

Author Committer Branch Timestamp Parent
frank frank bareos-17.2 2017-09-18 14:54 bareos-17.2 751787aa Pending
Changeset Filter Framework and list command adjustments

This commit adjusts some parts of the filter-framework and the the (l)list
command in various contexts to have a solid base for a proper paging for
applications like webui using the JSON API. Also this commit introduces
a new counter variable, so we know how many rows have been filtered from our
original SQL result due to ACL settings.

- Adds count, limit and offset as additional and optional command arguments to
the (l)list command on our volume context.

- Adds count, limit and offset as additional and optional command arguments to
the (l)list command on our joblog context.

- In API 2 mode filtered, limit and offset are now attached as an key-value
pair object to the result object as a child, for additional information.

- A new query include file is introduced to count volumes/media

Example usage:
--------------

list volumes all count

list volumes pool=Incremental limit=10 offset=0

Example output:
---------------

{
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "volumes": [
      {
        "mediaid": "2",
        "volumename": "Incremental-0002",
        "volstatus": "Append",
        "enabled": "1",
        "volbytes": "182336976",
        "volfiles": "0",
        "volretention": "604800",
        "recycle": "1",
        "slot": "0",
        "inchanger": "0",
        "mediatype": "File",
        "lastwritten": "2017-09-08 21:00:01",
        "storage": "File"
      },
      {
        "mediaid": "45",
        "volumename": "Incremental-0045",
        "volstatus": "Append",
        "enabled": "1",
        "volbytes": "222479",
        "volfiles": "0",
        "volretention": "604800",
        "recycle": "1",
        "slot": "0",
        "inchanger": "0",
        "mediatype": "File",
        "lastwritten": "2017-09-15 21:00:04",
        "storage": "File"
      }
    ]
    "meta": {
      "range": {
        "limit": 10,
        "filtered": 0,
        "offset": 0
      }
    }
  }
}
mod - src/cats/bdb_query_enum_class.h Diff File
mod - src/cats/bdb_query_names.inc Diff File
mod - src/cats/cats.h Diff File
add - src/cats/dml/0067_list_volumes_count_0 Diff File
add - src/cats/dml/0068_list_volumes_by_name_count_1 Diff File
add - src/cats/dml/0069_list_volumes_by_poolid_count_1 Diff File
add - src/cats/dml/0070_list_joblog_2 Diff File
add - src/cats/dml/0071_list_joblog_count_1 Diff File
mod - src/cats/mysql_queries.inc Diff File
mod - src/cats/postgresql_queries.inc Diff File
mod - src/cats/sql_list.c Diff File
mod - src/cats/sqlite_queries.inc Diff File
mod - src/dird/ua_cmds.c Diff File
mod - src/dird/ua_output.c Diff File
mod - src/dird/ua_select.c Diff File
mod - src/lib/output_formatter.c Diff File
mod - src/lib/output_formatter.h Diff File