Hi,
a couple of folks asked how we inspect what is stored inside inventory's live
DB.
The truth is that mostly it is the REST API ;) but sometimes, it is true that
one needs to really look at individual vertices and edges in the graph
storage.
To see that, Jirka spent some time on a low level inventory visualization but
I am not sure that has come to conclusion. In the meantime, this is how I do
it.
I suppose you're running hawkular dist in dev mode, C* backing the metrics and
inventory running on localhost, default ports.
0) Build Hawkular with dev profile and start it up.
1) Install Titan 0.5.4 separately [1].
2) Unzip and cd into it.
3) run "bin/gremlin.sh"
4) Run the following in the gremlin CLI:
g = TitanFactory.build().set("storage.backend",
"cassandrathrift").set("storage.cassandra.keyspace",
"hawkular_inventory").open()
That will open the inventory graph in the variable "g".
You now have the full power of Groovy and Gremlin [2] at your fingertips.
To get you started, here are a few queries you can run:
1) list all properties of all tenants
g.V().has("__type", "tenant").map
`V()` will give you all vertices in the graph,
`.has()` will filter them on a value of some property
`.map` will output the properties of each vertex as a map
2) List all outgoing edges from all environments
g.V().has("__type",
"tenant").out("contains").has("__type",
"environment").outE()
`.out(...)` will hop from a vertex over all edges with given label to all
target vertices (if no label is given (call without arguments), target
vertices of all outgoing edges are listed)
`.outE(...)` will list the outgoing edges (constrained to given labels, if
any)
(if you want to see the properties of those edges, add ".map" to the end).
3) List all Wildfly servers under a feed:
g.V().has("__cp",
"/t;<tenantId>/e;test/f;<feedId>").outE("contains").has("__targetType",
"resource").inV().as("resource").inE("defines").has("__sourceType",
"resourceType").outV().has("__eid", "WildFly
Server").back("resource")
4) To see the root map of the resource config of the those resources, add the
following to the above query:
.out("contains").has("__type",
"dataEntity").has("__eid",
"configuration").out("hasData")
5) To see the values inside that map, additionally add the following:
.out.map
Hope this helps,
Lukas
[1]
http://s3.thinkaurelius.com/downloads/titan/titan-0.5.4-hadoop2.zip
[2]
http://s3.thinkaurelius.com/docs/titan/0.5.4/gremlin.html