mirror of https://github.com/apache/jclouds.git
Issue 130: tune output in compute service
git-svn-id: http://jclouds.googlecode.com/svn/trunk@2646 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
2d19e33828
commit
313e56e8d6
|
@ -88,4 +88,9 @@ public class NodeIdentityImpl implements NodeIdentity {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "[id=" + id + ", name=" + name + "]";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,13 @@ public class NodeMetadataImpl extends NodeIdentityImpl implements NodeMetadata {
|
||||||
private final int loginPort;
|
private final int loginPort;
|
||||||
private final LoginType loginType;
|
private final LoginType loginType;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "[id=" + getId() + ", name=" + getName() + ", state=" + getState()
|
||||||
|
+ ", privateAddresses=" + privateAddresses + ", publicAddresses=" + publicAddresses
|
||||||
|
+ "]";
|
||||||
|
}
|
||||||
|
|
||||||
public NodeMetadataImpl(String id, String name, NodeState state,
|
public NodeMetadataImpl(String id, String name, NodeState state,
|
||||||
Iterable<InetAddress> publicAddresses, Iterable<InetAddress> privateAddresses,
|
Iterable<InetAddress> publicAddresses, Iterable<InetAddress> privateAddresses,
|
||||||
int loginPort, LoginType loginType, Map<String, String> extra) {
|
int loginPort, LoginType loginType, Map<String, String> extra) {
|
||||||
|
|
|
@ -66,9 +66,9 @@ public class TerremarkVCloudComputeService implements ComputeService {
|
||||||
|
|
||||||
private static final Map<VAppStatus, NodeState> vAppStatusToNodeState = ImmutableMap
|
private static final Map<VAppStatus, NodeState> vAppStatusToNodeState = ImmutableMap
|
||||||
.<VAppStatus, NodeState> builder().put(VAppStatus.OFF, NodeState.TERMINATED).put(
|
.<VAppStatus, NodeState> builder().put(VAppStatus.OFF, NodeState.TERMINATED).put(
|
||||||
VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED,
|
VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED, NodeState.PENDING)
|
||||||
NodeState.PENDING).put(VAppStatus.SUSPENDED, NodeState.SUSPENDED).put(
|
.put(VAppStatus.SUSPENDED, NodeState.SUSPENDED).put(VAppStatus.UNRESOLVED,
|
||||||
VAppStatus.UNRESOLVED, NodeState.PENDING).build();
|
NodeState.PENDING).build();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TerremarkVCloudComputeService(TerremarkVCloudClient tmClient,
|
public TerremarkVCloudComputeService(TerremarkVCloudClient tmClient,
|
||||||
|
@ -86,17 +86,16 @@ public class TerremarkVCloudComputeService implements ComputeService {
|
||||||
return new CreateNodeResponseImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState
|
return new CreateNodeResponseImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState
|
||||||
.get(vApp.getStatus()), ImmutableSet.<InetAddress> of(publicIp), vApp
|
.get(vApp.getStatus()), ImmutableSet.<InetAddress> of(publicIp), vApp
|
||||||
.getNetworkToAddresses().values(), 22, LoginType.SSH, new Credentials("vcloud",
|
.getNetworkToAddresses().values(), 22, LoginType.SSH, new Credentials("vcloud",
|
||||||
"p4ssw0rd"), ImmutableMap.<String,String>of());
|
"p4ssw0rd"), ImmutableMap.<String, String> of());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NodeMetadata getNodeMetadata(String id) {
|
public NodeMetadata getNodeMetadata(String id) {
|
||||||
VApp vApp = tmClient.getVApp(id);
|
VApp vApp = tmClient.getVApp(id);
|
||||||
// TODO
|
Set<InetAddress> publicAddresses = computeClient.getPublicAddresses(id);
|
||||||
Set<InetAddress> publicAddresses = ImmutableSet.<InetAddress> of();
|
|
||||||
return new NodeMetadataImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState.get(vApp
|
return new NodeMetadataImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState.get(vApp
|
||||||
.getStatus()), publicAddresses, vApp.getNetworkToAddresses().values(), 22,
|
.getStatus()), publicAddresses, vApp.getNetworkToAddresses().values(), 22,
|
||||||
LoginType.SSH, ImmutableMap.<String,String>of());
|
LoginType.SSH, ImmutableMap.<String, String> of());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue