AEC2
- java.lang.Object
-
- com.dashoptimization.AEC2
-
public class AEC2 extends java.lang.Object
-
-
Field Summary
Modifier and Type Field and Description java.lang.String
connectionMode
Default connection mode (xprmsrv or ssh).java.lang.String
image
The AMI Id used when starting a new instance.java.lang.String
instanceType
The instance type used when starting a new instance.java.lang.String
securityGroup
The name of the security group used when starting a new instance.int
xsrvPort
Port used by xprmsrv.
-
Constructor Summary
Constructor and Description AEC2()
-
Method Summary
Modifier and Type Method and Description java.util.List<AEC2Instance>
getAllInstances()
Retrieve from AWS the list of running (or recently terminated) instances.void
loadConfig(java.lang.String fname)
Load a config file written by MoselAEC2Instance
runInstance()
Run a new instance using the current settingsvoid
setCredentials(java.lang.String uid, java.lang.String passwd)
Set AWS Credentialsvoid
setEndPoint(java.lang.String ep)
Set EndPointvoid
setSSHKey(java.lang.String k, java.lang.String kdata)
Set SSH keysstatic boolean
tcpPing(java.lang.String hostname, int port)
Test whether a remote host accepts connections on a given port
-
-
-
Field Detail
-
image
public java.lang.String image
The AMI Id used when starting a new instance. This parameter is initialised byloadConfig(java.lang.String)
-
instanceType
public java.lang.String instanceType
The instance type used when starting a new instance. This parameter is initialised byloadConfig(java.lang.String)
. Possible values: m1.small, m1.large, m1.xlarge, c1.medium, c1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, cc1.4xlarge, cg1.4xlarge, t1.micro
-
securityGroup
public java.lang.String securityGroup
The name of the security group used when starting a new instance. This parameter is initialised byloadConfig(java.lang.String)
-
connectionMode
public java.lang.String connectionMode
Default connection mode (xprmsrv or ssh). This parameter is initialised byloadConfig(java.lang.String)
-
xsrvPort
public int xsrvPort
Port used by xprmsrv. This parameter is initialised byloadConfig(java.lang.String)
-
-
Method Detail
-
loadConfig
public void loadConfig(java.lang.String fname) throws java.io.IOException
Load a config file written by Mosel- Parameters:
-
fname
- file to process - Throws:
-
java.io.IOException
- If load fails or the data it contains is not valid
-
setEndPoint
public void setEndPoint(java.lang.String ep) throws java.io.IOException
Set EndPoint- Parameters:
-
ep
- Endpoint to use - Throws:
-
java.io.IOException
- If request to AWS fails
-
setCredentials
public void setCredentials(java.lang.String uid, java.lang.String passwd) throws java.io.IOException
Set AWS Credentials- Parameters:
-
uid
- User Id -
passwd
- password - Throws:
-
java.io.IOException
- If the password or use ID is not valid
-
setSSHKey
public void setSSHKey(java.lang.String k, java.lang.String kdata) throws java.io.IOException
Set SSH keys- Parameters:
-
k
- the key name -
kdata
- its secret part - Throws:
-
java.io.IOException
- If the file generation fails (the key is saved into a file).
-
runInstance
public AEC2Instance runInstance() throws java.io.IOException
Run a new instance using the current settings- Throws:
-
java.io.IOException
-
getAllInstances
public java.util.List<AEC2Instance> getAllInstances() throws java.io.IOException
Retrieve from AWS the list of running (or recently terminated) instances.- Throws:
-
java.io.IOException
-
tcpPing
public static boolean tcpPing(java.lang.String hostname, int port)
Test whether a remote host accepts connections on a given port- Parameters:
-
hostname
- host to test -
port
- TCP port to test - Returns:
-
true
if connection is possible
-
-
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.