mirror of https://github.com/apache/jclouds.git
Issue 710: update existing vcloud providers
This commit is contained in:
parent
0b40a3b280
commit
82673e0dd5
|
@ -141,8 +141,8 @@ cloudsigma-lvs.contextbuilder=org.jclouds.cloudsigma.CloudSigmaContextBuilder
|
||||||
ibm-smartcloud.propertiesbuilder=org.jclouds.ibm.smartcloud.IBMSmartCloudPropertiesBuilder
|
ibm-smartcloud.propertiesbuilder=org.jclouds.ibm.smartcloud.IBMSmartCloudPropertiesBuilder
|
||||||
ibm-smartcloud.contextbuilder=org.jclouds.ibm.smartcloud.IBMSmartCloudContextBuilder
|
ibm-smartcloud.contextbuilder=org.jclouds.ibm.smartcloud.IBMSmartCloudContextBuilder
|
||||||
|
|
||||||
virtacore-vcloudexpress.propertiesbuilder=org.jclouds.virtacore.vcloudexpress.VirtacoreVCloudExpressPropertiesBuilder
|
virtacore-publiccloud-lax.propertiesbuilder=org.jclouds.virtacore.publiccloud.VirtacorePublicCloudLAXPropertiesBuilder
|
||||||
virtacore-vcloudexpress.contextbuilder=org.jclouds.virtacore.vcloudexpress.VirtacoreVCloudExpressContextBuilder
|
virtacore-publiccloud-lax.contextbuilder=org.jclouds.virtacore.publiccloud.VirtacorePublicCloudLAXContextBuilder
|
||||||
|
|
||||||
dunkel-vcd.propertiesbuilder=org.jclouds.dunkel.vcd.DunkelVCloudDirectorPropertiesBuilder
|
dunkel-vcd.propertiesbuilder=org.jclouds.dunkel.vcd.DunkelVCloudDirectorPropertiesBuilder
|
||||||
dunkel-vcd.contextbuilder=org.jclouds.dunkel.vcd.DunkelVCloudDirectorContextBuilder
|
dunkel-vcd.contextbuilder=org.jclouds.dunkel.vcd.DunkelVCloudDirectorContextBuilder
|
||||||
|
|
|
@ -34,11 +34,6 @@ public class BluelockVCloudZone01ComputeServiceLiveTest extends VCloudComputeSer
|
||||||
provider = "bluelock-vcloud-zone01";
|
provider = "bluelock-vcloud-zone01";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServiceDefaults() {
|
|
||||||
group = "director";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
|
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
|
||||||
// hostname is not completely predictable based on node metadata
|
// hostname is not completely predictable based on node metadata
|
||||||
assert execResponse.getOutput().trim().equals("Ubuntu1004") : execResponse + ": " + node1;
|
assert execResponse.getOutput().trim().equals("Ubuntu1004") : execResponse + ": " + node1;
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
<test.greenhousedata-element-vcloud.identity>FIXME_IDENTITY</test.greenhousedata-element-vcloud.identity>
|
<test.greenhousedata-element-vcloud.identity>FIXME_IDENTITY</test.greenhousedata-element-vcloud.identity>
|
||||||
<test.greenhousedata-element-vcloud.credential>FIXME_CREDENTIAL</test.greenhousedata-element-vcloud.credential>
|
<test.greenhousedata-element-vcloud.credential>FIXME_CREDENTIAL</test.greenhousedata-element-vcloud.credential>
|
||||||
<test.greenhousedata-element-vcloud.image-id></test.greenhousedata-element-vcloud.image-id>
|
<test.greenhousedata-element-vcloud.image-id></test.greenhousedata-element-vcloud.image-id>
|
||||||
|
<test.greenhousedata-element-vcloud.image.login-user></test.greenhousedata-element-vcloud.image.login-user>
|
||||||
|
<test.greenhousedata-element-vcloud.image.authenticate-sudo></test.greenhousedata-element-vcloud.image.authenticate-sudo>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -106,6 +108,8 @@
|
||||||
<test.greenhousedata-element-vcloud.identity>${test.greenhousedata-element-vcloud.identity}</test.greenhousedata-element-vcloud.identity>
|
<test.greenhousedata-element-vcloud.identity>${test.greenhousedata-element-vcloud.identity}</test.greenhousedata-element-vcloud.identity>
|
||||||
<test.greenhousedata-element-vcloud.credential>${test.greenhousedata-element-vcloud.credential}</test.greenhousedata-element-vcloud.credential>
|
<test.greenhousedata-element-vcloud.credential>${test.greenhousedata-element-vcloud.credential}</test.greenhousedata-element-vcloud.credential>
|
||||||
<test.greenhousedata-element-vcloud.image-id>${test.greenhousedata-element-vcloud.image-id}</test.greenhousedata-element-vcloud.image-id>
|
<test.greenhousedata-element-vcloud.image-id>${test.greenhousedata-element-vcloud.image-id}</test.greenhousedata-element-vcloud.image-id>
|
||||||
|
<test.greenhousedata-element-vcloud.image.login-user>${test.greenhousedata-element-vcloud.image.login-user}</test.greenhousedata-element-vcloud.image.login-user>
|
||||||
|
<test.greenhousedata-element-vcloud.image.authenticate-sudo>${test.greenhousedata-element-vcloud.image.authenticate-sudo}</test.greenhousedata-element-vcloud.image.authenticate-sudo>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.greenhousedata.element.vcloud.compute;
|
package org.jclouds.greenhousedata.element.vcloud.compute;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.ExecResponse;
|
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
|
||||||
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -32,17 +30,6 @@ import org.testng.annotations.Test;
|
||||||
public class GreenHouseDataElementVCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
public class GreenHouseDataElementVCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
||||||
public GreenHouseDataElementVCloudComputeServiceLiveTest() {
|
public GreenHouseDataElementVCloudComputeServiceLiveTest() {
|
||||||
provider = "greenhousedata-element-vcloud";
|
provider = "greenhousedata-element-vcloud";
|
||||||
// vcloud requires instantiate before deploy, which takes longer than 30 seconds
|
|
||||||
nonBlockDurationSeconds = 300;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServiceDefaults() {
|
|
||||||
group = "director";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
|
|
||||||
// hostname is not predictable based on node metadata
|
|
||||||
assert execResponse.getOutput().trim().equals("(none)");
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.greenhousedata.element.vcloud.features;
|
package org.jclouds.greenhousedata.element.vcloud.features;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.ExecResponse;
|
|
||||||
import org.jclouds.vcloud.features.VmClientLiveTest;
|
import org.jclouds.vcloud.features.VmClientLiveTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -34,14 +33,4 @@ public class GreenHouseDataElementVCloudVmClientLiveTest extends VmClientLiveTes
|
||||||
provider = "greenhousedata-element-vcloud";
|
provider = "greenhousedata-element-vcloud";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void checkApiOutput(String apiOutput) {
|
|
||||||
checkApiOutput1_0_0(apiOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void checkCustomizationOccurred(ExecResponse exec) {
|
|
||||||
// for some reason customization doesn't actually occur
|
|
||||||
assert exec.getOutput().equals("") : exec;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,12 @@
|
||||||
<properties>
|
<properties>
|
||||||
<test.stratogen-vcloud-mycloud.endpoint>https://vcd.stratogen.net/api</test.stratogen-vcloud-mycloud.endpoint>
|
<test.stratogen-vcloud-mycloud.endpoint>https://vcd.stratogen.net/api</test.stratogen-vcloud-mycloud.endpoint>
|
||||||
<test.stratogen-vcloud-mycloud.api-version>1.0</test.stratogen-vcloud-mycloud.api-version>
|
<test.stratogen-vcloud-mycloud.api-version>1.0</test.stratogen-vcloud-mycloud.api-version>
|
||||||
<test.stratogen-vcloud-mycloud.build-version></test.stratogen-vcloud-mycloud.build-version>
|
<test.stratogen-vcloud-mycloud.build-version>1.5.0.464915</test.stratogen-vcloud-mycloud.build-version>
|
||||||
<test.stratogen-vcloud-mycloud.identity>FIXME_IDENTITY</test.stratogen-vcloud-mycloud.identity>
|
<test.stratogen-vcloud-mycloud.identity>FIXME_IDENTITY</test.stratogen-vcloud-mycloud.identity>
|
||||||
<test.stratogen-vcloud-mycloud.credential>FIXME_CREDENTIAL</test.stratogen-vcloud-mycloud.credential>
|
<test.stratogen-vcloud-mycloud.credential>FIXME_CREDENTIAL</test.stratogen-vcloud-mycloud.credential>
|
||||||
<test.stratogen-vcloud-mycloud.image-id></test.stratogen-vcloud-mycloud.image-id>
|
<test.stratogen-vcloud-mycloud.image-id></test.stratogen-vcloud-mycloud.image-id>
|
||||||
|
<test.stratogen-vcloud-mycloud.image.login-user></test.stratogen-vcloud-mycloud.image.login-user>
|
||||||
|
<test.stratogen-vcloud-mycloud.image.authenticate-sudo></test.stratogen-vcloud-mycloud.image.authenticate-sudo>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -106,6 +108,8 @@
|
||||||
<test.stratogen-vcloud-mycloud.identity>${test.stratogen-vcloud-mycloud.identity}</test.stratogen-vcloud-mycloud.identity>
|
<test.stratogen-vcloud-mycloud.identity>${test.stratogen-vcloud-mycloud.identity}</test.stratogen-vcloud-mycloud.identity>
|
||||||
<test.stratogen-vcloud-mycloud.credential>${test.stratogen-vcloud-mycloud.credential}</test.stratogen-vcloud-mycloud.credential>
|
<test.stratogen-vcloud-mycloud.credential>${test.stratogen-vcloud-mycloud.credential}</test.stratogen-vcloud-mycloud.credential>
|
||||||
<test.stratogen-vcloud-mycloud.image-id>${test.stratogen-vcloud-mycloud.image-id}</test.stratogen-vcloud-mycloud.image-id>
|
<test.stratogen-vcloud-mycloud.image-id>${test.stratogen-vcloud-mycloud.image-id}</test.stratogen-vcloud-mycloud.image-id>
|
||||||
|
<test.stratogen-vcloud-mycloud.image.login-user>${test.stratogen-vcloud-mycloud.image.login-user}</test.stratogen-vcloud-mycloud.image.login-user>
|
||||||
|
<test.stratogen-vcloud-mycloud.image.authenticate-sudo>${test.stratogen-vcloud-mycloud.image.authenticate-sudo}</test.stratogen-vcloud-mycloud.image.authenticate-sudo>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.stratogen.vcloud.mycloud;
|
package org.jclouds.stratogen.vcloud.mycloud;
|
||||||
|
|
||||||
|
import static org.jclouds.Constants.PROPERTY_BUILD_VERSION;
|
||||||
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
||||||
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
||||||
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
||||||
|
@ -37,6 +38,7 @@ public class StratoGenVCloudMyCloudPropertiesBuilder extends VCloudPropertiesBui
|
||||||
Properties properties = super.defaultProperties();
|
Properties properties = super.defaultProperties();
|
||||||
properties.setProperty(PROPERTY_ISO3166_CODES, "GB");
|
properties.setProperty(PROPERTY_ISO3166_CODES, "GB");
|
||||||
properties.setProperty(PROPERTY_ENDPOINT, "https://vcd.stratogen.net/api");
|
properties.setProperty(PROPERTY_ENDPOINT, "https://vcd.stratogen.net/api");
|
||||||
|
properties.setProperty(PROPERTY_BUILD_VERSION, "1.5.0.464915");
|
||||||
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "Direct Internet");
|
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "Direct Internet");
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.stratogen.vcloud.mycloud.config;
|
package org.jclouds.stratogen.vcloud.mycloud.config;
|
||||||
|
|
||||||
|
import org.jclouds.compute.domain.TemplateBuilder;
|
||||||
import org.jclouds.compute.options.TemplateOptions;
|
import org.jclouds.compute.options.TemplateOptions;
|
||||||
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
|
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
|
||||||
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
|
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
|
||||||
|
@ -31,6 +32,12 @@ import com.google.inject.Injector;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class StratoGenVCloudMyCloudComputeServiceContextModule extends VCloudComputeServiceContextModule {
|
public class StratoGenVCloudMyCloudComputeServiceContextModule extends VCloudComputeServiceContextModule {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
|
||||||
|
return template.imageNameMatches("Ubuntu server 11.04 64bit no GUI (base)");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) {
|
protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) {
|
||||||
return options.as(VCloudTemplateOptions.class).ipAddressAllocationMode(IpAddressAllocationMode.POOL);
|
return options.as(VCloudTemplateOptions.class).ipAddressAllocationMode(IpAddressAllocationMode.POOL);
|
||||||
|
|
|
@ -18,16 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.stratogen.vcloud.mycloud.compute;
|
package org.jclouds.stratogen.vcloud.mycloud.compute;
|
||||||
|
|
||||||
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
|
|
||||||
import static org.testng.Assert.assertEquals;
|
|
||||||
|
|
||||||
import org.jclouds.compute.domain.ExecResponse;
|
import org.jclouds.compute.domain.ExecResponse;
|
||||||
import org.jclouds.compute.domain.Image;
|
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
|
||||||
import org.jclouds.compute.domain.Template;
|
|
||||||
import org.jclouds.compute.domain.TemplateBuilder;
|
|
||||||
import org.jclouds.compute.predicates.OperatingSystemPredicates;
|
|
||||||
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -40,34 +32,6 @@ import org.testng.annotations.Test;
|
||||||
public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
||||||
public StratoGenVCloudMyCloudComputeServiceLiveTest() {
|
public StratoGenVCloudMyCloudComputeServiceLiveTest() {
|
||||||
provider = "stratogen-vcloud-mycloud";
|
provider = "stratogen-vcloud-mycloud";
|
||||||
// vcloud requires instantiate before deploy, which takes longer than 30
|
|
||||||
// seconds
|
|
||||||
nonBlockDurationSeconds = 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServiceDefaults() {
|
|
||||||
group = "director";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTemplateBuilder() {
|
|
||||||
Template defaultTemplate = client.templateBuilder().build();
|
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
|
||||||
assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem());
|
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)");
|
|
||||||
assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation();
|
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
|
||||||
System.out.println(defaultTemplate.getHardware());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Template buildTemplate(TemplateBuilder templateBuilder) {
|
|
||||||
Template template = super.buildTemplate(templateBuilder);
|
|
||||||
Image image = template.getImage();
|
|
||||||
assert image.getDefaultCredentials().credential != null : image;
|
|
||||||
return template;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
|
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.jclouds.compute.domain.Template;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,24 +47,31 @@ public class StratoGenVCloudMyCloudTemplateBuilderLiveTest extends BaseTemplateB
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
|
protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
|
||||||
return new Predicate<OsFamilyVersion64Bit>() {
|
return Predicates.not(new Predicate<OsFamilyVersion64Bit>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
switch (input.family) {
|
switch (input.family) {
|
||||||
case UBUNTU:
|
case UBUNTU:
|
||||||
return !input.version.equals("") || !input.is64Bit;
|
return input.version.equals("");
|
||||||
|
case DEBIAN:
|
||||||
|
return input.version.equals("") && !input.is64Bit;
|
||||||
|
case RHEL:
|
||||||
|
return input.version.equals("") && input.is64Bit;
|
||||||
|
case WINDOWS:
|
||||||
|
return input.version.equals("") && input.is64Bit;
|
||||||
default:
|
default:
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void testDefaultTemplateBuilder() throws IOException {
|
public void testDefaultTemplateBuilder() throws IOException {
|
||||||
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
||||||
|
assertEquals(defaultTemplate.getImage().getName(), "Ubuntu server 11.04 64bit no GUI (base)");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "");
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||||
|
|
|
@ -35,10 +35,12 @@
|
||||||
<properties>
|
<properties>
|
||||||
<test.dunkel-vcd.endpoint>https://vcd.dunkel.de/api</test.dunkel-vcd.endpoint>
|
<test.dunkel-vcd.endpoint>https://vcd.dunkel.de/api</test.dunkel-vcd.endpoint>
|
||||||
<test.dunkel-vcd.api-version>1.0</test.dunkel-vcd.api-version>
|
<test.dunkel-vcd.api-version>1.0</test.dunkel-vcd.api-version>
|
||||||
<test.dunkel-vcd.build-version></test.dunkel-vcd.build-version>
|
<test.dunkel-vcd.build-version>1.0.1.356485</test.dunkel-vcd.build-version>
|
||||||
<test.dunkel-vcd.identity>FIXME_IDENTITY</test.dunkel-vcd.identity>
|
<test.dunkel-vcd.identity>FIXME_IDENTITY</test.dunkel-vcd.identity>
|
||||||
<test.dunkel-vcd.credential>FIXME_CREDENTIAL</test.dunkel-vcd.credential>
|
<test.dunkel-vcd.credential>FIXME_CREDENTIAL</test.dunkel-vcd.credential>
|
||||||
<test.dunkel-vcd.image-id></test.dunkel-vcd.image-id>
|
<test.dunkel-vcd.image-id></test.dunkel-vcd.image-id>
|
||||||
|
<test.dunkel-vcd.image.login-user></test.dunkel-vcd.image.login-user>
|
||||||
|
<test.dunkel-vcd.image.authenticate-sudo></test.dunkel-vcd.image.authenticate-sudo>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -98,14 +100,16 @@
|
||||||
<goal>test</goal>
|
<goal>test</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<test.dunkel-vcd.endpoint>${test.dunkel-vcd.endpoint}</test.dunkel-vcd.endpoint>
|
<test.dunkel-vcd.endpoint>${test.dunkel-vcd.endpoint}</test.dunkel-vcd.endpoint>
|
||||||
<test.dunkel-vcd.api-version>${test.dunkel-vcd.api-version}</test.dunkel-vcd.api-version>
|
<test.dunkel-vcd.api-version>${test.dunkel-vcd.api-version}</test.dunkel-vcd.api-version>
|
||||||
<test.dunkel-vcd.build-version>${test.dunkel-vcd.build-version}</test.dunkel-vcd.build-version>
|
<test.dunkel-vcd.build-version>${test.dunkel-vcd.build-version}</test.dunkel-vcd.build-version>
|
||||||
<test.dunkel-vcd.identity>${test.dunkel-vcd.identity}</test.dunkel-vcd.identity>
|
<test.dunkel-vcd.identity>${test.dunkel-vcd.identity}</test.dunkel-vcd.identity>
|
||||||
<test.dunkel-vcd.credential>${test.dunkel-vcd.credential}</test.dunkel-vcd.credential>
|
<test.dunkel-vcd.credential>${test.dunkel-vcd.credential}</test.dunkel-vcd.credential>
|
||||||
<test.dunkel-vcd.image-id>${test.dunkel-vcd.image-id}</test.dunkel-vcd.image-id>
|
<test.dunkel-vcd.image-id>${test.dunkel-vcd.image-id}</test.dunkel-vcd.image-id>
|
||||||
</systemPropertyVariables>
|
<test.dunkel-vcd.image.login-user>${test.dunkel-vcd.image.login-user}</test.dunkel-vcd.image.login-user>
|
||||||
|
<test.dunkel-vcd.image.authenticate-sudo>${test.dunkel-vcd.image.authenticate-sudo}</test.dunkel-vcd.image.authenticate-sudo>
|
||||||
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
@ -115,6 +119,21 @@
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
|
||||||
|
<Export-Package>org.jclouds.dunkel.vcd.*;version="${project.version}"</Export-Package>
|
||||||
|
<Import-Package>org.jclouds.*;version="${project.version}",*</Import-Package>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.dunkel.vcd;
|
package org.jclouds.dunkel.vcd;
|
||||||
|
|
||||||
|
import static org.jclouds.Constants.PROPERTY_BUILD_VERSION;
|
||||||
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
||||||
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
||||||
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
||||||
|
@ -35,6 +36,7 @@ public class DunkelVCloudDirectorPropertiesBuilder extends VCloudPropertiesBuild
|
||||||
protected Properties defaultProperties() {
|
protected Properties defaultProperties() {
|
||||||
Properties properties = super.defaultProperties();
|
Properties properties = super.defaultProperties();
|
||||||
properties.setProperty(PROPERTY_ISO3166_CODES, "DE");
|
properties.setProperty(PROPERTY_ISO3166_CODES, "DE");
|
||||||
|
properties.setProperty(PROPERTY_BUILD_VERSION, "1.0.1.356485");
|
||||||
properties.setProperty(PROPERTY_ENDPOINT, "https://vcd.dunkel.de/api");
|
properties.setProperty(PROPERTY_ENDPOINT, "https://vcd.dunkel.de/api");
|
||||||
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, ".*-intranet");
|
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, ".*-intranet");
|
||||||
return properties;
|
return properties;
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.dunkel.vcd.config;
|
||||||
import org.jclouds.http.RequiresHttp;
|
import org.jclouds.http.RequiresHttp;
|
||||||
import org.jclouds.rest.ConfiguresRestClient;
|
import org.jclouds.rest.ConfiguresRestClient;
|
||||||
import org.jclouds.vcloud.config.VCloudRestClientModule;
|
import org.jclouds.vcloud.config.VCloudRestClientModule;
|
||||||
import org.jclouds.vcloud.filters.SetVCloudTokenCookie;
|
|
||||||
import org.jclouds.dunkel.vcd.filters.SetVCloudTokenCookieAndAuthorizationHeader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -32,10 +30,4 @@ import org.jclouds.dunkel.vcd.filters.SetVCloudTokenCookieAndAuthorizationHeader
|
||||||
@ConfiguresRestClient
|
@ConfiguresRestClient
|
||||||
public class DunkelVCloudDirectorRestClientModule extends VCloudRestClientModule {
|
public class DunkelVCloudDirectorRestClientModule extends VCloudRestClientModule {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure() {
|
|
||||||
super.configure();
|
|
||||||
bind(SetVCloudTokenCookie.class).to(SetVCloudTokenCookieAndAuthorizationHeader.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
|
||||||
* contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. jclouds licenses this file
|
|
||||||
* to you 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 org.jclouds.dunkel.vcd.filters;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Provider;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
import org.jclouds.http.HttpException;
|
|
||||||
import org.jclouds.http.HttpRequest;
|
|
||||||
import org.jclouds.http.utils.ModifyRequest;
|
|
||||||
import org.jclouds.vcloud.VCloudToken;
|
|
||||||
import org.jclouds.vcloud.filters.SetVCloudTokenCookie;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the VCloud Token to the request as a cookie
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Singleton
|
|
||||||
public class SetVCloudTokenCookieAndAuthorizationHeader extends SetVCloudTokenCookie {
|
|
||||||
|
|
||||||
private final Provider<String> vcloudTokenProvider;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public SetVCloudTokenCookieAndAuthorizationHeader(@VCloudToken Provider<String> authTokenProvider) {
|
|
||||||
super(authTokenProvider);
|
|
||||||
this.vcloudTokenProvider = authTokenProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequest filter(HttpRequest request) throws HttpException {
|
|
||||||
return ModifyRequest.replaceHeader(super.filter(request), "x-vcloud-authorization", vcloudTokenProvider.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -32,9 +32,4 @@ public class DunkelVCloudDirectorComputeServiceLiveTest extends VCloudComputeSer
|
||||||
provider = "dunkel-vcd";
|
provider = "dunkel-vcd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServiceDefaults() {
|
|
||||||
group = "director";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,17 +28,17 @@
|
||||||
<relativePath>../../project/pom.xml</relativePath>
|
<relativePath>../../project/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.jclouds.provider</groupId>
|
<groupId>org.jclouds.provider</groupId>
|
||||||
<artifactId>virtacore-vcloudexpress</artifactId>
|
<artifactId>virtacore-publiccloud-lax</artifactId>
|
||||||
<name>jclouds Virtacore vCloud Express provider</name>
|
<name>jclouds Virtacore Public Cloud LAX provider</name>
|
||||||
<description>vCloud implementation targeted to Virtacore</description>
|
<description>vCloud implementation targeted to Virtacore's LAX datacenter</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<test.virtacore-vcloudexpress.endpoint>https://vcloud.virtacore.com/api</test.virtacore-vcloudexpress.endpoint>
|
<test.virtacore-publiccloud-lax.endpoint>https://cloud.lax.virtacore.com/api/</test.virtacore-publiccloud-lax.endpoint>
|
||||||
<test.virtacore-vcloudexpress.api-version>1.0</test.virtacore-vcloudexpress.api-version>
|
<test.virtacore-publiccloud-lax.api-version>1.0</test.virtacore-publiccloud-lax.api-version>
|
||||||
<test.virtacore-vcloudexpress.build-version></test.virtacore-vcloudexpress.build-version>
|
<test.virtacore-publiccloud-lax.build-version>1.5.0.464915</test.virtacore-publiccloud-lax.build-version>
|
||||||
<test.virtacore-vcloudexpress.identity>FIXME_IDENTITY</test.virtacore-vcloudexpress.identity>
|
<test.virtacore-publiccloud-lax.identity>FIXME_IDENTITY</test.virtacore-publiccloud-lax.identity>
|
||||||
<test.virtacore-vcloudexpress.credential>FIXME_CREDENTIAL</test.virtacore-vcloudexpress.credential>
|
<test.virtacore-publiccloud-lax.credential>FIXME_CREDENTIAL</test.virtacore-publiccloud-lax.credential>
|
||||||
<test.virtacore-vcloudexpress.image-id></test.virtacore-vcloudexpress.image-id>
|
<test.virtacore-publiccloud-lax.image-id></test.virtacore-publiccloud-lax.image-id>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -99,12 +99,15 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<test.virtacore-vcloudexpress.endpoint>${test.virtacore-vcloudexpress.endpoint}</test.virtacore-vcloudexpress.endpoint>
|
<test.virtacore-publiccloud-lax.endpoint>${test.virtacore-publiccloud-lax.endpoint}</test.virtacore-publiccloud-lax.endpoint>
|
||||||
<test.virtacore-vcloudexpress.api-version>${test.virtacore-vcloudexpress.api-version}</test.virtacore-vcloudexpress.api-version>
|
<test.virtacore-publiccloud-lax.api-version>${test.virtacore-publiccloud-lax.api-version}</test.virtacore-publiccloud-lax.api-version>
|
||||||
<test.virtacore-vcloudexpress.build-version>${test.virtacore-vcloudexpress.build-version}</test.virtacore-vcloudexpress.build-version>
|
<test.virtacore-publiccloud-lax.build-version>${test.virtacore-publiccloud-lax.build-version}</test.virtacore-publiccloud-lax.build-version>
|
||||||
<test.virtacore-vcloudexpress.identity>${test.virtacore-vcloudexpress.identity}</test.virtacore-vcloudexpress.identity>
|
<test.virtacore-publiccloud-lax.identity>${test.virtacore-publiccloud-lax.identity}</test.virtacore-publiccloud-lax.identity>
|
||||||
<test.virtacore-vcloudexpress.credential>${test.virtacore-vcloudexpress.credential}</test.virtacore-vcloudexpress.credential>
|
<test.virtacore-publiccloud-lax.credential>${test.virtacore-publiccloud-lax.credential}</test.virtacore-publiccloud-lax.credential>
|
||||||
<test.virtacore-vcloudexpress.image-id>${test.virtacore-vcloudexpress.image-id}</test.virtacore-vcloudexpress.image-id>
|
<test.virtacore-publiccloud-lax.image-id>${test.virtacore-publiccloud-lax.image-id}</test.virtacore-publiccloud-lax.image-id>
|
||||||
|
<test.virtacore-publiccloud-lax.image-id>${test.virtacore-publiccloud-lax.image-id}</test.virtacore-publiccloud-lax.image-id>
|
||||||
|
<test.virtacore-publiccloud-lax.image.login-user>${test.virtacore-publiccloud-lax.image.login-user}</test.virtacore-publiccloud-lax.image.login-user>
|
||||||
|
<test.virtacore-publiccloud-lax.image.authenticate-sudo>${test.virtacore-publiccloud-lax.image.authenticate-sudo}</test.virtacore-publiccloud-lax.image.authenticate-sudo>
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -116,5 +119,20 @@
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
|
||||||
|
<Export-Package>org.jclouds.virtacore.publiccloud.*;version="${project.version}"</Export-Package>
|
||||||
|
<Import-Package>org.jclouds.*;version="${project.version}",*</Import-Package>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress;
|
package org.jclouds.virtacore.publiccloud;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.jclouds.vcloud.VCloudContextBuilder;
|
import org.jclouds.vcloud.VCloudContextBuilder;
|
||||||
import org.jclouds.virtacore.vcloudexpress.config.VirtacoreVCloudExpressComputeServiceContextModule;
|
import org.jclouds.virtacore.publiccloud.config.VirtacorePublicCloudLAXComputeServiceContextModule;
|
||||||
import org.jclouds.virtacore.vcloudexpress.config.VirtacoreVCloudExpressRestClientModule;
|
import org.jclouds.virtacore.publiccloud.config.VirtacorePublicCloudLAXRestClientModule;
|
||||||
|
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
|
|
||||||
|
@ -32,20 +32,20 @@ import com.google.inject.Module;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class VirtacoreVCloudExpressContextBuilder extends VCloudContextBuilder {
|
public class VirtacorePublicCloudLAXContextBuilder extends VCloudContextBuilder {
|
||||||
|
|
||||||
public VirtacoreVCloudExpressContextBuilder(Properties props) {
|
public VirtacorePublicCloudLAXContextBuilder(Properties props) {
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addContextModule(List<Module> modules) {
|
protected void addContextModule(List<Module> modules) {
|
||||||
modules.add(new VirtacoreVCloudExpressComputeServiceContextModule());
|
modules.add(new VirtacorePublicCloudLAXComputeServiceContextModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addClientModule(List<Module> modules) {
|
protected void addClientModule(List<Module> modules) {
|
||||||
modules.add(new VirtacoreVCloudExpressRestClientModule());
|
modules.add(new VirtacorePublicCloudLAXRestClientModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -16,10 +16,12 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress;
|
package org.jclouds.virtacore.publiccloud;
|
||||||
|
|
||||||
|
import static org.jclouds.Constants.PROPERTY_BUILD_VERSION;
|
||||||
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
||||||
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
|
||||||
|
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_CATALOG;
|
||||||
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK;
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -30,17 +32,19 @@ import org.jclouds.vcloud.VCloudPropertiesBuilder;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class VirtacoreVCloudExpressPropertiesBuilder extends VCloudPropertiesBuilder {
|
public class VirtacorePublicCloudLAXPropertiesBuilder extends VCloudPropertiesBuilder {
|
||||||
@Override
|
@Override
|
||||||
protected Properties defaultProperties() {
|
protected Properties defaultProperties() {
|
||||||
Properties properties = super.defaultProperties();
|
Properties properties = super.defaultProperties();
|
||||||
properties.setProperty(PROPERTY_ISO3166_CODES, "US-VA,US-CA");
|
properties.setProperty(PROPERTY_ISO3166_CODES, "US-CA");
|
||||||
properties.setProperty(PROPERTY_ENDPOINT, "https://vcloud.virtacore.com/api");
|
properties.setProperty(PROPERTY_ENDPOINT, "https://cloud.lax.virtacore.com/api");
|
||||||
|
properties.setProperty(PROPERTY_BUILD_VERSION, "1.5.0.464915");
|
||||||
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, ".*-Public");
|
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, ".*-Public");
|
||||||
|
properties.setProperty(PROPERTY_VCLOUD_DEFAULT_CATALOG, "Virtacore Templates - .*");
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VirtacoreVCloudExpressPropertiesBuilder(Properties properties) {
|
public VirtacorePublicCloudLAXPropertiesBuilder(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress;
|
package org.jclouds.virtacore.publiccloud;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
|
@ -27,18 +27,18 @@ import org.jclouds.providers.BaseProviderMetadata;
|
||||||
import org.jclouds.providers.ProviderMetadata;
|
import org.jclouds.providers.ProviderMetadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Virtacore vCloud Express
|
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Virtacore Public Cloud LAX
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class VirtacoreVCloudExpressProviderMetadata extends BaseProviderMetadata {
|
public class VirtacorePublicCloudLAXProviderMetadata extends BaseProviderMetadata {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return "virtacore-vcloudexpress";
|
return "virtacore-publiccloud-lax";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +54,7 @@ public class VirtacoreVCloudExpressProviderMetadata extends BaseProviderMetadata
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Virtacore vCloud Express";
|
return "Virtacore Public Cloud LAX";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +94,7 @@ public class VirtacoreVCloudExpressProviderMetadata extends BaseProviderMetadata
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public URI getApiDocumentation() {
|
public URI getApiDocumentation() {
|
||||||
return URI.create("http://kb.virtacore.com/categories/vCloud+Express/");
|
return URI.create("http://kb.virtacore.com/questions/100/Does+the+Virtacore+Public+Cloud+have+an+API%3F");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,7 +102,7 @@ public class VirtacoreVCloudExpressProviderMetadata extends BaseProviderMetadata
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getLinkedServices() {
|
public Set<String> getLinkedServices() {
|
||||||
return ImmutableSet.of("virtacore-vcloudexpress");
|
return ImmutableSet.of("virtacore-publiccloud-lax", "virtacore-publiccloud-iad");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +110,7 @@ public class VirtacoreVCloudExpressProviderMetadata extends BaseProviderMetadata
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getIso3166Codes() {
|
public Set<String> getIso3166Codes() {
|
||||||
return ImmutableSet.of("US-VA","US-CA");
|
return ImmutableSet.of("US-CA");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -16,8 +16,11 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress.config;
|
package org.jclouds.virtacore.publiccloud.config;
|
||||||
|
|
||||||
|
import static org.jclouds.compute.domain.OsFamily.RHEL;
|
||||||
|
|
||||||
|
import org.jclouds.compute.domain.TemplateBuilder;
|
||||||
import org.jclouds.compute.options.TemplateOptions;
|
import org.jclouds.compute.options.TemplateOptions;
|
||||||
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
|
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
|
||||||
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
|
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
|
||||||
|
@ -29,7 +32,13 @@ import com.google.inject.Injector;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class VirtacoreVCloudExpressComputeServiceContextModule extends VCloudComputeServiceContextModule {
|
public class VirtacorePublicCloudLAXComputeServiceContextModule extends VCloudComputeServiceContextModule {
|
||||||
|
|
||||||
|
// CIM ostype does not include version info
|
||||||
|
@Override
|
||||||
|
protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
|
||||||
|
return template.osFamily(RHEL).os64Bit(true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) {
|
protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) {
|
|
@ -16,13 +16,11 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress.config;
|
package org.jclouds.virtacore.publiccloud.config;
|
||||||
|
|
||||||
import org.jclouds.http.RequiresHttp;
|
import org.jclouds.http.RequiresHttp;
|
||||||
import org.jclouds.rest.ConfiguresRestClient;
|
import org.jclouds.rest.ConfiguresRestClient;
|
||||||
import org.jclouds.vcloud.config.VCloudRestClientModule;
|
import org.jclouds.vcloud.config.VCloudRestClientModule;
|
||||||
import org.jclouds.vcloud.filters.SetVCloudTokenCookie;
|
|
||||||
import org.jclouds.virtacore.vcloudexpress.filters.SetVCloudTokenCookieAndAuthorizationHeader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -30,12 +28,11 @@ import org.jclouds.virtacore.vcloudexpress.filters.SetVCloudTokenCookieAndAuthor
|
||||||
*/
|
*/
|
||||||
@RequiresHttp
|
@RequiresHttp
|
||||||
@ConfiguresRestClient
|
@ConfiguresRestClient
|
||||||
public class VirtacoreVCloudExpressRestClientModule extends VCloudRestClientModule {
|
public class VirtacorePublicCloudLAXRestClientModule extends VCloudRestClientModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
super.configure();
|
super.configure();
|
||||||
bind(SetVCloudTokenCookie.class).to(SetVCloudTokenCookieAndAuthorizationHeader.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
org.jclouds.virtacore.publiccloud.VirtacorePublicCloudLAXProviderMetadata
|
|
@ -16,21 +16,21 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress;
|
package org.jclouds.virtacore.publiccloud;
|
||||||
|
|
||||||
import org.jclouds.providers.BaseProviderMetadataTest;
|
import org.jclouds.providers.BaseProviderMetadataTest;
|
||||||
import org.jclouds.providers.ProviderMetadata;
|
import org.jclouds.providers.ProviderMetadata;
|
||||||
import org.jclouds.virtacore.vcloudexpress.VirtacoreVCloudExpressProviderMetadata;
|
import org.jclouds.virtacore.publiccloud.VirtacorePublicCloudLAXProviderMetadata;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "unit", testName = "VirtacoreVCloudExpressProviderTest")
|
@Test(groups = "unit", testName = "VirtacorePublicCloudLAXProviderTest")
|
||||||
public class VirtacoreVCloudExpressProviderTest extends BaseProviderMetadataTest {
|
public class VirtacorePublicCloudLAXProviderTest extends BaseProviderMetadataTest {
|
||||||
|
|
||||||
public VirtacoreVCloudExpressProviderTest() {
|
public VirtacorePublicCloudLAXProviderTest() {
|
||||||
super(new VirtacoreVCloudExpressProviderMetadata(), ProviderMetadata.COMPUTE_TYPE);
|
super(new VirtacorePublicCloudLAXProviderMetadata(), ProviderMetadata.COMPUTE_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress.compute;
|
package org.jclouds.virtacore.publiccloud.compute;
|
||||||
|
|
||||||
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -27,14 +27,9 @@ import org.testng.annotations.Test;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "live", enabled = true, singleThreaded = true)
|
@Test(groups = "live", enabled = true, singleThreaded = true)
|
||||||
public class VirtacoreVCloudExpressComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
public class VirtacorePublicCloudLAXComputeServiceLiveTest extends VCloudComputeServiceLiveTest {
|
||||||
public VirtacoreVCloudExpressComputeServiceLiveTest() {
|
public VirtacorePublicCloudLAXComputeServiceLiveTest() {
|
||||||
provider = "virtacore-vcloudexpress";
|
provider = "virtacore-publiccloud-lax";
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServiceDefaults() {
|
|
||||||
group = "director";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.jclouds.virtacore.vcloudexpress.compute;
|
package org.jclouds.virtacore.publiccloud.compute;
|
||||||
|
|
||||||
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
|
import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
@ -31,6 +31,7 @@ import org.jclouds.compute.domain.Template;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,42 +39,45 @@ import com.google.common.collect.ImmutableSet;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "live")
|
@Test(groups = "live")
|
||||||
public class VirtacoreVCloudExpressTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
|
public class VirtacorePublicCloudLAXTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
|
||||||
|
|
||||||
public VirtacoreVCloudExpressTemplateBuilderLiveTest() {
|
public VirtacorePublicCloudLAXTemplateBuilderLiveTest() {
|
||||||
provider = "virtacore-vcloudexpress";
|
provider = "virtacore-publiccloud-lax";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
|
protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
|
||||||
return new Predicate<OsFamilyVersion64Bit>() {
|
return Predicates.not(new Predicate<OsFamilyVersion64Bit>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(OsFamilyVersion64Bit input) {
|
public boolean apply(OsFamilyVersion64Bit input) {
|
||||||
switch (input.family) {
|
switch (input.family) {
|
||||||
case UBUNTU:
|
case RHEL:
|
||||||
return !input.version.equals("");
|
return input.version.equals("");
|
||||||
case RHEL:
|
case SUSE:
|
||||||
return !input.version.equals("");
|
// vCloud Connector
|
||||||
default:
|
return input.version.equals("") && input.is64Bit;
|
||||||
return true;
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: almost all virtacore templates are dual-network
|
||||||
@Override
|
@Override
|
||||||
public void testDefaultTemplateBuilder() throws IOException {
|
public void testDefaultTemplateBuilder() throws IOException {
|
||||||
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
||||||
|
assertEquals(defaultTemplate.getImage().getName(), "RHEL 5.6 64bit");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "");
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.RHEL);
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
assertEquals(getCores(defaultTemplate.getHardware()), 2.0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Set<String> getIso3166Codes() {
|
protected Set<String> getIso3166Codes() {
|
||||||
return ImmutableSet.<String> of("US-VA", "US-CA");
|
return ImmutableSet.<String> of("US-CA");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,53 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
|
||||||
* contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. jclouds licenses this file
|
|
||||||
* to you 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 org.jclouds.virtacore.vcloudexpress.filters;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Provider;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
import org.jclouds.http.HttpException;
|
|
||||||
import org.jclouds.http.HttpRequest;
|
|
||||||
import org.jclouds.http.utils.ModifyRequest;
|
|
||||||
import org.jclouds.vcloud.VCloudToken;
|
|
||||||
import org.jclouds.vcloud.filters.SetVCloudTokenCookie;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the VCloud Token to the request as a cookie
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Singleton
|
|
||||||
public class SetVCloudTokenCookieAndAuthorizationHeader extends SetVCloudTokenCookie {
|
|
||||||
|
|
||||||
private final Provider<String> vcloudTokenProvider;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public SetVCloudTokenCookieAndAuthorizationHeader(@VCloudToken Provider<String> authTokenProvider) {
|
|
||||||
super(authTokenProvider);
|
|
||||||
this.vcloudTokenProvider = authTokenProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequest filter(HttpRequest request) throws HttpException {
|
|
||||||
return ModifyRequest.replaceHeader(super.filter(request), "x-vcloud-authorization", vcloudTokenProvider.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
org.jclouds.virtacore.vcloudexpress.VirtacoreVCloudExpressProviderMetadata
|
|
Loading…
Reference in New Issue