Return full public URL to the API endpoint (excluding the API version). :rtype: ``str``
()
| 29 | |
| 30 | |
| 31 | def get_base_public_api_url(): |
| 32 | """ |
| 33 | Return full public URL to the API endpoint (excluding the API version). |
| 34 | |
| 35 | :rtype: ``str`` |
| 36 | """ |
| 37 | # Note: This is here for backward compatibility reasons - if api_url is not set we fall back |
| 38 | # to the old approach (using api listen host and port) |
| 39 | if cfg.CONF.auth.api_url: |
| 40 | api_url = get_url_without_trailing_slash(cfg.CONF.auth.api_url) |
| 41 | else: |
| 42 | LOG.warning('"auth.api_url" configuration option is not configured') |
| 43 | api_url = "http://%s:%s" % (cfg.CONF.api.host, cfg.CONF.api.port) |
| 44 | |
| 45 | return api_url |
| 46 | |
| 47 | |
| 48 | def get_full_public_api_url(api_version=DEFAULT_API_VERSION): |