Hi there,
I've got a three questions about jclouds. At the moment I've got jclouds working with Amazon EC2: a instance starts, it installs tomcat and deploy's the Spring petclinic application. I must say it was very confusing which example or documentation-page from jclouds was the most up to date and correct to achieve this. I did it like this (not valid code, but for the idea):
AWSEC2ComputeService computeService = getComputeService();
String userData = buildInitScript(OsFamily.UNIX, "sudo apt-get -y update", "sudo apt-get -y install tomcat7");
// Create instance
computeService.createNodesInGroup(amazonConfiguration.getInstanceName(), 1, getTemplate(computeService, userData));
@Override
protected AWSEC2ComputeService getComputeService() {
ContextBuilder contextBuilder = ContextBuilder.newBuilder("aws-ec2").credentials(this.amazonConfiguration.getAccesskey(), this.amazonConfiguration.getSecretkey());
return contextBuilder.build(AWSEC2ComputeServiceContext.class).getComputeService();
}
@Override
protected String buildInitScript(OsFamily osFamily, String... commands) {
ScriptBuilder builder = new ScriptBuilder();
for (String command : commands) {
builder.addStatement(exec(command));
}
return builder.render(osFamily);
}
Is this the correct way to do it, specially the initscript building part?
My next question is, is there a particular reason why the cloud platform Heroku isn't supported? And my final question is, I'm trying to support CloudSigma right now, but I noticed jclouds is using the old API (version 1). Am I right and is it going to use the API version 2 in the future?
Thanks!