diff --git a/controllers/.nodeGrpcController.go.swp b/controllers/.nodeGrpcController.go.swp new file mode 100644 index 00000000..41326d0a Binary files /dev/null and b/controllers/.nodeGrpcController.go.swp differ diff --git a/controllers/nodeGrpcController.go b/controllers/nodeGrpcController.go index 6c6661e0..e4809257 100644 --- a/controllers/nodeGrpcController.go +++ b/controllers/nodeGrpcController.go @@ -157,6 +157,7 @@ func (s *NodeServiceServer) CheckIn(ctx context.Context, req *nodepb.CheckInReq) data := req.GetNode() //postchanges := req.GetPostchanges() // Now we have to convert this into a NodeItem type to convert into BSON + log.Println("checkin data:",data) node := models.Node{ // ID: primitive.NilObjectID, MacAddress: data.GetMacaddress(), @@ -244,7 +245,7 @@ func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNo if err != nil { return nil, status.Errorf( codes.NotFound, - fmt.Sprintf("Could not find node with supplied Mac Address: %v", err), + fmt.Sprintf("Could not update node: %v", err), ) } return &nodepb.UpdateNodeRes{ diff --git a/netclient/functions/checkin.go b/netclient/functions/checkin.go index cae5b741..41044afd 100644 --- a/netclient/functions/checkin.go +++ b/netclient/functions/checkin.go @@ -237,7 +237,7 @@ func CheckIn(cliconf config.ClientConfig) error { fmt.Println("Node has requested to update remote config.") fmt.Println("Posting local config to remote server.") postnode := server.GetNode(network) - + fmt.Println("POSTING NODE: ",postnode.Macaddress,postnode.Saveconfig) req := &nodepb.UpdateNodeReq{ Node: &postnode, } diff --git a/test/nodecreate.sh b/test/nodecreate.sh index 7ab6921c..67f04e76 100755 --- a/test/nodecreate.sh +++ b/test/nodecreate.sh @@ -3,7 +3,7 @@ PUBKEY="DM5qhLAE20PG9BbfBCger+Ac9D2NDOwCtY1rbYDLf34=" IPADDR="69.173.21.202" MACADDRESS="59:2a:9c:d4:e2:49" -ACCESSKEY="q5VHqUmamqsfgnpy" +ACCESSKEY="6Cc1m3x0B0LQhHWF" PASSWORD="ppppppp" generate_post_json () @@ -15,12 +15,12 @@ generate_post_json () "macaddress": "$MACADDRESS", "password": "$PASSWORD", "localaddress": "172.123.123.3", - "accesskey": "HskQMAoHVplC3l7E" + "accesskey": "PieOi5nsjA0RITf0" } EOF } POST_JSON=$(generate_post_json) -curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/nodes/network +curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/nodes/skynet