diff --git a/database/database.go b/database/database.go index 461a1e8781077777397b07800cb0c23e4c988aa8..cdc2da22c8d84c33831485a62599d5c3070fabf9 100644 --- a/database/database.go +++ b/database/database.go @@ -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) diff --git a/restconf/client/ciena/client.go b/restconf/client/ciena/client.go index 1dea665482c081e965e2a28350e96a5340442666..cb514e37a39720734a94f29763a54eda9b821e2f 100644 --- a/restconf/client/ciena/client.go +++ b/restconf/client/ciena/client.go @@ -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 }