index 760c23d9fa89f7151b0e33267ebcaff0e37936c1..a7d86f529df54f56c4f9328ac6068731f52a28fa 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
enum {
SDB_HOST = 1,
SDB_SERVICE,
+ SDB_METRIC,
SDB_ATTRIBUTE,
};
#define SDB_STORE_TYPE_TO_NAME(t) \
(((t) == SDB_HOST) ? "host" \
: ((t) == SDB_SERVICE) ? "service" \
+ : ((t) == SDB_METRIC) ? "metric" \
: ((t) == SDB_ATTRIBUTE) ? "attribute" : "unknown")
/*
sdb_store_matcher_t *
sdb_store_gt_matcher(sdb_store_cond_t *cond);
+/*
+ * sdb_store_parse_field_name:
+ * Parse the name of a stored object's queryable field.
+ *
+ * Returns:
+ * - the field id on success
+ * - a negative value else
+ */
+int
+sdb_store_parse_field_name(const char *name);
+
/*
* sdb_store_matcher_parse_cmp:
* Parse a simple compare expression (<obj_type>.<attr> <op> <expression>).
* of the matcher. Only those objects matching the filter will be considered.
*
* Note that the filter is applied to all object types (hosts, service,
- * attribute). Thus, any object-specific matchers are mostly unsuited for this
- * purpose and, if used, may result in unexpected behavior.
+ * metric, attribute). Thus, any object-specific matchers are mostly unsuited
+ * for this purpose and, if used, may result in unexpected behavior.
*
* Returns:
* - 1 if the object matches
enum {
SDB_SKIP_ATTRIBUTES = 1 << 0,
SDB_SKIP_SERVICES = 1 << 1,
- SDB_SKIP_SERVICE_ATTRIBUTES = 1 << 2,
+ SDB_SKIP_METRICS = 1 << 2,
+ SDB_SKIP_SERVICE_ATTRIBUTES = 1 << 3,
SDB_SKIP_ALL = 0xffff,
};