Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sagemcom_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down