Skip to content
Snippets Groups Projects
Commit 969155bb authored by Malte Bauch's avatar Malte Bauch
Browse files

added hardcoded PND to database.StoreNodes()

this is for test purpose only and should be changed as soon as possible.
parent a62e29b8
No related branches found
No related tags found
2 merge requests!27Resolve "neo4j",!18Develop
......@@ -83,7 +83,11 @@ func (d Database) RemovePND(id string) {
//StoreNodes stores the given nodes to the database and adds them to a
//principle networt domain (PND). It is required for a node to belong to a PND.
func (d Database) StoreNodes(json, pndID string) {
func (d Database) StoreNodes(json string) {
//TODO: remove this after testing and add own gRPC call for it
testPND := PND{name: "test_PND", description: "very, interesting", southboundInterfaces: []string{"TAPI", "RESTCONF"}}
d.StorePND(&testPND)
query :=
`
WITH apoc.convert.fromJsonMap($stringToAdd)
......@@ -104,7 +108,7 @@ func (d Database) StoreNodes(json, pndID string) {
_, err := d.session.Run(
query, map[string]interface{}{
"stringToAdd": json,
"pnd": pndID,
"pnd": testPND.name,
})
logError("failed storing Nodes into database", err)
......
......@@ -57,10 +57,10 @@ func (c *MCPClient) GetConnections() error {
return err
}
func (c *MCPClient) GetNodes(pndName string) error {
func (c *MCPClient) GetNodes() error {
defer c.buffer.Reset()
_, err := c.client.TapiTopologyCore.GetTapiCoreContextTopologyMcpBaseTopologyNode(nil)
c.database.StoreNodes(c.buffer.String(), pndName)
c.database.StoreNodes(c.buffer.String())
log.Debug(c.buffer.Next(25))
return err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment