Code

FETCH: Add parameter for fetching the main object without children.
[sysdb.git] / src / frontend / query.c
index 9a157fb892d10888e35a74c84d77d5a18e635599..28e1e31c2b006fc7fb947e073456f7c5afa79df3 100644 (file)
@@ -46,8 +46,6 @@
 /*
  * metric fetcher:
  * Implements the callbacks necessary to read a metric object.
- * TODO: FETCH should allow to ignore child elements (attributes); then, we'd
- * only need store_host/store_metric.
  */
 
 typedef struct {
@@ -77,15 +75,8 @@ metric_fetcher_metric(sdb_store_metric_t *metric, sdb_object_t *user_data)
        return 0;
 } /* metric_fetcher_metric */
 
-static int
-metric_fetcher_attr(sdb_store_attribute_t __attribute__((unused)) *attr,
-               sdb_object_t __attribute__((unused)) *user_data)
-{
-       return 0;
-} /* metric_fetcher_attr */
-
 static sdb_store_writer_t metric_fetcher = {
-       metric_fetcher_host, NULL, metric_fetcher_metric, metric_fetcher_attr,
+       metric_fetcher_host, NULL, metric_fetcher_metric, NULL,
 };
 
 /*
@@ -404,7 +395,7 @@ sdb_conn_fetch(sdb_conn_t *conn)
        ast = sdb_ast_fetch_create((int)type,
                        hostname[0] ? strdup(hostname) : NULL,
                        name[0] ? strdup(name) : NULL,
-                       /* filter = */ NULL);
+                       /* full */ 1, /* filter = */ NULL);
        status = exec_cmd(conn, ast);
        sdb_object_deref(SDB_OBJ(ast));
        return status;