mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-10 23:24:32 +08:00
making sure all changes are in
This commit is contained in:
parent
f1cac641dc
commit
eec7a8f61a
4 changed files with 6 additions and 5 deletions
BIN
controllers/.nodeGrpcController.go.swp
Normal file
BIN
controllers/.nodeGrpcController.go.swp
Normal file
Binary file not shown.
|
@ -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{
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue