Just checked the source code, it seems to create a...
# netmaker
t
Just checked the source code, it seems to create a new extclient object, set its Network and IngressGatewayID parameters, then pass it to logic.CreateExtClient which in turn sees that it has no name & generates one for it
j
Thanks for the PR!
t
It was pretty trivial, but I thought it might help 😀
b
don't think it will work, client-id is not part of the route for createExtClient api endpoint
for this to work, the client id would have to be sent in the body of the request and code added to unmashal
t
But the client-id is already a field in the json data
Even the sample quick-start script is using it that way
b
r.HandleFunc("/api/extclients/{network}/{nodeid}", securityCheck(false, http.HandlerFunc(createExtClient))).Methods("POST") .... .there is no clientid in this route
t
I'm probably missing something - Why is that an issue? Can't we use the clientid from the call's body?
b
yes, you can but you have to unmarhal it into a structure ... param read param from the url
t
Oh, I guess I misunderstood it then
b
take a look at the code for updateExtClient and how the newExtClient is decoded from the body
t
Is json.NewDecoder(input).Decode(C) Sort of like manually setting: C.clientid = input["clientid"] C.description = input["description"] And so on?
I'm fairly new to REST API
b