ping_data_sources
Opens every data source of the project the way a test would, one after the other, and returns one verdict per data source as a list of dicts.
On this page
Signature
cat.ping_data_sources(logging_level: LoggingLevel = None) -> list[dict]
Parameters
| Parameter | Type | Default | Meaning |
|---|---|---|---|
logging_level |
LoggingLevel | None |
cat.LoggingLevel member; used only when this is the first call of the process. See Logging. |
What it does
Tests each data source of the open project, in the order of the project, exactly as ping_data_source tests one — what is proven for each provider, the 30-second statement timeout and the absence of retries are described there. The data sources are tested one after the other, so the call takes as long as the slowest ones add up to.
Returns
A list with one dict per data source, in project order, each with the keys name, provider, success, message and duration_seconds — see ping_data_source. A project without data sources gives an empty list.
Raises
The sign-in and plan check (first call of the process) raises the CatPortalError family listed on the Introduction page. System.Exception: There is no open CAT project. Open a project first. with no open project. A data source that does not answer is not raised — its dict has success set to False.
Examples
cat.open_project("D:/Testing/Aero.cat.yaml")
broken = [r for r in cat.ping_data_sources() if not r["success"]]
for r in broken:
print(r["name"], r["message"])
Related
- Introduction — session model, logging, .NET objects, exceptions, sign-in.
ping_data_source— one data source by name.