netbird
netbird copied to clipboard
API Call to get connected peers?
Is there a way of making a call to get the connected peers? That way i could parse the returned json data (assuming REST) to get a list of the IPs so that I could stick the records into my pihole custom DNS entries dynamically.
Cheers
@itsalljustdata In theory yes, but there are caveats. Web UI calls the Management API to get a list of peers with status: https://app.netbird.io:33071/api/peers
However, it requires a JWT token that is generated on auth. It expires after a while, so you will need to re-authenticate. Probably this won't fit your use case.
P.S. We are working on API separately and will be releasing it compatible with OpenAPI.
Cheers Misha.
I'm probably best hanging on for the API to be released.
Although...
Given that I authenticate with github, would that not make the re-authing process easier to manage?
Cheers Misha.
I'm probably best hanging on for the API to be released.
Although...
Given that I authenticate with github, would that not make the re-authing process easier to manage?
@mlsmaycon what do you think?
Hi @itsalljustdata, we are looking at some alternative to the JWT to serve as authentication, maybe not using your browser session with GitHub, but rather following they concept with personal access tokens(PAT), stay tuned we should have that sorted out by Q4/2022
@itsalljustdata we've release support to PATs and Service Users which allow for API calls using tokens. For more details, check out our API docs: https://docs.netbird.io/api