sftp facts¶
- class reemote.facts.sftp.islink.Islink(path=None)[source]¶
Bases:
objectA class to encapsulate the functionality of checking if a path refers to a symbolic link using SFTP islink in Unix-like operating systems.
- path¶
The remote path to check (can be PurePath, str, or bytes).
Examples:
yield Islink(path="/path/to/symlink")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The boolean result for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The path must be a valid remote path accessible via SFTP.
- class reemote.facts.sftp.get_lstat.Get_lstat(path: str)[source]¶
Bases:
objectA class to encapsulate the functionality of lstat for getting builtin attributes using SFTP lstat in Unix-like operating systems. Unlike stat, lstat returns attributes of symlinks themselves rather than their targets.
- file_path¶
The path of the builtin to get attributes for.
- Type:
str
Examples:
yield Get_lstat(file_path="/path/to/symlink.txt")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The builtin attributes for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. Unlike stat, lstat returns attributes of symlinks themselves rather than the builtin they point to.
- class reemote.facts.sftp.get_cwd.Get_cwd[source]¶
Bases:
objectA class to encapsulate the functionality of cwd (get current working directory) in Unix-like operating systems.
Examples:
yield Getcwd()
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The current working directory for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context.
- class reemote.facts.sftp.get_statvfs.Get_statvfs(path: str = None)[source]¶
Bases:
objectA class to encapsulate the functionality of getting filesystem statistics using SFTP statvfs (stat on a filesystem path) in Unix-like operating systems.
- path¶
The filesystem path to get statistics for.
- Type:
str
Examples: .. code:: python
yield Get_statvfs(path=”/home/user”)
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The filesystem statistics for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The path must be a valid filesystem path accessible via SFTP.
- class reemote.facts.sftp.get_stat.Get_stat(path: str)[source]¶
Bases:
objectA class to encapsulate the functionality of stat for getting builtin attributes using SFTP stat in Unix-like operating systems.
- file_path¶
The path of the builtin to get attributes for.
- Type:
str
Examples:
yield Get_stat(file_path="/path/to/builtin.txt")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The builtin attributes for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context.
- class reemote.facts.sftp.exists.Exists(path: str = None)[source]¶
Bases:
objectA class to encapsulate the functionality of checking if a remote path exists using SFTP exists method in Unix-like operating systems.
- path¶
The remote path to check for existence.
- Type:
str
Examples:
yield Exists(path="/path/to/check")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The existence check result for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The path must be a valid remote path accessible via SFTP.
- class reemote.facts.sftp.isfile.Isfile(path=None)[source]¶
Bases:
objectA class to encapsulate the functionality of checking if a path refers to a regular builtin using SFTP isfile in Unix-like operating systems.
- path¶
The remote path to check (can be PurePath, str, or bytes).
Examples:
yield Isfile(path="/path/to/builtin.txt")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The boolean result for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The path must be a valid remote path accessible via SFTP.
- class reemote.facts.sftp.get_fstat.Get_fstat(file_handle=None, flags: int = None)[source]¶
Bases:
objectA class to encapsulate the functionality of getting builtin attributes using SFTP fstat (stat on an open builtin handle) in Unix-like operating systems.
- file_handle¶
The open builtin handle to get attributes for.
- flags¶
Flags indicating attributes of interest (SFTPv4 or later)
- Type:
int
Examples:
yield Get_fstat(file_handle=file_handle)
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The builtin attributes for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The builtin handle must be an open SFTP builtin handle obtained from a previous operation.
- class reemote.facts.sftp.isdir.Isdir(path=None)[source]¶
Bases:
objectA class to encapsulate the functionality of checking if a path refers to a directory using SFTP isdir in Unix-like operating systems.
- path¶
The remote path to check (can be PurePath, str, or bytes).
Examples:
yield Isdir(path="/path/to/directory")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. The boolean result for each host will be returned in the operation result.
Notes
The operation will execute on all hosts in the current execution context. The path must be a valid remote path accessible via SFTP.