Commit 7e2a4bba authored by Spiros Koulouzis's avatar Spiros Koulouzis

try to add streaming for logs

parent e3bfff6f
This diff is collapsed.
version: '3.1'
services:
zookeeper:
image: zookeeper
deploy:
restart_policy:
condition: on-failure
networks:
- storm
nimbus:
image: alogo53/docker-storm
environment:
TOPOLOGY_URL: https://github.com/skoulouzis/lightning/releases/download/v0.1-beta/lightning-0.0.1-SNAPSHOT-jar-with-dependencies.jar
TOPOLOGY_NAME: lightning
TOPOLOGY_MAIN: de.pangaea.lightning.ENVRI_NRTQualityCheck
TOPOLOGY_ARGS: arg1 arg2
depends_on:
- zookeeper
deploy:
placement:
constraints: [node.role == manager]
ports:
- 6627:6627
networks:
- storm
#worker
supervisor:
image: storm
command: storm supervisor
depends_on:
- nimbus
- zookeeper
deploy:
restart_policy:
condition: on-failure
ports:
- 8000:8000
networks:
- storm
ui:
image: storm
command: storm ui
depends_on:
- nimbus
- zookeeper
- supervisor
deploy:
restart_policy:
condition: on-failure
ports:
- 8081:8080
networks:
#- monitoring
- storm
############### monitoring#####################
#influx:
#image: influxdb
#environment:
#INFLUXDB_DB: cadvisor
##volumes:
##- influx:/var/lib/influxdb
#deploy:
#replicas: 1
#placement:
#constraints:
#- node.role == manager
#resources:
#limits:
#cpus: "0.10"
#memory: "128M"
#reservations:
#cpus: "0.05"
#memory: "64M"
#networks:
#- monitoring
#grafana:
#image: alogo53/grafana-docker
#environment:
#DS_NAME: InfluxDB
#DS_TYPE: InfluxDB
#DS_ACCESS: proxy
#DS_URL: http://influx:8086
#DS_DB: cadvisor
#ports:
#- 0.0.0.0:3000:3000
##volumes:
##- grafana:/var/lib/grafana
#depends_on:
#- influx
#deploy:
#replicas: 1
#placement:
#constraints:
#- node.role == manager
#resources:
#limits:
#cpus: "0.10"
#memory: "128M"
#reservations:
#cpus: "0.05"
#memory: "64M"
##networks:
##- monitoring
#cadvisor:
#image: google/cadvisor
#ports:
#- 0.0.0.0:8080:8080
#hostname: '{{.Node.ID}}'
#command: -logtostderr -docker_only -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=influx:8086
#volumes:
#- /:/rootfs:ro
#- /var/run:/var/run:rw
#- /sys:/sys:ro
#- /var/lib/docker/:/var/lib/docker:ro
#depends_on:
#- influx
#deploy:
#mode: global
#resources:
#limits:
#cpus: "0.10"
#memory: "128M"
#reservations:
#cpus: "0.05"
#memory: "64M"
#networks:
#- monitoring
logspout:
image: gliderlabs/logspout:latest
networks:
- logging
volumes:
- /etc/hostname:/etc/host_hostname:ro
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8001:80"
deploy:
mode: global
resources:
limits:
cpus: "0.10"
memory: "128M"
reservations:
cpus: "0.05"
memory: "64M"
networks:
- monitoring
#volumes:
#influx:
#driver: local
#grafana:
#driver: local
networks:
monitoring:
storm:
\ No newline at end of file
...@@ -153,8 +153,6 @@ def docker_check(vm, compose_name): ...@@ -153,8 +153,6 @@ def docker_check(vm, compose_name):
json_dict = {} json_dict = {}
response_str = response_str.rstrip("\n\r").strip(' \t\n\r').strip().encode('string_escape') response_str = response_str.rstrip("\n\r").strip(' \t\n\r').strip().encode('string_escape')
json_dict = json.loads(response_str) json_dict = json.loads(response_str)
json_response['inspect_info'] = json_dict json_response['inspect_info'] = json_dict
......
...@@ -33,12 +33,6 @@ ...@@ -33,12 +33,6 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-provisioning-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>nl.uva.sne.drip</groupId> <groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-provisioning-agent</artifactId> <artifactId>drip-provisioning-agent</artifactId>
......
...@@ -53,6 +53,7 @@ import org.json.JSONObject; ...@@ -53,6 +53,7 @@ import org.json.JSONObject;
* *
* @author H. Zhou, S. Koulouzis * @author H. Zhou, S. Koulouzis
*/ */
@Deprecated
public class Consumer extends DefaultConsumer { public class Consumer extends DefaultConsumer {
private final Channel channel; private final Channel channel;
...@@ -61,12 +62,14 @@ public class Consumer extends DefaultConsumer { ...@@ -61,12 +62,14 @@ public class Consumer extends DefaultConsumer {
Map<String, String> em = new HashMap<>(); Map<String, String> em = new HashMap<>();
// private String jarFilePath; // private String jarFilePath;
@Deprecated
public class TopologyElement { public class TopologyElement {
String topologyName = ""; String topologyName = "";
String outputFilePath = ""; String outputFilePath = "";
} }
@Deprecated
public Consumer(Channel channel) throws IOException { public Consumer(Channel channel) throws IOException {
super(channel); super(channel);
this.channel = channel; this.channel = channel;
...@@ -243,7 +246,7 @@ public class Consumer extends DefaultConsumer { ...@@ -243,7 +246,7 @@ public class Consumer extends DefaultConsumer {
} }
String cmd = "ec2=" + ec2ConfFilePath + " exogeni=" + geniConfFilePath + " logDir=" + logDir + " topology=" + mainTopologyPath; String cmd = "ec2=" + ec2ConfFilePath + " exogeni=" + geniConfFilePath + " logDir=" + logDir + " topology=" + mainTopologyPath;
Provisioning.ProvisioningCore.main(cmd.split(" ")); // Provisioning.ProvisioningCore.main(cmd.split(" "));
// String cmd = "java -jar " + jarFilePath + " ec2=" + ec2ConfFilePath + " exogeni=" + geniConfFilePath + " logDir=" + logDir + " topology=" + mainTopologyPath; // String cmd = "java -jar " + jarFilePath + " ec2=" + ec2ConfFilePath + " exogeni=" + geniConfFilePath + " logDir=" + logDir + " topology=" + mainTopologyPath;
// try { // try {
// Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Executing: " + cmd); // Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Executing: " + cmd);
......
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.licensePath>${project.basedir}/../licenseheader.txt</netbeans.hint.licensePath>
</properties>
</project-shared-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>drip-tests</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-framework</artifactId>
<version>2.3.28</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.25.1</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-api-json-client</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.6</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-external</id>
<phase>clean</phase>
<configuration>
<file>${basedir}/../docs/apidocs/drip-api-json-client.jar</file>
<repositoryLayout>default</repositoryLayout>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-api-json-client</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
access.key.id=lferpoiewp
secret.key=erfiru
cloud.provider.name=ec2
cloud.private.key.paths=/home/alogo/Downloads/DRIP/Virginia.pem,/home/alogo/Downloads/DRIP/California.pem
drip.host=http://localhost:8080/drip-api
\ No newline at end of file
test.property.files=ec2_test.properties
\ No newline at end of file
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.test.clients;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.net.URL;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import nl.uva.sne.drip.data.v1.external.KeyPair;
/**
*
* @author S. Koulouzis
*/
public class KeyPairClient extends RestClient {
private static final String PATH = "/user/v1.0/keys";
public KeyPairClient(URL host) {
super(host);
}
public Response postKeyPair(KeyPair pair) throws JsonProcessingException {
String jsonInString = getMapper().writeValueAsString(pair);
Entity<String> entity = Entity.json(jsonInString);
// Entity<KeyPair> entity = Entity.entity(pair, "application/json");
return getWebTarget().
path(PATH).
request().
header("Authorization", "Basic dXNlcjoxMjM=").post(entity);
}
public String getPostKeyPairResponse(Response response) {
return response.readEntity(String.class);
}
public Response get(String keyID) {
return getWebTarget().
path(PATH).
path(keyID).
request().
header("Authorization", "Basic dXNlcjoxMjM=").get();
}
public KeyPair getGetKeyPairResponse(Response response) throws IOException {
String json = response.readEntity(String.class);
return getMapper().readValue(json, KeyPair.class);
}
public Response delete(String keyID) {
return getWebTarget().
path(PATH).
path(keyID).
request().
header("Authorization", "Basic dXNlcjoxMjM=").delete();
}
}
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.test.clients;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URL;
import javax.net.ssl.SSLContext;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import org.glassfish.grizzly.ssl.SSLContextConfigurator;
/**
*
* @author S. Koulouzis
*/
public class RestClient {
private final Client client;
private final WebTarget webTarget;
private final ObjectMapper mapper;
public RestClient(URL host) {
this.client = createClient();
this.webTarget = client.target(host.toString());
this.mapper = new ObjectMapper();
}
private Client createClient() {
ClientBuilder builder = ClientBuilder.newBuilder();
SSLContextConfigurator sslContextConfigurator = new SSLContextConfigurator();
SSLContext sc = sslContextConfigurator.createSSLContext(true);
builder = builder.sslContext(sc);
builder.hostnameVerifier(new javax.net.ssl.HostnameVerifier() {
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
return true;
}
});
return builder.build();
}
/**
* @return the webTarget
*/
public WebTarget getWebTarget() {
return webTarget;
}
/**
* @return the mapper
*/
public ObjectMapper getMapper() {
return mapper;
}
}
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.test.manager;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.client.Client;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.apache.http.*;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
/**
*
* @author S. Koulouzis
*/
public class DRIPTest {
private static List<String> PROPERTIES_FILE_PATHS = new ArrayList<>();
public static List<Properties> propertiesList = new ArrayList<>();
public static final String ACCESS_KEY_ID_PROPPERTY_NAME = "access.key.id";
public static final String CLOUD_PROPVIDER_PROPPERTY_NAME = "cloud.provider.name";
public static final String SECRET_KEY_PROPERTY_NAME = "secret.key";
public static final String CLOUD_PRIVATE_KEY_PATHS_PROPERTY_NAME = "cloud.private.key.paths";
public static final String DRIP_HOST_PROPERTY_NAME = "drip.host";
public static final String DRIP_TEST_PROPERTY_FILES_PROPERTY_NAME = "test.property.files";
@BeforeClass
public static void setUpClass() {
try (InputStream is = ClassLoader.getSystemResourceAsStream("test.properties")) {
Properties mainPropertyFile = new Properties();
mainPropertyFile.load(is);
PROPERTIES_FILE_PATHS = Arrays.asList(mainPropertyFile.getProperty(DRIP_TEST_PROPERTY_FILES_PROPERTY_NAME).split(","));
for (String propFile : PROPERTIES_FILE_PATHS) {
try (InputStream inStream = ClassLoader.getSystemResourceAsStream(propFile)) {
Properties prop = new Properties();
prop.load(inStream);
propertiesList.add(prop);
} catch (FileNotFoundException ex) {
Logger.getLogger(TestCloudCredentialsController.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(TestCloudCredentialsController.class.getName()).log(Level.SEVERE, null, ex);
}
}
} catch (IOException ex) {
Logger.getLogger(DRIPTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
// TODO add test methods here.
// The methods must be annotated with annotation @Test. For example:
//
// @Test
// public void hello() {}
private Client create(String host) {
// SSLContext sc;
// ClientBuilder builder = ClientBuilder.newBuilder();
//
// try {
// builder.hostnameVerifier(new javax.net.ssl.HostnameVerifier() {
// public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
// if (hostname.equals(host)) {
// return true;
// }
// return false;
// }
// });
// builder = builder.sslContext(sc);
// if (basicAutorization != null) {
// builder.register(basicAutorization);
// }
// } catch (NullPointerException npe) {
// LOGGER.warn("Null SSL context, skipping client SSL configuration", npe);
// }
// return builder.build();
return null;
}
}
/*
* Copyright 2017 S. Koulouzis.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.test.manager;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import nl.uva.sne.drip.data.v1.external.CloudCredentials;
import nl.uva.sne.drip.data.v1.external.Key;
import nl.uva.sne.drip.data.v1.external.KeyPair;
import nl.uva.sne.drip.data.v1.external.KeyType;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.junit.Test;
/**
*
* @author S. Koulouzis.
*/
public class TestCloudCredentialsController extends DRIPTest {
@Test
public void testPOST_GETCloudCredentials() {
for (Properties p : DRIPTest.propertiesList) {
String[] paths = p.getProperty(DRIPTest.CLOUD_PRIVATE_KEY_PATHS_PROPERTY_NAME).split(",");
for (String cloudPrivateKeyPath : paths) {
try {
KeyPair keyPair = new KeyPair();
Key privateKey = new Key();
privateKey.setName(FileUtils.readFileToString(new File(cloudPrivateKeyPath), "UTF-8"));
privateKey.setKey(FilenameUtils.getBaseName(cloudPrivateKeyPath));
privateKey.setType(KeyType.PRIVATE);
Map<String, String> map = new HashMap<>();
map.put(cloudPrivateKeyPath, cloudPrivateKeyPath);
privateKey.setAttributes(map);
keyPair.setPrivateKey(privateKey);
} catch (IOException ex) {
Logger.getLogger(TestCloudCredentialsController.class.getName()).log(Level.SEVERE, null, ex);
}
}
CloudCredentials cc = new CloudCredentials();
cc.setAccessKeyId(p.getProperty(ACCESS_KEY_ID_PROPPERTY_NAME));
cc.setCloudProviderName(p.getProperty(CLOUD_PROPVIDER_PROPPERTY_NAME));
cc.setSecretKey(p.getProperty(DRIPTest.SECRET_KEY_PROPERTY_NAME));
List<String> keyPairIDs = new ArrayList<>();
cc.setKeyPairIDs(keyPairIDs);
}
}
}
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.test.manager;
import nl.uva.sne.drip.test.clients.KeyPairClient;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.core.Response;
import nl.uva.sne.drip.data.v1.external.CloudCredentials;
import nl.uva.sne.drip.data.v1.external.Key;
import nl.uva.sne.drip.data.v1.external.KeyPair;
import nl.uva.sne.drip.data.v1.external.KeyType;
import static nl.uva.sne.drip.test.manager.DRIPTest.ACCESS_KEY_ID_PROPPERTY_NAME;
import static nl.uva.sne.drip.test.manager.DRIPTest.CLOUD_PROPVIDER_PROPPERTY_NAME;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author S. Koulouzis
*/
public class TestKeysController extends DRIPTest {
@Test
public void test_POST_GET_DELETECoudKeys() throws MalformedURLException {
for (Properties p : DRIPTest.propertiesList) {
String[] paths = p.getProperty(DRIPTest.CLOUD_PRIVATE_KEY_PATHS_PROPERTY_NAME).split(",");
KeyPairClient client = new KeyPairClient(new URL(p.getProperty(DRIPTest.DRIP_HOST_PROPERTY_NAME)));
for (String cloudPrivateKeyPath : paths) {
try {
KeyPair keyPair = new KeyPair();
Key privateKey = createPrivateCloudKey(cloudPrivateKeyPath);
keyPair.setPrivateKey(privateKey);
Response response = client.postKeyPair(keyPair);
assertEquals(200, response.getStatus());
String keyID = client.getPostKeyPairResponse(response);
assertNotNull(keyID);
response = client.get(keyID);
assertEquals(200, response.getStatus());
KeyPair returnedPair = client.getGetKeyPairResponse(response);
assertNotNull(returnedPair);
assertEquals(keyID, returnedPair.getId());
assertNotNull(returnedPair.getPrivateKey());
response = client.delete(keyID);
assertEquals(200, response.getStatus());
} catch (IOException ex) {
Logger.getLogger(TestCloudCredentialsController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
private Key createPrivateCloudKey(String cloudPrivateKeyPath) throws IOException {
Key privateKey = new Key();
privateKey.setName(FilenameUtils.getBaseName(cloudPrivateKeyPath));
privateKey.setKey(FileUtils.readFileToString(new File(cloudPrivateKeyPath), "UTF-8"));
privateKey.setType(KeyType.PRIVATE);
Map<String, String> map = new HashMap<>();
map.put("domain_name", FilenameUtils.getBaseName(cloudPrivateKeyPath));
privateKey.setAttributes(map);
return privateKey;
}
}
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCzgscD/Npm5kIJvRdyxtrsPUcxaKM6jqAwiDDPISkZarWvIG07
gsYcsl7XQDftys+/5/pqc0qM9Eq9qNR2VepVKBeM4+bgXIUlKIHjsF4Olsyd5S7p
50vgZuQts1M+P/risjkEd3H/I+HEJqw3LoNFyIRL2dg2ZCuU9V1GByjBHQIDAQAB
AoGAcRwzaLjXqUTnUZmbf8/7PCY0iNaFG62pFEuMbcdYTVKm3o2RJpF1Ybmm9vzZ
APXtR9/VM2QoEn8P5UfPcC0ctLKuxbDKVhNY0Li3hiiV7m2ItKpT2UAPfAxyReYV
3/8iQKH7vYkJMEw+AlUhtlZHkkxVz49BUNVGyA9FnOpb/OECQQDpHLvbalKgDAUT
k3un6OwZd7ArfN1BDHd6LZpQEf+7yedZs7QIDQSdnVEg79pZLG7/lwO+P4utszwV
gD8jbHspAkEAxSLGX4GDkK0AKIUAIDzNNyFMtGEoSupDB15AkBiFQBP+z0pxRJvN
mgj4PP1nGwtwhy0sGuvhJSeeKedUOEUI1QJAUdW7gTCXJwZxNckdrPmRAPPKjcm8
5pwYyXR+6sMW0vbzV8NFXVosl6Rlmbl6HroBkYqTTtOCFo2Id0fZYncv2QJAGcBm
K3mupwqCV8iv8IYgxI/cBkAe1FJvuRmt02TwmyNBiPCPhUfY/sMnMkhj3JuM8ouL
FGU1vvXC6nRmgwc5lQJBAIRRR4sNIcTLWmu63rSusNMaE8F6cxFzUHkkUH5MOpBq
eg8rq29k1IUCNcz69ktdFWo3dtsEnHftCDHrLlS5Ko4=
-----END RSA PRIVATE KEY-----
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<modules> <modules>
<module>drip-api</module> <module>drip-api</module>
<module>drip-planner2provisioner</module> <module>drip-planner2provisioner</module>
<module>drip-tests</module>
<module>drip-commons</module> <module>drip-commons</module>
<module>drip-provisioner</module> <module>drip-provisioner</module>
</modules> </modules>
......
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