Debian Codegraph @

asf_search/health/health.py

raw
1 from typing import Dict
2 import requests
3 import json
4
5 import asf_search.constants
6
7
8 def health(host: str = None) -> Dict:
9 """
10 Checks basic connectivity to and health of the ASF SearchAPI.
11
12 Parameters
13 ----------
14 param host:
15 SearchAPI host, defaults to Production SearchAPI.
16 This option is intended for dev/test purposes.
17
18 Returns
19 -------
20 Current configuration and status of subsystems as a dict
21 """
22
23 if host is None:
24 host = asf_search.INTERNAL.CMR_HOST
25 return json.loads(requests.get(f'https://{host}{asf_search.INTERNAL.CMR_HEALTH_PATH}').text)