diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java
new file mode 100644
index 0000000000..cc4fff5b05
--- /dev/null
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerSpec.java
@@ -0,0 +1,192 @@
+/**
+ * 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.glesys.domain;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.common.base.Objects;
+
+/**
+ *
+ *
+ * @author Adrian Cole
+ */
+public class ServerSpec {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public Builder toBuilder() {
+ return Builder.fromServerSpecification(this);
+ }
+
+ public static class Builder {
+ protected String datacenter;
+ protected String platform;
+ protected String templateName;
+ protected int diskSizeGB;
+ protected int memorySizeMB;
+ protected int cpuCores;
+ protected int transfer;
+
+ public Builder datacenter(String datacenter) {
+ this.datacenter = datacenter;
+ return this;
+ }
+
+ public Builder platform(String platform) {
+ this.platform = platform;
+ return this;
+ }
+
+ public Builder templateName(String templateName) {
+ this.templateName = templateName;
+ return this;
+ }
+
+ public Builder diskSizeGB(int diskSizeGB) {
+ this.diskSizeGB = diskSizeGB;
+ return this;
+ }
+
+ public Builder memorySizeMB(int memorySizeMB) {
+ this.memorySizeMB = memorySizeMB;
+ return this;
+ }
+
+ public Builder cpuCores(int cpuCores) {
+ this.cpuCores = cpuCores;
+ return this;
+ }
+
+ public Builder transfer(int transfer) {
+ this.transfer = transfer;
+ return this;
+ }
+
+ public ServerSpec build() {
+ return new ServerSpec(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transfer);
+ }
+
+ public static Builder fromServerSpecification(ServerSpec in) {
+ return new Builder().platform(in.getPlatform()).datacenter(in.getDatacenter())
+ .memorySizeMB(in.getMemorySizeMB()).diskSizeGB(in.getDiskSizeGB()).templateName(in.getTemplateName())
+ .cpuCores(in.getCpuCores()).transfer(in.getTransfer());
+ }
+ }
+
+ protected final String platform;
+ protected final String datacenter;
+ protected final int memorySizeMB;
+ protected final int diskSizeGB;
+ protected final String templateName;
+ protected final int cpuCores;
+ protected final int transfer;
+
+ protected ServerSpec(String platform, String datacenter, int memorySizeMB, int diskSizeGB, String templateName,
+ int cpuCores, int transfer) {
+ this.platform = checkNotNull(platform, "platform");
+ this.datacenter = checkNotNull(datacenter, "datacenter");
+ this.memorySizeMB = memorySizeMB;
+ this.diskSizeGB = diskSizeGB;
+ this.templateName = checkNotNull(templateName, "templateName");
+ this.cpuCores = cpuCores;
+ this.transfer = transfer;
+ }
+
+ /**
+ * @return the data center to create the new server in
+ */
+ public String getDatacenter() {
+ return datacenter;
+ }
+
+ /**
+ * @return the platform to use (i.e. "Xen" or "OpenVZ")
+ */
+ public String getPlatform() {
+ return platform;
+ }
+
+ /**
+ * @return the os template to use to create the new server
+ */
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ /**
+ * @return the amount of disk space, in GB, to allocate
+ */
+ public int getDiskSizeGB() {
+ return diskSizeGB;
+ }
+
+ /**
+ * @return the memory, in MB, to allocate
+ */
+ public int getMemorySizeMB() {
+ return memorySizeMB;
+ }
+
+ /**
+ * @return the number of CPU cores to allocate
+ */
+ public int getCpuCores() {
+ return cpuCores;
+ }
+
+ /**
+ * @return number of transfer
+ */
+ public int getTransfer() {
+ return transfer;
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+ if (object instanceof ServerSpec) {
+ final ServerSpec that = ServerSpec.class.cast(object);
+ return equal(platform, that.platform) && equal(datacenter, that.datacenter)
+ && equal(memorySizeMB, that.memorySizeMB) && equal(diskSizeGB, that.diskSizeGB)
+ && equal(templateName, that.templateName) && equal(cpuCores, that.cpuCores)
+ && equal(transfer, that.transfer);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(platform, datacenter, memorySizeMB, diskSizeGB, templateName, cpuCores, transfer);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper("").add("platform", platform).add("datacenter", datacenter)
+ .add("templateName", templateName).add("cpuCores", cpuCores).add("cpuCores", cpuCores)
+ .add("diskSizeGB", diskSizeGB).add("transfer", transfer).toString();
+ }
+}
diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
index 56b22c8383..41fdaf4b0a 100644
--- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
+++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/features/ServerAsyncClient.java
@@ -29,11 +29,12 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
+import org.jclouds.glesys.domain.AllowedArgumentsForCreateServer;
import org.jclouds.glesys.domain.Console;
import org.jclouds.glesys.domain.Server;
-import org.jclouds.glesys.domain.AllowedArgumentsForCreateServer;
import org.jclouds.glesys.domain.ServerDetails;
import org.jclouds.glesys.domain.ServerLimit;
+import org.jclouds.glesys.domain.ServerSpec;
import org.jclouds.glesys.domain.ServerStatus;
import org.jclouds.glesys.domain.Template;
import org.jclouds.glesys.functions.ParseTemplatesFromHttpResponse;
@@ -45,6 +46,8 @@ import org.jclouds.glesys.options.ServerStatusOptions;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.PayloadParam;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.annotations.SelectJson;
@@ -56,7 +59,7 @@ import com.google.common.util.concurrent.ListenableFuture;
/**
* Provides asynchronous access to Server via their REST API.
*
- *
+ *
* @author Adrian Cole
* @author Adam Lowe
* @see ServerClient
@@ -105,7 +108,6 @@ public interface ServerAsyncClient {
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture> getServerLimits(@FormParam("serverid") String id);
-
/**
* @see ServerClient#getConsole
*/
@@ -116,7 +118,6 @@ public interface ServerAsyncClient {
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture getConsole(@FormParam("serverid") String id);
-
/**
* @see ServerClient#getAllowedArgumentsForCreateServerByPlatform
*/
@@ -125,7 +126,7 @@ public interface ServerAsyncClient {
@SelectJson("argumentslist")
@Consumes(MediaType.APPLICATION_JSON)
ListenableFuture