deploylib.ec2.EC2Region

EC2Instance

class EC2Instance extends RemoteMachine with RunitManager with Sudo with ServiceManager

A specific RemoteMachine used to control a single Instances of this class can be obtained by instanceId from the static method getInstance

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. EC2Instance
  2. ServiceManager
  3. Sudo
  4. RunitManager
  5. RemoteMachine
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EC2Instance (instanceId: String)

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

  5. case class RemoteService (name: String) extends Product with Serializable

Value Members

  1. def ! (cmd: String): Unit

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

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

    Definition Classes
    RemoteMachine
  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.

    Definition Classes
    RemoteMachine
  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

    Definition Classes
    RemoteMachine
  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
    Definition Classes
    RemoteMachine
  11. def availabilityZone : String

  12. def blockTillFileCreated (file: File): Unit

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

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

    Definition Classes
    RemoteMachine
  13. def blockTillPortOpen (port: Int): Unit

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

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

    Definition Classes
    RemoteMachine
  14. def blockUntilRunning (): Unit

    Blocks the current thread until this instance is up and accepting ssh connections.

  15. def bundleNewAMI (bucketName: String): String

    Creates a new AMI based on this image using ec2-bundle-vol and ec2-upload-bundle.

  16. def cacheFiles (localFiles: Seq[File]): Seq[File]

    Caches this file on the instance (keyed by the hash of the file contents)

  17. def catFile (remoteFile: File): String

    Return the contents of the remote file as a string.

    Return the contents of the remote file as a string.

    Definition Classes
    RemoteMachine
  18. def clearAll : Unit

    Definition Classes
    RunitManager
  19. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. 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

    Definition Classes
    RemoteMachine
  21. def currentState : Instance

  22. def disableMonitoring (): Unit

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

    Downloads a file from the remote machine.

    Downloads a file from the remote machine.

    Definition Classes
    RemoteMachine
  24. def enableMonitoring (): Unit

  25. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  26. def equals (other: Any): Boolean

    Definition Classes
    EC2Instance → AnyRef → Any
  27. 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

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

    Definition Classes
    RemoteMachine
  28. val fileCache : File

  29. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. def fixHostname : Unit

  31. 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

    Definition Classes
    RemoteMachine
  32. val freeResponse : Regex

    Definition Classes
    RemoteMachine
  33. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  34. def getHostname (): String

  35. def getService (name: String, cmd: String): RemoteService

    Definition Classes
    ServiceManager
  36. def halt : Unit

  37. def hashCode (): Int

    Definition Classes
    EC2Instance → AnyRef → Any
  38. lazy val hostname : String

    Definition Classes
    EC2InstanceRemoteMachine
  39. def imageId : String

  40. val instanceId : String

  41. def instanceState : String

  42. def instanceType : String

  43. def isInstanceOf [T0] : Boolean

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

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

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

    Definition Classes
    RemoteMachine
  45. val javaCmd : File

    The location of the java command on the remote machine

    The location of the java command on the remote machine

    Definition Classes
    EC2InstanceRemoteMachine
  46. def jps : Seq[RemoteJavaProcess]

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

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

    Definition Classes
    RemoteMachine
  47. def keyName : String

  48. val logDir : File

    Definition Classes
    ServiceManager
  49. val logger : Logger

    Definition Classes
    RemoteMachine
  50. def ls (dir: File): Seq[RemoteFile]

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

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

    Definition Classes
    RemoteMachine
  51. def md5 (remoteFile: File): String

    returns an md5 hash of the specified remote file

    returns an md5 hash of the specified remote file

    Definition Classes
    RemoteMachine
  52. def mkdir (remoteDir: File): Unit

    create directories on the remote machine.

    create directories on the remote machine.

    Definition Classes
    RemoteMachine
  53. def ne (arg0: AnyRef): Boolean

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

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

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

    Attributes
    protected
    Definition Classes
    SudoRemoteMachine
  57. def privateDnsName : String

  58. val privateKey : File

    The private key used to authenticate with the remote ssh server

    The private key used to authenticate with the remote ssh server

    Definition Classes
    EC2InstanceRemoteMachine
  59. 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

    Definition Classes
    RemoteMachine
  60. def publicDnsName : String

  61. def pushJars (jars: Seq[File]): Seq[File]

    Upload all of the jars in the file .

    Upload all of the jars in the file ./allJars and create jrun/console scripts for working with them Note, this is mostly a hack to work around problems with mesos on EC2. TODO: Integrate w/ sbt

  62. 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)

    Definition Classes
    EC2InstanceRemoteMachine
  63. val runitBinaryPath : File

    Definition Classes
    EC2InstanceRunitManager
  64. lazy val runsvdirCmd : File

    Definition Classes
    RunitManager
  65. val serviceDir : File

    Definition Classes
    ServiceManager
  66. lazy val serviceRoot : File

    Definition Classes
    RunitManager
  67. def services : List[RunitService]

    Definition Classes
    RunitManager
  68. def setup (): Unit

    Runs pre-experiment setup like recording instance details in the database and making needed directories

  69. def stopWatches (): Unit

    Kill all processes currently tailing a file.

    Kill all processes currently tailing a file.

    Definition Classes
    RemoteMachine
  70. lazy val svCmd : File

    Definition Classes
    RunitManager
  71. lazy val svlogdCmd : File

    Definition Classes
    RunitManager
  72. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  73. object tags extends SeqForwarder[TagDescription]

  74. def tail (remoteFile: File, numLines: Int = 20): String

    return the last numLines from the specified file

    return the last numLines from the specified file

    Definition Classes
    RemoteMachine
  75. implicit def toOption [A] (a: A): Option[A]

    Attributes
    protected implicit
    Definition Classes
    RemoteMachine
  76. def toString (): String

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

    Custom upload method that copies a file once to S3 and then from there to any number of EC2Instances.

    Custom upload method that copies a file once to S3 and then from there to any number of EC2Instances.

    Definition Classes
    EC2InstanceRemoteMachine
  78. 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
    Definition Classes
    RemoteMachine
  79. val username : String

    The username used to authenticate with the remote ssh server

    The username used to authenticate with the remote ssh server

    Definition Classes
    EC2InstanceRemoteMachine
  80. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  83. 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.

    Definition Classes
    RemoteMachine

Deprecated Value Members

  1. def addService (service: Service): Unit

    Definition Classes
    RemoteMachine
    Annotations
    @deprecated
    Deprecated

    use getService

Inherited from ServiceManager

Inherited from Sudo

Inherited from RunitManager

Inherited from RemoteMachine

Inherited from AnyRef

Inherited from Any