@@ -129,6 +129,7 @@ def __call__( # type: ignore
129129 :type auth: typing.Optional[ssh_auth.SSHAuth]
130130 :param verbose: show additional error/warning messages
131131 :type verbose: bool
132+ :return: SSH client instance
132133 :rtype: SSHClientBase
133134 """
134135 if (host , port ) in cls .__cache :
@@ -218,7 +219,9 @@ def __init__(
218219 ) -> None :
219220 """Context manager for call commands with sudo.
220221
222+ :param ssh: connection instance
221223 :type ssh: SSHClientBase
224+ :param enforce: sudo mode for context manager
222225 :type enforce: typing.Optional[bool]
223226 """
224227 self .__ssh = ssh
@@ -249,7 +252,9 @@ def __init__(
249252 ) -> None :
250253 """Context manager for keepalive management.
251254
255+ :param ssh: connection instance
252256 :type ssh: SSHClientBase
257+ :param enforce: keepalive mode for context manager
253258 :type enforce: bool
254259 :param enforce: Keep connection alive after context manager exit
255260 """
@@ -526,6 +531,7 @@ def keepalive_mode(self) -> bool:
526531 def keepalive_mode (self , mode : bool ) -> None :
527532 """Persistent keepalive mode change for connection object.
528533
534+ :param mode: keepalive mode enable/disable
529535 :type mode: bool
530536 """
531537 self .__keepalive_mode = bool (mode )
@@ -548,6 +554,7 @@ def sudo(
548554
549555 :param enforce: Enforce sudo enabled or disabled. By default: None
550556 :type enforce: typing.Optional[bool]
557+ :return: context manager with selected sudo state inside
551558 :rtype: typing.ContextManager
552559 """
553560 return self .__get_sudo (ssh = self , enforce = enforce )
@@ -560,6 +567,7 @@ def keepalive(
560567
561568 :param enforce: Enforce keepalive enabled or disabled.
562569 :type enforce: bool
570+ :return: context manager with selected keepalive state inside
563571 :rtype: typing.ContextManager
564572
565573 .. Note:: Enter and exit ssh context manager is produced as well.
@@ -592,6 +600,9 @@ def execute_async(
592600 :param log_mask_re: regex lookup rule to mask command for logger.
593601 all MATCHED groups will be replaced by '<*masked*>'
594602 :type log_mask_re: typing.Optional[str]
603+ :param kwargs: additional parameters for call.
604+ :type kwargs: typing.Any
605+ :return: Tuple with control interface and file-like objects for STDIN/STDERR/STDOUT
595606 :rtype: typing.Tuple[
596607 paramiko.Channel,
597608 paramiko.ChannelFile,
@@ -661,15 +672,24 @@ def _exec_command(
661672 ) -> exec_result .ExecResult :
662673 """Get exit status from channel with timeout.
663674
675+ :param command: executed command (for logs)
664676 :type command: str
677+ :param interface: interface to control execution
665678 :type interface: paramiko.channel.Channel
679+ :param stdout: source for STDOUT read
666680 :type stdout: typing.Optional[paramiko.ChannelFile]
681+ :param stderr: source for STDERR read
667682 :type stderr: typing.Optional[paramiko.ChannelFile]
683+ :param timeout: timeout before stop execution with TimeoutError
668684 :type timeout: typing.Union[int, float, None]
685+ :param verbose: produce log.info records for STDOUT/STDERR
669686 :type verbose: bool
670687 :param log_mask_re: regex lookup rule to mask command for logger.
671688 all MATCHED groups will be replaced by '<*masked*>'
672689 :type log_mask_re: typing.Optional[str]
690+ :param kwargs: additional parameters for call.
691+ :type kwargs: typing.Any
692+ :return: Execution result
673693 :rtype: ExecResult
674694 :raises ExecHelperTimeoutError: Timeout exceeded
675695
@@ -776,6 +796,9 @@ def execute_through_host(
776796 :type timeout: typing.Union[int, float, None]
777797 :param get_pty: open PTY on target machine
778798 :type get_pty: bool
799+ :param kwargs: additional parameters for call.
800+ :type kwargs: typing.Any
801+ :return: Execution result
779802 :rtype: ExecResult
780803 :raises ExecHelperTimeoutError: Timeout exceeded
781804
@@ -851,6 +874,8 @@ def execute_together(
851874 :type expected: typing.Optional[typing.Iterable[]]
852875 :param raise_on_err: Raise exception on unexpected return code
853876 :type raise_on_err: bool
877+ :param kwargs: additional parameters for execute_async call.
878+ :type kwargs: typing.Any
854879 :return: dictionary {(hostname, port): result}
855880 :rtype: typing.Dict[typing.Tuple[str, int], exec_result.ExecResult]
856881 :raises ParallelCallProcessError: Unexpected any code at lest on one target
@@ -938,16 +963,21 @@ def get_result(remote: 'SSHClientBase') -> exec_result.ExecResult:
938963 def open (self , path : str , mode : str = 'r' ) -> paramiko .SFTPFile :
939964 """Open file on remote using SFTP session.
940965
966+ :param path: filesystem object path
941967 :type path: str
968+ :param mode: open file mode ('t' is not supported)
942969 :type mode: str
943970 :return: file.open() stream
971+ :rtype: paramiko.SFTPFile
944972 """
945973 return self ._sftp .open (path , mode ) # pragma: no cover
946974
947975 def exists (self , path : str ) -> bool :
948976 """Check for file existence using SFTP session.
949977
978+ :param path: filesystem object path
950979 :type path: str
980+ :return: path is valid (object exists)
951981 :rtype: bool
952982 """
953983 try :
@@ -959,7 +989,9 @@ def exists(self, path: str) -> bool:
959989 def stat (self , path : str ) -> paramiko .sftp_attr .SFTPAttributes :
960990 """Get stat info for path with following symlinks.
961991
992+ :param path: filesystem object path
962993 :type path: str
994+ :return: stat like information for remote path
963995 :rtype: paramiko.sftp_attr.SFTPAttributes
964996 """
965997 return self ._sftp .stat (path ) # pragma: no cover
@@ -983,7 +1015,9 @@ def utime(
9831015 def isfile (self , path : str ) -> bool :
9841016 """Check, that path is file using SFTP session.
9851017
1018+ :param path: remote path to validate
9861019 :type path: str
1020+ :return: path is file
9871021 :rtype: bool
9881022 """
9891023 try :
@@ -995,7 +1029,9 @@ def isfile(self, path: str) -> bool:
9951029 def isdir (self , path : str ) -> bool :
9961030 """Check, that path is directory using SFTP session.
9971031
1032+ :param path: remote path to validate
9981033 :type path: str
1034+ :return: path is directory
9991035 :rtype: bool
10001036 """
10011037 try :
0 commit comments