C# Class Elastacloud.AzureManagement.ScriptMapper.Linux.LinuxSession

Specifically a linux implementation of the
Inheritance: ISession, ICommandShell, IDisposable
Afficher le fichier Open project: azurecoder/fluent-management Class Usage Examples

Méthodes publiques

Méthode Description
CopyDirectoryLocally ( string remoteDirectory, string localDirectory ) : void

Copies a directory to the local filesystem from the remote server

CopyFileLocally ( string remoteFilePath, string remoteFileName, string localDirectory ) : void

A method to copy the remote file to the local file

CreateSession ( ) : void

Creates a linux ssh session

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ExecuteCommand ( string command ) : string

Executes a command given a string input in the current context of the user

ExecuteShell ( List commands ) : Task

Executes a shell command in the context of a sudo su

ExecuteWithRetries ( string command, int count ) : string

Executes a command with a prescribed number of retries

LinuxSession ( string host, int port, string userName, string userPassword, bool disablePasswordLogin, Stream privateKey = null ) : System

Used to construct a linux session command

LinuxSession ( string host, int port, string userName, string userPassword, bool disablePasswordLogin, string privateKey = null ) : System

Used to construct a linux session command

UploadFile ( string remotePath, string localPath ) : void

uploads a file to the a directory of the server

Method Details

CopyDirectoryLocally() public méthode

Copies a directory to the local filesystem from the remote server
public CopyDirectoryLocally ( string remoteDirectory, string localDirectory ) : void
remoteDirectory string The absolute path of the directory name
localDirectory string The absolute path of the directory name
Résultat void

CopyFileLocally() public méthode

A method to copy the remote file to the local file
public CopyFileLocally ( string remoteFilePath, string remoteFileName, string localDirectory ) : void
remoteFilePath string The remote file on the server
remoteFileName string The name of the remote file
localDirectory string The local directoryto place the file
Résultat void

CreateSession() public méthode

Creates a linux ssh session
public CreateSession ( ) : void
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

ExecuteCommand() public méthode

Executes a command given a string input in the current context of the user
public ExecuteCommand ( string command ) : string
command string
Résultat string

ExecuteShell() public méthode

Executes a shell command in the context of a sudo su
public ExecuteShell ( List commands ) : Task
commands List
Résultat Task

ExecuteWithRetries() public méthode

Executes a command with a prescribed number of retries
public ExecuteWithRetries ( string command, int count ) : string
command string
count int
Résultat string

LinuxSession() public méthode

Used to construct a linux session command
public LinuxSession ( string host, int port, string userName, string userPassword, bool disablePasswordLogin, Stream privateKey = null ) : System
host string
port int
userName string
userPassword string
disablePasswordLogin bool
privateKey Stream
Résultat System

LinuxSession() public méthode

Used to construct a linux session command
public LinuxSession ( string host, int port, string userName, string userPassword, bool disablePasswordLogin, string privateKey = null ) : System
host string
port int
userName string
userPassword string
disablePasswordLogin bool
privateKey string
Résultat System

UploadFile() public méthode

uploads a file to the a directory of the server
public UploadFile ( string remotePath, string localPath ) : void
remotePath string The absolute remote path of the file - it will be overwritten every time
localPath string the local path from which the file be uploaded
Résultat void