Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omada Open API Support #81

Open
charlie-haley opened this issue Sep 24, 2023 Discussed in #80 · 4 comments
Open

Omada Open API Support #81

charlie-haley opened this issue Sep 24, 2023 Discussed in #80 · 4 comments
Labels
enhancement New feature or request

Comments

@charlie-haley
Copy link
Owner

Discussed in #80

Originally posted by codersaur September 22, 2023
I see in v5.12 on the Omada Controller Open API is now supported.

Open API: Omada Controller now supports Open API integration. You can access it through Global view > Settings > Platform Integration, which allows you to utilize the REST API of most Controller services. This feature enables you to develop custom applications, embed APIs, or combine your own applications.

Is this relevant for omada_exporter, and if so, is there a plan to migrate to using it?

@charlie-haley
Copy link
Owner Author

When migrating to using the official API integration, we should document which versions of the exporter are supported. (e.g exporter v0.11.0 needs controller version v5.12+)

@michelheusschen
Copy link
Contributor

This would be nice to have. I tried making a client with the OpenAPI schema (http://omada/v3/api-docs/All) using openapi-generator and the results are a bit mixed.

It's possible to autogenerate a Go client, but there are some issues:

  1. The OpenAPI schema has invalid syntax
  2. OAuth implementation is non-standard
  3. API calls are limited to 1000 per day, with no obvious way to increase that

For 1 and 2 there are relatively straightforward workarounds, but 3 might be the biggest problem. Making one request every 15 seconds already means 5760 requests per day. Maybe I missed a setting to increase or remove this limit, but otherwise you'd need to create multiple "applications" to bypass the limit. And yes the API call limit is enforced unfortunately:

{"errorCode":-7132,"msg":"Our server is receiving too many requests now. Please try again later."}

@charlie-haley
Copy link
Owner Author

There's some talk around the limits here https://community.tp-link.com/en/business/forum/topic/623376?replyId=1256526

this limitation will be removed in Controller 5.13, I wonder if this means the API calls/day limit will be lifted?

@charlie-haley
Copy link
Owner Author

So, I also attempted to generate from the Open API schema and a lot of the spec was wrong/invalid. I pulled the JSON down and fixed all the errors, it still doesn't solve the API request limit but it at least generates a Go package

openapi.json

@charlie-haley charlie-haley added the enhancement New feature or request label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants