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

  1. Run janusgraph server
    1. 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 }'
      • ​docker-compose -f docker-compose-cql-es.yml up
  2. ​Start gemlin​​
    1. Login to the janusgraph server
      • docker exec -it jce-janusgraph bash
    2. Start gremlin
      • bin/gremlin.sh
  3. ​Read
    1. Connect to the graph
      • :remote connect tinkerpop.server conf/remote.yaml
    2. 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')
      • ​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')
  4. Export
    1. 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")​​
  5. View
    1. ​Cytoscape can be used to view the exported graph. It can be downloded from:
    2. Once running, select the below to import the graph:
      • ​File -> Import -> Network From File ​
  • No labels

3 Comments

  1. 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. 

    1. 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

  2. Steps to install Janusgraph Server and Client to access SDC Data in Cassandra running in Kubernetes 


    1. kubectl -n onap run my-janusgraph --rm -i --tty --restart=Never --image=janusgraph/janusgraph:0.3.3 – /bin/sh
    2. This installs janusgraph as a kubernetes pod.
    3. Inside the pod : copy the attached janusgraph-cql.properties into /opt/janusgraph/conf/gremlin-server/
      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
      }
    4. This can be done using sed -i 's/<old properties file>/janusgraph-cql.properties/g gremlin-server.yaml
    5. In /opt/janusgraph/bin, start gremlin-server.sh. This shold start witout error and listen on port 8182.
    6. From another terminal, you can access the same pod again, and from /opt/janugraph/bin , run the gremlin client: ./gremlin.sh
    7. Run these commands:
      :plugin use tinkerpop.server
      :remote connect tinkerpop.server conf/remote.yaml
    8. To get all vertexes: (include :> in all commands)
      :> g.V()
    janusgraph-cql.properties
    # Copyright 2019 JanusGraph Authors
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
     
    # JanusGraph configuration sample: Cassandra over a socket
    #
    # This file connects to a Cassandra daemon running on localhost via
    # Thrift.  Cassandra must already be started before starting JanusGraph
    # with this file.
     
    gremlin.graph=org.janusgraph.core.JanusGraphFactory
     
    # The primary persistence provider used by JanusGraph.  This is required.
    # It should be set one of JanusGraph's built-in shorthand names for its
    # standard storage backends (shorthands: berkeleyje, cassandrathrift,
    # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the
    # full package and classname of a custom/third-party StoreManager
    # implementation.
    #
    # Default:    (no default value)
    # Data Type:  String
    # Mutability: LOCAL
    storage.backend=cql
     
    # The hostname or comma-separated list of hostnames of storage backend
    # servers.  This is only applicable to some storage backends, such as
    # cassandra and hbase.
    #
    # Default:    sdc-cs.onap
    # Data Type:  class java.lang.String[]
    # Mutability: LOCAL
    storage.hostname=sdc-cs.onap
     
    # The name of JanusGraph's keyspace.  It will be created if it does not
    # exist.
    #
    # Default:    janusgraph
    # Data Type:  String
    # Mutability: LOCAL
    storage.cql.keyspace=sdctitan
     
    # Whether to enable JanusGraph's database-level cache, which is shared
    # across all transactions. Enabling this option speeds up traversals by
    # holding hot graph elements in memory, but also increases the likelihood
    # of reading stale data.  Disabling it forces each transaction to
    # independently fetch graph elements from storage before reading/writing
    # them.
    #
    # Default:    false
    # Data Type:  Boolean
    # Mutability: MASKABLE
    cache.db-cache = true
     
    # How long, in milliseconds, database-level cache will keep entries after
    # flushing them.  This option is only useful on distributed storage
    # backends that are capable of acknowledging writes without necessarily
    # making them immediately visible.
    #
    # Default:    50
    # Data Type:  Integer
    # Mutability: GLOBAL_OFFLINE
    #
    # Settings with mutability GLOBAL_OFFLINE are centrally managed in
    # JanusGraph's storage backend.  After starting the database for the first
    # time, this file's copy of this setting is ignored.  Use JanusGraph's
    # Management System to read or modify this value after bootstrapping.
    cache.db-cache-clean-wait = 20
     
    # Default expiration time, in milliseconds, for entries in the
    # database-level cache. Entries are evicted when they reach this age even
    # if the cache has room to spare. Set to 0 to disable expiration (cache
    # entries live forever or until memory pressure triggers eviction when set
    # to 0).
    #
    # Default:    10000
    # Data Type:  Long
    # Mutability: GLOBAL_OFFLINE
    #
    # Settings with mutability GLOBAL_OFFLINE are centrally managed in
    # JanusGraph's storage backend.  After starting the database for the first
    # time, this file's copy of this setting is ignored.  Use JanusGraph's
    # Management System to read or modify this value after bootstrapping.
    cache.db-cache-time = 180000
     
    # Size of JanusGraph's database level cache.  Values between 0 and 1 are
    # interpreted as a percentage of VM heap, while larger values are
    # interpreted as an absolute size in bytes.
    #
    # Default:    0.3
    # Data Type:  Double
    # Mutability: MASKABLE
    cache.db-cache-size = 0.5
    storage.username=asdc_user
    storage.password=Aa1234%^!# Copyright 2019 JanusGraph Authors
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
     
    # JanusGraph configuration sample: Cassandra over a socket
    #
    # This file connects to a Cassandra daemon running on localhost via
    # Thrift.  Cassandra must already be started before starting JanusGraph
    # with this file.
     
    gremlin.graph=org.janusgraph.core.JanusGraphFactory
     
    # The primary persistence provider used by JanusGraph.  This is required.
    # It should be set one of JanusGraph's built-in shorthand names for its
    # standard storage backends (shorthands: berkeleyje, cassandrathrift,
    # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the
    # full package and classname of a custom/third-party StoreManager
    # implementation.
    #
    # Default:    (no default value)
    # Data Type:  String
    # Mutability: LOCAL
    storage.backend=cql
     
    # The hostname or comma-separated list of hostnames of storage backend
    # servers.  This is only applicable to some storage backends, such as
    # cassandra and hbase.
    #
    # Default:    sdc-cs.onap
    # Data Type:  class java.lang.String[]
    # Mutability: LOCAL
    storage.hostname=sdc-cs.onap
     
    # The name of JanusGraph's keyspace.  It will be created if it does not
    # exist.
    #
    # Default:    janusgraph
    # Data Type:  String
    # Mutability: LOCAL
    storage.cql.keyspace=sdctitan
     
    # Whether to enable JanusGraph's database-level cache, which is shared
    # across all transactions. Enabling this option speeds up traversals by
    # holding hot graph elements in memory, but also increases the likelihood
    # of reading stale data.  Disabling it forces each transaction to
    # independently fetch graph elements from storage before reading/writing
    # them.
    #
    # Default:    false
    # Data Type:  Boolean
    # Mutability: MASKABLE
    cache.db-cache = true
     
    # How long, in milliseconds, database-level cache will keep entries after
    # flushing them.  This option is only useful on distributed storage
    # backends that are capable of acknowledging writes without necessarily
    # making them immediately visible.
    #
    # Default:    50
    # Data Type:  Integer
    # Mutability: GLOBAL_OFFLINE
    #
    # Settings with mutability GLOBAL_OFFLINE are centrally managed in
    # JanusGraph's storage backend.  After starting the database for the first
    # time, this file's copy of this setting is ignored.  Use JanusGraph's
    # Management System to read or modify this value after bootstrapping.
    cache.db-cache-clean-wait = 20
     
    # Default expiration time, in milliseconds, for entries in the
    # database-level cache. Entries are evicted when they reach this age even
    # if the cache has room to spare. Set to 0 to disable expiration (cache
    # entries live forever or until memory pressure triggers eviction when set
    # to 0).
    #
    # Default:    10000
    # Data Type:  Long
    # Mutability: GLOBAL_OFFLINE
    #
    # Settings with mutability GLOBAL_OFFLINE are centrally managed in
    # JanusGraph's storage backend.  After starting the database for the first
    # time, this file's copy of this setting is ignored.  Use JanusGraph's
    # Management System to read or modify this value after bootstrapping.
    cache.db-cache-time = 180000
     
    # Size of JanusGraph's database level cache.  Values between 0 and 1 are
    # interpreted as a percentage of VM heap, while larger values are
    # interpreted as an absolute size in bytes.
    #
    # Default:    0.3
    # Data Type:  Double
    # Mutability: MASKABLE
    cache.db-cache-size = 0.5
    storage.username=asdc_user
    storage.password=Aa1234%^!