Overview¶
Bases: SkahaClient
Overview of the Skaha Server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
SkahaClient
|
Object
|
Skaha Client. |
required |
availability ¶
Check if the server backend is available.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the server is available, False otherwise. |
Source code in skaha/overview.py
Python
def availability(self) -> bool:
"""Check if the server backend is available.
Returns:
bool: True if the server is available, False otherwise.
"""
response: Response = self.session.get(url=self.server) # type: ignore # noqa
response.raise_for_status()
# Parse the XML string
root = ET.fromstring(response.text)
available = root.find(
".//{http://www.ivoa.net/xml/VOSIAvailability/v1.0}available"
).text # type: ignore
log.info("Server available: %s", available)
if available == "true":
return True
return False