X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fcore%2Fplugin.c;h=ca04ae21efc8745efc62553cda354060ca54390d;hp=3fb0a77348bb098b414f9724fb9281598ae41463;hb=b2d31bc42a7694c671186081ee0cac077a188b99;hpb=01cf7d5f4392df0933e56a54b1ff607d2dd2ed13 diff --git a/src/core/plugin.c b/src/core/plugin.c index 3fb0a77..ca04ae2 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -1555,6 +1555,31 @@ sdb_plugin_fetch_timeseries(const char *type, const char *id, return ts; } /* sdb_plugin_fetch_timeseries */ +sdb_timeseries_info_t * +sdb_plugin_describe_timeseries(const char *type, const char *id) +{ + ts_fetcher_t *fetcher; + sdb_timeseries_info_t *ts_info; + + ctx_t *old_ctx; + + if ((! type) || (! id)) + return NULL; + + fetcher = TS_FETCHER(sdb_llist_search_by_name(timeseries_fetcher_list, type)); + if (! fetcher) { + sdb_log(SDB_LOG_ERR, "core: Cannot describe time-series of type %s: " + "no such plugin loaded", type); + errno = ENOENT; + return NULL; + } + + old_ctx = ctx_set(fetcher->ts_ctx); + ts_info = fetcher->impl.describe(id, fetcher->ts_user_data); + ctx_set(old_ctx); + return ts_info; +} /* sdb_plugin_describe_timeseries */ + int sdb_plugin_query(sdb_ast_node_t *ast, sdb_store_writer_t *w, sdb_object_t *wd, sdb_strbuf_t *errbuf)