Read Files
Read text content from a file on a node
Signature
def read_files(node_id: str, file_path: str) -> ReadFilesResponseParameters
node_id(str) – target nodefile_path(str) – the path of the file on the target node
Path Handling
All files that were placed using the upload function will be defaulted to the /home/ubuntu/Desktop/MY_FILES directory.
If you specified a destination_path when using the upload function, it would have been adjusted to be prefixed by /home/ubuntu.
For more details on this, visit the Path Handling section of upload guide.
Returns
ReadFilesResponse object with:
status(str) – operation statusmessage(str) – response messagefile_content(str) – content of the filefile_path(str) – path that was read fromnode_id(str) – target node ID
Example
result = client.read_files(
node_id,
file_path="/home/ubuntu/Desktop/MY_FILES/data.txt"
)
print(result.file_content)