Skip to content

Instantly share code, notes, and snippets.

@Ara4Sh
Created August 22, 2019 06:43
Show Gist options
  • Select an option

  • Save Ara4Sh/8a9e8fddc0d706ce69f7548cb4e8c10c to your computer and use it in GitHub Desktop.

Select an option

Save Ara4Sh/8a9e8fddc0d706ce69f7548cb4e8c10c to your computer and use it in GitHub Desktop.
_url.py
def _url(self, zone=None):
"""
Private method to generate api urls
:param zone: Zone name if None it will use All zones available in the config
:return: self.api_urls
"""
if zone is None:
for zone_name in app.config['zones']:
self.api_urls.append(urljoin(app.config.ZONES[zone_name],"/api/v1/query"))
else:
self.api_urls.append(urljoin(app.config.ZONES[zone], "/api/v1/query"))
return self.api_urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment