gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.4k stars 547 forks source link

[Bug]: API Reference Doc -> Nodes #909

Closed kellervater closed 2 years ago

kellervater commented 2 years ago

Contact Details

patrick.poetz@voo.aero

What happened?

It's a really small one: In the docs (https://docs.netmaker.org/api.html#nodes-api) for nodes you claim the identifier to update or get a specific node is the macaddress whereas it actually is the id.

Version

v0.12.0

What OS are you using?

Linux

Relevant log output

No response

Contributing guidelines

kellervater commented 2 years ago

Another (maybe bigger) thing I noticed is, that when I do a PUT call on a node, it "nulls" all non-set fields. So, if I send a payload like { "isstatic": "yes", "publickey": "asdf", "endpoint": "xyz" } to endpoint /api/nodes/k3s_voo/ it overrides all at least IP and Listen Port with null or empties them somehow (like the wg IP). I'd expect them to keep being untouched when not explicitly mentioned in the payload.

But since you explicitly say to use the UI instead of the API I guess that's not of upmost importance :-D I'm currently setting up an Ansible Playbook where I don't want to interfere manually in any way to create a reliable setup. So the API is a possibility to set the isstatic value.

mattkasun commented 2 years ago

If the node update includes isstatic: yes the following fields must be provided (they will not be retained from the previous settings) address: address6: listenport: publickey: endpoint:

kellervater commented 2 years ago

Thanks for clarification. Still, title-giving documentation bug (macaddress instead of id) is still valid I guess :-)

afeiszli commented 2 years ago

@ppoetz please open this in the netmaker docs repo: https://github.com/gravitl/netmaker-docs