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

change API default URL to avoid module argument overload #57736

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
5 participants
@broferek
Copy link

commented Jun 12, 2019

SUMMARY

change API default URL to avoid module argument overload

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@broferek

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

@remyleone the day we will have "api/v2" online, we will have to change all the module/inventory calls. Maybe we could also do something like :
api_version: 'v1'
api_url : 'https://api.online.net/api/' + api_version

This will also give the ability to use different versions if available.

If you think it is a good idea, I can update the PR with this.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/cloud/online/online_server_facts.py:0:0: E324 Argument 'api_url' in argument_spec defines default as ('https://api.online.net/api/v1') but documentation defines default as ('https://api.online.net')
lib/ansible/modules/cloud/online/online_user_facts.py:0:0: E324 Argument 'api_url' in argument_spec defines default as ('https://api.online.net/api/v1') but documentation defines default as ('https://api.online.net')

click here for bot help

@remyleone

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

Most new APIs are developed using https://api.scaleway.com so I don't think a v2 on this endpoint is likely

@broferek

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

But it can still be useful then to remove "api/v1" from the module calls and set this as the default URL so that when the new API comes into production, we can change the default URL to "https://api.scaleway.com" and it doesn't break anything.
Otherwise, we will have some calls like "https://api.scaleway.com/api/v1/server" which might not work, no?

@broferek broferek closed this Jun 14, 2019

@sivel sivel removed the needs_triage label Jun 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.