Commit 959f4a83 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added cloud storm credentials

parent c10f0682
......@@ -58,9 +58,15 @@
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nl.uva.sne.zh</groupId>
<artifactId>CloudsStorm</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
......@@ -92,5 +98,13 @@
</build>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>zh-releases</id>
<url>https://raw.githubusercontent.com/CloudsStorm/mvn-repo/master/releases</url>
</repository>
</repositories>
</project>
\ No newline at end of file
......@@ -57,18 +57,37 @@ class CloudStormService {
}
public ToscaTemplate execute() throws FileNotFoundException, JSchException, IOException, ApiException, Exception {
String tempInputDirPath = System.getProperty("java.io.tmpdir") + File.separator + "Input-" + Long.toString(System.nanoTime()) + File.separator;
File tempInputDir = new File(tempInputDirPath);
if (!(tempInputDir.mkdirs())) {
throw new FileNotFoundException("Could not create input directory: " + tempInputDir.getAbsolutePath());
}
String topologyTempInputDirPath = File.separator + "topology";
File topologyTempInputDir = new File(topologyTempInputDirPath);
if (!(topologyTempInputDir.mkdirs())) {
throw new FileNotFoundException("Could not create input directory: " + topologyTempInputDir.getAbsolutePath());
}
writeCloudStormTopologyFiles(toscaTemplate, topologyTempInputDirPath);
writeCloudStormTopology(toscaTemplate, tempInputDirPath);
String credentialsTempInputDirPath = File.separator + "credentials";
File credentialsTempInputDir = new File(credentialsTempInputDirPath);
if (!(credentialsTempInputDir.mkdirs())) {
throw new FileNotFoundException("Could not create input directory: " + topologyTempInputDir.getAbsolutePath());
}
writeCloudcredentialsTopologyFiles(toscaTemplate, credentialsTempInputDirPath);
String infrasCodeTempInputDirPath = File.separator + "infrasCodes";
File infrasCodeTempInputDir = new File(infrasCodeTempInputDirPath);
if (!(infrasCodeTempInputDir.mkdirs())) {
throw new FileNotFoundException("Could not create input directory: " + topologyTempInputDir.getAbsolutePath());
}
return toscaTemplate;
}
private void writeCloudStormTopology(ToscaTemplate toscaTemplate, String tempInputDirPath) throws JSchException, IOException, ApiException, Exception {
private void writeCloudStormTopologyFiles(ToscaTemplate toscaTemplate, String tempInputDirPath) throws JSchException, IOException, ApiException, Exception {
CloudsStormTopTopology topTopology = new CloudsStormTopTopology();
String publicKeyPath = buildSSHKeyPair(tempInputDirPath);
topTopology.setPublicKeyPath(publicKeyPath);
......@@ -154,4 +173,8 @@ class CloudStormService {
return null;
}
private void writeCloudcredentialsTopologyFiles(ToscaTemplate toscaTemplate, String credentialsTempInputDirPath) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
......@@ -90,6 +90,8 @@ public class Consumer extends DefaultConsumer {
channel.basicAck(envelope.getDeliveryTag(), false);
} catch (JSchException | ApiException ex) {
Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex);
}
}
......
CloudCred:
type: "object"
properties:
cloudProvider:
type: "string"
credInfoFile:
type: "string"
cloudCreds:
type: "object"
properties:
CloudCred:
type: "array"
items:
$ref: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/CloudCred.yml#/CloudCred"
credInfo:
type: "object"
properties:
userKeyName:
type: "string"
keyAlias:
type: "string"
keyPassword:
type: "string"
proxyFileName:
type: "string"
trustedCertDirName:
type: "string"
accessKey:
type: "string"
secretKey:
type: "string"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment