Documentation ¶
Index ¶
- Constants
- type Credentials
- type Windows
- func (w *Windows) ConfigureOpenSSHServer() error
- func (w *Windows) CopyFile(filePath, remoteDir string) error
- func (w *Windows) GetCredentials() *Credentials
- func (w *Windows) GetSSHClient() error
- func (w *Windows) Reinitialize() error
- func (w *Windows) Run(cmd string, psCmd bool) (string, string, error)
- func (w *Windows) RunOverSSH(cmd string, psCmd bool) (string, error)
- func (w *Windows) SetupWinRMClient() error
- type WindowsVM
Constants ¶
const ( // ContainerLogsPort number will be opened on the windows node via firewall ContainerLogsPort = "10250" // FirewallRuleName is the firewall rule name to open the Container Logs Port FirewallRuleName = "ContainerLogsPort" // SshPort is the SSH port SshPort = 22 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials holds the information to access the Windows instance created.
func NewCredentials ¶
func NewCredentials(instanceID, ipAddress, password, user string) *Credentials
NewCredentials takes the instanceID, ip address, password and user of the Windows instance created and returns the Credentials structure
func (*Credentials) GetIPAddress ¶
func (cred *Credentials) GetIPAddress() string
GetIPAddress returns the ip address of the given node
func (*Credentials) GetInstanceId ¶
func (cred *Credentials) GetInstanceId() string
GetInstanceID returns the instanceId associated with the given node
func (*Credentials) GetPassword ¶
func (cred *Credentials) GetPassword() string
GetPassword returns the password associated with the given node
func (*Credentials) GetUserName ¶
func (cred *Credentials) GetUserName() string
GetUserName returns the user name associated with the given node
type Windows ¶
type Windows struct { // Credentials to access the Windows VM created Credentials *Credentials // SSHClient contains the ssh client information to access the Windows VM via ssh SSHClient *ssh.Client // WinrmClient to access the Windows VM created WinrmClient *winrm.Client }
Windows represents a Windows host. TODO: Add a struct called Connectivity which has information related to Winrm, SSH and have
getters and setters for it so that it can be exposed as a public method jira: https://issues.redhat.com/browse/WINC-239. Remove the fields related to SSHClient and WinrmClient and put them in connectivity struct
func (*Windows) ConfigureOpenSSHServer ¶
ConfigureOpenSSHServer configures the OpenSSH server using WinRM client installed on the Windows VM. The OpenSSH server is installed as part of WNI tool's CreateVM method.
func (*Windows) GetCredentials ¶
func (w *Windows) GetCredentials() *Credentials
func (*Windows) GetSSHClient ¶
GetSSHClient gets the ssh client associated with Windows VM created
func (*Windows) Reinitialize ¶
func (*Windows) SetupWinRMClient ¶
SetupWinRMClient sets up the winrm client to be used while accessing Windows node
type WindowsVM ¶
type WindowsVM interface { // CopyFile copies the given file to the remote directory in the Windows VM. The remote directory is created if it // does not exist CopyFile(string, string) error // Run executes the given command remotely on the Windows VM and returns the output of stdout and stderr. If the // bool is set, it implies that the cmd is to be execute in PowerShell. Run(string, bool) (string, string, error) // Run executes the given command remotely on the Windows VM over a ssh connection and returns the combined output // of stdout and stderr. If the bool is set, it implies that the cmd is to be execute in PowerShell. This function // should be used in scenarios where you want to execute a command that runs in the background. In these cases we // have observed that Run() returns before the command completes and as a result killing the process. RunOverSSH(string, bool) (string, error) // GetCredentials returns the interface for accessing the VM credentials. It is up to the caller to check if non-nil // Credentials are returned before usage. GetCredentials() *Credentials // Reinitialize re-initializes the Windows VM. Presently only the ssh client is reinitialized. Reinitialize() error }
WindowsVM is the interface for interacting with a Windows object created by the cloud provider