paultyng/terraform-provider-unifi

API URL for UDM Pro?

alisonjenkins opened this issue · 7 comments

Hey @paultyng ,

I am currently trying to get started using this provider but have been unable to figure out what the API URL should be set to for the UDM Pro.

I have tried a few iterations of:

UNIFI_API=https://192.168.1.1/
UNIFI_API=https://192.168.1.1/network/default

But had no success receiving errors such as:

panic: client not initialized: (499 unknown) for POST https://192.168.1.1/api/auth/login

Could you give me a hint of what the API URL should be set to? This also might be good to add to the Terraform documentation and the go-sdk docs to save anyone else asking in the future.

Thanks,

Alan Jenkins

I realised that the web interface of the UDM control panel might be using the API so used Inspector's network requests to find out the URL. For UDM the API URL needs to be set to 'https:///proxy'.

I will submit a PR to get this added to the api_url's documentation.

Opened PR #133 for adding an example of what the UDM's API URL should be. Not sure what the URL needs to be for standard UNMS but if you can give me an example I will get that added in too.

Thanks for the PR, I do not have a UDM-Pro just the standard UDM so hard for me to figure this out without a hand!

For the UDM, cloud key, and docker controllers it should be just the root of / and I'd prefer the SDK just detect this appropriately, so I opened an issue over there to track that fix also.

Hey @paultyng, FYI I have reworked the PR to include an example for the other types of controllers.

Also if you want someone to test UDM Pro related changes poke me.

I know we've gone through a few changes related to UnifiOS/UDMP support, but I do not need the /proxy path on my api_url using v 0.26.0 against a UMDP running firmware 1.8.6 and Network 6.0.43.

I don't think this is valid anymore.