The cmdshell module uses the paramiko package to create SSH connections to the servers that are represented by instance objects. The module has functions for running commands, managing files, and opening interactive shell sessions over those connections.
This object has a subset of the variables that are normally in a boto.manage.server.Server object. You can use this FakeServer object to create a boto.manage.SSHClient object if you don’t have a real Server object.
Variables: |
|
---|
Variables: |
|
---|
Check for the specified path, or check a file at the specified path.
Return type: | boolean |
---|---|
Returns: | If the path or the file exist, the function returns True. |
Copy a file from one directory to another.
Check the specified path to determine if it is a directory.
Return type: | boolean |
---|---|
Returns: | Returns True if the path is an existing directory. |
List all of the files and subdirectories at the specified path.
Return type: | list |
---|---|
Returns: | Return a list containing the names of the entries in the directory given by path. |
Copy a file from one directory to another.
Open a subprocess and run a command on the local host.
Return type: | tuple |
---|---|
Returns: | This function returns a tuple that contains an integer status and a string with the combined stdout and stderr output. |
This class creates a paramiko.SSHClient() object that represents a session with an SSH server. You can use the SSHClient object to send commands to the remote host and manipulate files on the remote host.
Variables: |
|
---|
Close an SSH session and any open channels that are tied to it.
Connect to an SSH server and authenticate with it.
Parameters: | num_retries (int) – The maximum number of connection attempts. |
---|
Check the remote host for the specified path, or a file at the specified path. This function returns 1 if the path or the file exist on the remote host, and returns 0 if the path or the file does not exist on the remote host.
Parameters: | path (string) – The path to the directory or file that you want to check. |
---|---|
Return type: | integer |
Returns: | If the path or the file exist, the function returns 1. If the path or the file do not exist on the remote host, the function returns 0. |
Open an SFTP session on the remote host, and copy a file from the remote host to the specified path on the local host.
Parameters: |
---|
Check the specified path on the remote host to determine if it is a directory.
Parameters: | path (string) – The path to the directory that you want to check. |
---|---|
Return type: | integer |
Returns: | If the path is a directory, the function returns 1. If the path is a file or an invalid path, the function returns 0. |
List all of the files and subdirectories at the specified path on the remote host.
Parameters: | path (string) – The base path from which to obtain the list. |
---|---|
Return type: | list |
Returns: | A list of files and subdirectories at the specified path. |
Open an SFTP session to the remote host, and open a file on that host.
Parameters: | |
---|---|
Return type: | paramiko.sftp_file.SFTPFile |
Returns: | A paramiko proxy object for a file on the remote server. |
Open an SFTP session on the SSH server.
Return type: | paramiko.sftp_client.SFTPClient |
---|---|
Returns: | An SFTP client object. |
Open an SFTP session on the remote host, and copy a file from the local host to the specified path on the remote host.
Parameters: |
---|
Run a command on the remote host.
Parameters: | command (string) – The command that you want to send to the remote host. |
---|---|
Return type: | tuple |
Returns: | This function returns a tuple that contains an integer status, the stdout from the command, and the stderr from the command. |
Request a pseudo-terminal from a server, and execute a command on that server.
Parameters: | command (string) – The command that you want to run on the remote host. |
---|---|
Return type: | paramiko.channel.Channel |
Returns: | An open channel object. |
Start an interactive shell session with the remote host.
Create and return an SSHClient object given an instance object.
Parameters: |
|
---|
Connect to the specified server.
Returns: | If the server is local, the function returns a boto.manage.cmdshell.LocalClient object. If the server is remote, the function returns a boto.manage.cmdshell.SSHClient object. |
---|