From d8824d8b8073109eec8642a1c6fe23ed011608c6 Mon Sep 17 00:00:00 2001
From: Martin Stiemerling <mls.ietf@gmail.com>
Date: Tue, 29 Sep 2020 17:59:54 +0200
Subject: [PATCH] first call to some tapi functions.

---
 gosdn-cli/gosdn-cli.go  | 1 +
 nucleus/cli-handling.go | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gosdn-cli/gosdn-cli.go b/gosdn-cli/gosdn-cli.go
index fe81e0ecb..0716fc26b 100644
--- a/gosdn-cli/gosdn-cli.go
+++ b/gosdn-cli/gosdn-cli.go
@@ -43,6 +43,7 @@ var commandList = map[string] commandOptions {
 	"hello": {"hello", "test connection to goSDN controller", goSDNSayHello},
 	"shutdown": {"shutdown", "request goSDN controller to shutdown", goSDNShutdown},
 	"testdb" :  {"testdb", "test all database connections", goSDNTestDB},
+	"tapigetnodes" :  {"testdb", "test all database connections", goSDNTestDB},
 }
 
 /*
diff --git a/nucleus/cli-handling.go b/nucleus/cli-handling.go
index d3422db41..86392b821 100644
--- a/nucleus/cli-handling.go
+++ b/nucleus/cli-handling.go
@@ -9,6 +9,7 @@ package nucleus
 
 import (
 	pb "code.fbi.h-da.de/cocsn/gosdn/cliInterface"
+	"code.fbi.h-da.de/cocsn/gosdn/restconf/client/ciena"
 	"context"
 	"google.golang.org/grpc"
 	"log"
@@ -52,17 +53,18 @@ func getCLIGoing(core *Core) {
 // SBI specific calls, by now TAPI only
 func (s *server) TAPIGetEdge(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
 	log.Printf("Received: %v", in.GetName())
-	s2 := s.core.clients["ciena-mcp"]
-	s2.GetConfig()
+	s.core.clients["ciena-mcp"].(*ciena.MCPClient).GetNodes()
 	return &pb.TAPIReply{Message: "Done"}, nil
 }
 
 func (s *server) TAPIGetEdgeNode(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
 	log.Printf("Received: %v", in.GetName())
+	s.core.clients["ciena-mcp"].(*ciena.MCPClient).GetNodeEdgePoints()
 	return &pb.TAPIReply{Message: "Done"}, nil
 }
 
 func (s *server) TAPIGetLink(ctx context.Context, in *pb.TAPIRequest) (*pb.TAPIReply, error) {
 	log.Printf("Received: %v", in.GetName())
+	s.core.clients["ciena-mcp"].(*ciena.MCPClient).GetConnections()
 	return &pb.TAPIReply{Message: "Done"}, nil
 }
-- 
GitLab