(sg_url: str, auth_headers: dict[str, str])
| 535 | |
| 536 | |
| 537 | def get_db_list(sg_url: str, auth_headers: dict[str, str]) -> list[str]: |
| 538 | # build url to _all_dbs |
| 539 | all_dbs_url = "{0}/_all_dbs".format(sg_url) |
| 540 | data: list[str] = [] |
| 541 | |
| 542 | # get content and parse into json |
| 543 | try: |
| 544 | response = urlopen(all_dbs_url, auth_headers) |
| 545 | data = json.load(response) |
| 546 | except urllib.error.URLError as e: |
| 547 | print(f"WARNING: Unable to connect to Sync Gateway: {sg_url} {e}") |
| 548 | |
| 549 | # return list of dbs |
| 550 | return data |
| 551 | |
| 552 | |
| 553 | # Startup config |
no test coverage detected