deploylib

RemoteMachine

class RemoteMachine extends AnyRef

Provides a framework for interacting (running commands, uploading/downloading files, etc) with a generic remote machine.

Attributes
abstract
Self Type
RemoteMachine
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RemoteMachine
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RemoteMachine ()

Type Members

  1. case class FreeStats (total: Int, used: Int, free: Int, shared: Int, buffers: Int, cached: Int) extends Product with Serializable

  2. case class RemoteFile (name: String, owner: String, permissions: String, modDate: String, size: String) extends Product with Serializable

  3. case class RemoteJavaProcess (pid: Int, main: String) extends Product with Serializable

  4. case class RemoteProcess (user: String, pid: Int, cpu: Float, mem: Float, vsz: Int, rss: Int, tty: String, stat: String, start: String, time: String, command: String) extends Product with Serializable

Abstract Value Members

  1. val hostname : String

    The hostname that the ssh connection is established with

    The hostname that the ssh connection is established with

    Attributes
    abstract
  2. val javaCmd : File

    The location of the java command on the remote machine

    The location of the java command on the remote machine

    Attributes
    abstract
  3. val rootDirectory : File

    The default root directory for operations (The user should have read write permissions to this directory)

    The default root directory for operations (The user should have read write permissions to this directory)

    Attributes
    abstract
  4. val username : String

    The username used to authenticate with the remote ssh server

    The username used to authenticate with the remote ssh server

    Attributes
    abstract

Concrete Value Members

  1. def ! (cmd: String): Unit

    Executes a command and throw an error if it doesn't return 0

  2. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  3. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  4. def !? (cmd: String): String

    Execute a command on the remote machine and return stdout as a string.

    Execute a command on the remote machine and return stdout as a string. Throws an exception if the command doesn't exit with status code 0.

  5. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  6. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  7. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  8. def appendFile (file: File, contents: String): Unit

    Append to file on the remote machine with the given contents

    Append to file on the remote machine with the given contents

    file

    - The desired path of the file. If the given path is relative, the file will be created in the rootDirectory

    contents

    - A string to be appended to the file

  9. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  10. var assignedServices : Set[Service]

    The services that are assigned to be deployed to this remote machine.

    The services that are assigned to be deployed to this remote machine.

    Attributes
    protected
  11. def blockTillFileCreated (file: File): Unit

    Block until the specified file is created on the remote machine.

  12. def blockTillPortOpen (port: Int): Unit

    Block until we can make a connection to the given port, checking every 5 seconds.

  13. def catFile (remoteFile: File): String

    Return the contents of the remote file as a string.

  14. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def createFile (file: File, contents: String, mode: String = "644"): Unit

    Create a file on the remote machine with the given contents

    Create a file on the remote machine with the given contents

    file

    - The desired path of the file. If the given path is relative, the file will be created in the rootDirectory

    contents

    - A string with the desired contents of the file

  16. def download (remoteFile: File, localDirectory: File): Unit

    Downloads a file from the remote machine.

  17. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def executeCommand (cmd: String, timeout: Long = 0): ExecuteResponse

    Execute a command sync with a maximum timeout to wait for result and return the result as an ExecuteResponse

  20. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  21. def free : FreeStats

    Returns the result of the command free.

    Returns the result of the command free.

    Parsed as: total used free shared buffers cached Mem: 7864548 4332752 3531796 0 78112 2640248

  22. val freeResponse : Regex

  23. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  24. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  25. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  26. def isPortAvailableToListen (port: Int): Boolean

    Use netstat to check if a port is currently bound to a listening socket on the remote machine.

  27. def jps : Seq[RemoteJavaProcess]

    Return a list of all the java processes running on the remote machine.

  28. val logger : Logger

  29. def ls (dir: File): Seq[RemoteFile]

    Return a list of RemoteFiles found in dir on the remote machine.

  30. def md5 (remoteFile: File): String

    returns an md5 hash of the specified remote file

  31. def mkdir (remoteDir: File): Unit

    create directories on the remote machine.

  32. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  33. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  34. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  35. def prepareCommand (cmd: String): String

    Attributes
    protected
  36. val privateKey : File

    The private key used to authenticate with the remote ssh server

  37. def ps : Seq[RemoteProcess]

    lists the processes running on the remote machine.

    lists the processes running on the remote machine. Expects: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 23708 1952 ? Ss 01:00 0:00 /sbin/init

  38. def stopWatches (): Unit

    Kill all processes currently tailing a file.

  39. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  40. def tail (remoteFile: File, numLines: Int = 20): String

    return the last numLines from the specified file

  41. implicit def toOption [A] (a: A): Option[A]

    Attributes
    protected implicit
  42. def toString (): String

    Definition Classes
    RemoteMachine → AnyRef → Any
  43. def upload (localFile: File, remoteDirectory: File): Unit

    Upload a file to the remote machine.

    Upload a file to the remote machine. Before performing the transfer check the md5hash of the local file and any existing file to ensure we don't waste bandwidth.

  44. def useConnection [ReturnType] (func: (Connection) ⇒ ReturnType, numTries: Int): ReturnType

    Provide an ssh connection to the server.

    Provide an ssh connection to the server. If one is not already available or has been disconnected, create one.

    Attributes
    protected
  45. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  46. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  47. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. def watch (remoteFile: File): Unit

    run tail -F on the specifed file in a seperate thread.

    run tail -F on the specifed file in a seperate thread. all ouput is printed on local stdout.

Deprecated Value Members

  1. def addService (service: Service): Unit

    Annotations
    @deprecated
    Deprecated

    use getService

Inherited from AnyRef

Inherited from Any