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

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

Public Methods

Method 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 method

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
return void

CopyFileLocally() public method

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
return void

CreateSession() public method

Creates a linux ssh session
public CreateSession ( ) : void
return void

Dispose() public method

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

ExecuteCommand() public method

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

ExecuteShell() public method

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

ExecuteWithRetries() public method

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

LinuxSession() public method

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
return System

LinuxSession() public method

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
return System

UploadFile() public method

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
return void