mirror of https://github.com/apache/jclouds.git
Merge pull request #265 from jsonking/695-Terremark
Issue 695: Small fixes and javadoc
This commit is contained in:
commit
9cc786b130
|
@ -153,6 +153,6 @@ public class Entity<T extends Entity<T>> extends Resource<T> {
|
|||
|
||||
@Override
|
||||
public String string() {
|
||||
return super.string()+", name="+name+", tasks="+tasks;
|
||||
return super.string()+", tasks="+tasks;
|
||||
}
|
||||
}
|
|
@ -125,7 +125,7 @@ public class NetworkReference extends BaseNamedResource<NetworkReference> {
|
|||
/**
|
||||
* @see NetworkReference#getIpAddresses
|
||||
*/
|
||||
public Builder gatewayAddress(IpAddresses ipAddresses) {
|
||||
public Builder ipAddresses(IpAddresses ipAddresses) {
|
||||
this.ipAddresses = ipAddresses;
|
||||
return this;
|
||||
}
|
||||
|
@ -136,7 +136,12 @@ public class NetworkReference extends BaseNamedResource<NetworkReference> {
|
|||
}
|
||||
|
||||
public Builder fromNetworkReference(NetworkReference in) {
|
||||
return fromNamedResource(in).networkType(in.getNetworkType());
|
||||
return fromNamedResource(in).address(in.getAddress())
|
||||
.networkType(in.getNetworkType())
|
||||
.broadcastAddress(in.getBroadcastAddress())
|
||||
.gatewayAddress(in.getGatewayAddress())
|
||||
.rnatAddress(in.getRnatAddress())
|
||||
.ipAddresses(in.getIpAddresses());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,6 +86,12 @@ public class NetworkSettings {
|
|||
return networkAdapterSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* DnsSettings is optional.
|
||||
* If not included, defaults to DNS for the data center.
|
||||
* PrimaryDns is required if DnsSettings is included.
|
||||
* @return
|
||||
*/
|
||||
public DnsSettings getDnsSettings() {
|
||||
return dnsSettings;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl
|
|||
|
||||
public void testCreateVirtualMachineFromTemplate() throws Exception {
|
||||
CreateVirtualMachine.Builder builder = CreateVirtualMachine.builder();
|
||||
builder.name("VirtualMachine2")
|
||||
builder.name("vmDMZ1")
|
||||
.processorCount(2)
|
||||
.memory(ResourceCapacity.builder().value(1024).unit("MB").build());
|
||||
|
||||
|
@ -119,18 +119,21 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl
|
|||
AnonymousResource sshKey = AnonymousResource.builder().href(URI.create("/cloudapi/ecloud/admin/sshkeys/77")).type("application/vnd.tmrk.cloud.admin.sshKey").build();
|
||||
|
||||
NamedResource network = NamedResource.builder()
|
||||
.href(URI.create("/cloudapi/ecloud/networks/3936"))
|
||||
.name("10.146.204.64/28")
|
||||
.href(URI.create("/cloudapi/ecloud/networks/3933"))
|
||||
.name("10.146.205.128/27")
|
||||
.type("application/vnd.tmrk.cloud.network")
|
||||
.build();
|
||||
|
||||
NetworkAdapterSetting adapterSetting = NetworkAdapterSetting.builder()
|
||||
.network(network)
|
||||
.ipAddress("10.146.204.68")
|
||||
.ipAddress("10.146.205.131")
|
||||
.build();
|
||||
|
||||
NetworkAdapterSettings adapterSettings = NetworkAdapterSettings.builder()
|
||||
.addNetworkAdapterSetting(adapterSetting).build();
|
||||
|
||||
//DNS Settings are optional - and default to the data center dns settings if custom values are not provided.
|
||||
//DnsSettings dnsSettings = DnsSettings.builder().primaryDns("10.1.1.1").secondaryDns("10.1.1.2").build();
|
||||
NetworkSettings networkSettings = NetworkSettings.builder().networkAdapterSettings(adapterSettings).build();
|
||||
|
||||
LinuxCustomization linuxCustomization = LinuxCustomization.builder()
|
||||
|
@ -145,8 +148,11 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl
|
|||
VirtualMachine vm = client.createVirtualMachineFromTemplate(URI.create("/cloudapi/ecloud/virtualMachines/computePools/89/action/createVirtualMachine"), builder.build());
|
||||
assertNotNull(vm);
|
||||
|
||||
// For ssh login - next steps are:
|
||||
// - Create an internet service for ssh (TCP port 22) on a public ip address
|
||||
// - Create a node service to bind the port to the vm itself
|
||||
// TODO: Check that the VM is created OK.
|
||||
// TODO: DNSSettings are missing
|
||||
System.out.println(vm);
|
||||
//client.remove(vm.getHref()); //remove once verified - there needs to be no running tasks.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue