diff --git a/sagemcom_api/client.py b/sagemcom_api/client.py index 4c90681..a732f05 100644 --- a/sagemcom_api/client.py +++ b/sagemcom_api/client.py @@ -396,6 +396,25 @@ async def get_port_mappings(self) -> List[PortMapping]: return port_mappings + async def get_logs(self) -> List[str]: + """ + Retrieve system logs. + """ + + actions = { + "id": 0, + "method": "getVendorLogDownloadURI", + "xpath": urllib.parse.quote("Device/DeviceInfo/VendorLogFiles/VendorLogFile[@uid='1']"), + } + + response = await self.__api_request_async([actions], False) + log_path = response["reply"]["actions"][0]["callbacks"][0]["parameters"]["uri"] + + log_uri = f"{self.protocol}://{self.host}{log_path}" + response = await self.session.get(log_uri, timeout=10) + + return await response.text() + async def reboot(self): """Reboot Sagemcom F@st device.""" action = {