F #2183: Use pager for list commands (e.g. onevm list). Support for

custom ordering (by ID) in list API calls, this can be set per user,
group and default in oned.conf
This commit is contained in:
Ruben S. Montero committed 2018-08-06 14:16:00 +02:00
1 parent 914368d300
commit 21fe311681
28 files changed
+418 -132

No files matched your search

+6 -1
View File
@@ -214,7 +214,7 @@ PoolObjectSQL * PoolSQL::get(const string& name, int ouid)
/* -------------------------------------------------------------------------- */
int PoolSQL::dump(ostringstream& oss, const string& elem_name, const char* table,
const string& where, const string& limit)
const string& where, const string& limit, bool desc)
{
ostringstream cmd;
@@ -227,6 +227,11 @@ int PoolSQL::dump(ostringstream& oss, const string& elem_name, const char* table
cmd << " ORDER BY oid";
if ( desc == true )
{
cmd << " DESC";
}
if ( !limit.empty() )
{
cmd << " LIMIT " << limit;