def api_version(ns): response = requests.get(ns.api_url / 'autocert/version') version = 'unknown' if response.status_code == 200: obj = response.json() version = obj['version'] return version
def fetch_api_version(ns): api_version = 'unknown' response = requests.get(ns.api_url / 'autocert/version') if response.status_code == 200: obj = response.json() api_version = obj['version'] return api_version
def fetch_api_config(ns): response = requests.get(ns.api_url / 'autocert/config') if response.status_code == 200: obj = response.json() return obj['config'] raise FetchApiConfigError(response)