C# Класс Elastacloud.AzureManagement.ScriptMapper.Linux.LinuxSession

Specifically a linux implementation of the
Наследование: ISession, ICommandShell, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

CopyDirectoryLocally() публичный Метод

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
Результат void

CopyFileLocally() публичный Метод

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
Результат void

CreateSession() публичный Метод

Creates a linux ssh session
public CreateSession ( ) : void
Результат void

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

ExecuteCommand() публичный Метод

Executes a command given a string input in the current context of the user
public ExecuteCommand ( string command ) : string
command string
Результат string

ExecuteShell() публичный Метод

Executes a shell command in the context of a sudo su
public ExecuteShell ( List commands ) : Task
commands List
Результат Task

ExecuteWithRetries() публичный Метод

Executes a command with a prescribed number of retries
public ExecuteWithRetries ( string command, int count ) : string
command string
count int
Результат string

LinuxSession() публичный Метод

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
Результат System

LinuxSession() публичный Метод

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
Результат System

UploadFile() публичный Метод

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
Результат void