diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/functions/MapToServerInfo.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/functions/MapToServerInfo.java index 7637f746d9..26affbe3a3 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/functions/MapToServerInfo.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/functions/MapToServerInfo.java @@ -36,20 +36,22 @@ import org.jclouds.elasticstack.domain.VNC; import com.google.common.base.Function; import com.google.common.base.Splitter; import com.google.common.collect.Maps; +import org.jclouds.rest.annotations.ApiVersion; /** - * * @author Adrian Cole */ @Singleton public class MapToServerInfo implements Function, ServerInfo> { + private String apiVersion; private final Function, Map> mapToDevices; private final Function, ServerMetrics> mapToMetrics; private final Function, List> mapToNICs; @Inject public MapToServerInfo(Function, Map> mapToDevices, - Function, ServerMetrics> mapToMetrics, Function, List> mapToNICs) { + Function, ServerMetrics> mapToMetrics, Function, List> mapToNICs) { + this.apiVersion = apiVersion; this.mapToDevices = mapToDevices; this.mapToMetrics = mapToMetrics; this.mapToNICs = mapToNICs; @@ -67,8 +69,12 @@ public class MapToServerInfo implements Function, ServerInfo if (from.containsKey("status")) builder.status(ServerStatus.fromValue(from.get("status"))); - if (from.containsKey("smp") && !"auto".equals(from.get("smp"))) - builder.smp(new Integer(from.get("smp"))); + + if (from.containsKey("smp:cores")) { + builder.smp(new Integer(from.get("smp:cores"))); + } else if (from.containsKey("smp") && !"auto".equals(from.get("smp"))) { + builder.smp(new Integer(from.get("smp"))); + } builder.cpu(Integer.parseInt(from.get("cpu"))); builder.mem(Integer.parseInt(from.get("mem")));