Services, resources, tosca type definitions, users etc are all stored by SDC in a janusgraph DB in the sdctitan table in the cassandra DB. The following details how the information stored in the janusgraph can be viewed
- Run janusgraph server
- This docker-compose file can be used to start up a janusgraph server can then be used to read from the DB
- set your ip address in the docker-compose file
- If you are using a local DB use the following command to get your local ip
- ip route get 8.8.8.8 | awk '/src/{ print $7 }'
- If you are using a local DB use the following command to get your local ip
- docker-compose -f docker-compose-cql-es.yml up
- set your ip address in the docker-compose file
- This docker-compose file can be used to start up a janusgraph server can then be used to read from the DB
- Start gemlin
- Login to the janusgraph server
- docker exec -it jce-janusgraph bash
- Start gremlin
- bin/gremlin.sh
- Login to the janusgraph server
- Read
- Connect to the graph
- :remote connect tinkerpop.server conf/remote.yaml
- Use gremlin query commands to execute queries to the DB, for example (note the ":>" is part of the command):
- :> g.V() - list all vertices
- :> g.V().has('name', 'myService') - list vertices with name 'myService'
- :> g.V().has('name', 'myService').valueMap() - show details of vertices with name 'myService'
- :> g.V().has('name', 'myService').properties() - properties of vertices with name 'myService'
- :> g.V().has('name', 'myService').properties('metadata').value() - value of the property "metadata" of vertices with name 'myService'
- :> g.V().has('nodeLabel', 'dataType') - data type vertices
- :> g.V().has('nodeLabel', 'dataType').count() - total of data type vertices
- :> g.V().has('name', 'ericsson.datatypes.nfv.InstantiateVnfOperationAdditionalParameters').properties()
- node types (VFCs)
- All node types
- :> g.V().has('nodeLabel', 'node_type')
- All nodes that derives from tosca.nodes.Root
- :> g.V().has('nodeLabel', 'node_type').has('toscaResourceName', 'tosca.nodes.Root').in('DERIVED_FROM')
- All node types
- model
- Model with given name
- :> g.V().has('name', 'ETSI SOL001 v2.5.1')
- Model with given id
- :> g.V().has('uid', 'model.ETSI SOL001 v2.5.1')
- All models
- :> g.V().has('nodeLabel', 'model')
- All Service Templates (Service, VF, PNF, etc.) that is associated to the model
- :> g.V().has('uid', 'model.ETSI SOL001 v2.5.1').out('MODEL_ELEMENT').has('nodeLabel', 'topology_template')
- Model with given name
- Connect to the graph
- Export
- The entire graph can be exported for viewing with a compatible tool by using the following gremlin command which exports to a file with the given name
- :> graph.io(graphml()).writeGraph("export.xml")
- The entire graph can be exported for viewing with a compatible tool by using the following gremlin command which exports to a file with the given name
- View
- Cytoscape can be used to view the exported graph. It can be downloded from:
- Once running, select the below to import the graph:
- File -> Import -> Network From File
3 Comments
Mohd Usman Khan
Hi Michael Morris,
We are analysing SDC component and trying to perform few queries from "Janusgraph Database" for that, We have followed the instructions those you have mentioned in this page but while we are trying to connect graph remotely using mentioned command ":remote connect tinkerpop.server conf/remote.yaml" , We are getting this error "ERROR org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager - Could not create GremlinScriptEngine for gremlin-groovy" and after that while trying to run gremlin query's command ":> g.V()" for fetching list of all vertices then We are getting this error "gremlin-groovy is not an available GremlinScriptEngine".
Could you please help us, As we are stuck due to this error.
Michael Morris
Hi Mohd Usman Khan
I have never seen that error when trying to connect to the janusgraph so not sure what the problem could be. Perhaps the janusgraph community might be able to support: https://github.com/JanusGraph/janusgraph/issues
Note the above instructions are based on running SDC locally on docker. If you are running SDC on OOM (or any other kubernetes deployment) then there may be other steps needed to provid connectivity to the JanusGraph DB
Sangeeta Bellara
Steps to install Janusgraph Server and Client to access SDC Data in Cassandra running in Kubernetes
Modify the file: /opt/janusgraph/conf/gremlin-server/gremlin-server.yaml to use the correct properties file:
graphs: {
graph: conf/gremlin-server/janusgraph-cql.properties
}
:plugin use tinkerpop.server
:remote connect tinkerpop.server conf/remote.yaml
:> g.V()