Storage¶
Tools for inspecting block devices, directories, files, and file contents.
Remote execution
All tools on this page accept an optional host parameter (string)
to execute the command on a remote machine via SSH instead of locally.
See SSH Configuration for details.
list_block_devices¶
List block devices on the system
Returns:
blockdevices(array of object)name(string)size(string)type(string)mountpoint(string or null)fstype(string or null)model(string or null)children(array of object)
total(integer)
list_directories¶
List directories under a specified path with various sorting options.
Parameters:
path(string, required): Absolute path to the directory to analyzeorder_by("size","name","modified", default:"name"): Sort order - 'size', 'name', or 'modified' (default: 'name')sort("ascending","descending", default:"ascending"): Sort direction - 'ascending' or 'descending' (default: 'ascending')top_n(integer, default: none): Optional limit on number of directories to return (1-1000)
Returns:
nodes(array of object)size(integer)modified(number)name(string)human_size(string)human_modified(string)
total(integer)
list_files¶
List files under a specified path with various sorting options.
Parameters:
path(string, required): Absolute path to the directory to analyzeorder_by("size","name","modified", default:"name"): Sort order - 'size', 'name', or 'modified' (default: 'name')sort("ascending","descending", default:"ascending"): Sort direction - 'ascending' or 'descending' (default: 'ascending')top_n(integer, default: none): Optional limit on number of files to return (1-1000, only used with size ordering)
Returns:
nodes(array of object)size(integer)modified(number)name(string)human_size(string)human_modified(string)
total(integer)
read_file¶
Read the contents of a text file up to a safe size limit.
Parameters:
path(string, required): Absolute path to the file to read