forked from microsoft/azure-pipelines-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssh-common.d.ts
54 lines (47 loc) · 1.54 KB
/
ssh-common.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// <reference path="./Q.d.ts"/>
declare module 'ssh-common/ssh-common' {
export class RemoteCommandOptions {
}
export class SshHelper {
/**
* Constructor that takes a configuration object of format
* {
host: hostname,
port: port,
username: username,
privateKey: privateKey,
passphrase: passphrase
}
* @param sshConfig
*/
constructor(sshConfig:any);
/**
* Sets up the SSH connection using the configuration passed to the constructor
*/
setupConnection();
/**
* Close any open SSH client connections
*/
closeConnection();
/**
* Uploads a file to the remote server
* @param sourceFile
* @param dest, folders will be created if they do not exist on remote server
* @returns {Promise<string>}
*/
uploadFile(sourceFile:string, dest:string) : Q.Promise<string>;
/**
* Returns true if the path exists on remote machine, false if it does not exist
* @param path
* @returns {Promise<boolean>}
*/
checkRemotePathExists(path:string) : Q.Promise<boolean>;
/**
* Runs specified command on remote machine, returns error for non-zero exit code
* @param command
* @param options
* @returns {Promise<string>}
*/
runCommandOnRemoteMachine(command:string, options:RemoteCommandOptions) : Q.Promise<string>;
}
}