diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java index 5a5c8a3b7b..4a22f9d19c 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/domain/ServerDetails.java @@ -42,9 +42,9 @@ public class ServerDetails extends Server { private String description; private String templateName; private int cpuCores; - private int memorySize; - private int diskSize; - private int transfer; + private int memorySizeMB; + private int diskSizeGB; + private int transferGB; private Cost cost; private List ips; @@ -63,18 +63,18 @@ public class ServerDetails extends Server { return this; } - public Builder memorySize(int memorySize) { - this.memorySize = memorySize; + public Builder memorySizeMB(int memorySizeMB) { + this.memorySizeMB = memorySizeMB; return this; } - public Builder diskSize(int diskSize) { - this.diskSize = diskSize; + public Builder diskSizeGB(int diskSizeGB) { + this.diskSizeGB = diskSizeGB; return this; } - public Builder transfer(int transfer) { - this.transfer = transfer; + public Builder transferGB(int transferGB) { + this.transferGB = transferGB; return this; } @@ -93,12 +93,12 @@ public class ServerDetails extends Server { } public ServerDetails build() { - return new ServerDetails(id, hostname, datacenter, platform, templateName, description, cpuCores, memorySize, diskSize, transfer, cost, ips); + return new ServerDetails(id, hostname, datacenter, platform, templateName, description, cpuCores, memorySizeMB, diskSizeGB, transferGB, cost, ips); } public Builder fromServerDetails(ServerDetails in) { - return fromServer(in).templateName(in.getTemplateName()).memorySize(in.getMemorySizeMB()).diskSize(in.getDiskSizeGB()).cpuCores(in.getCpuCores()).cost(in.getCost()) - .description(in.getDescription()).ips(in.getIps()); + return fromServer(in).templateName(in.getTemplateName()).memorySizeMB(in.getMemorySizeMB()).diskSizeGB(in.getDiskSizeGB()).cpuCores(in.getCpuCores()).cost(in.getCost()) + .transferGB(in.getTransferGB()).description(in.getDescription()).ips(in.getIps()); } @Override @@ -133,23 +133,24 @@ public class ServerDetails extends Server { @SerializedName("cpucores") private final int cpuCores; @SerializedName("memorysize") - private final int memorySize; + private final int memorySizeMB; @SerializedName("disksize") - private final int diskSize; - private final int transfer; + private final int diskSizeGB; + @SerializedName("transfer") + private final int transferGB; private final Cost cost; @SerializedName("iplist") private final List ips; public ServerDetails(String id, String hostname, String datacenter, String platform, String templateName, - String description, int cpuCores, int memorySize, int diskSize, int transfer, Cost cost, List ips) { + String description, int cpuCores, int memorySizeMB, int diskSizeGB, int transferGB, Cost cost, List ips) { super(id, hostname, datacenter, platform); this.templateName = checkNotNull(templateName, "template"); this.description = description; this.cpuCores = cpuCores; - this.memorySize = memorySize; - this.diskSize = diskSize; - this.transfer = transfer; + this.memorySizeMB = memorySizeMB; + this.diskSizeGB = diskSizeGB; + this.transferGB = transferGB; this.cost = checkNotNull(cost, "cost"); this.ips = ips == null ? ImmutableList.of() : ips; } @@ -172,21 +173,21 @@ public class ServerDetails extends Server { * @return the disk of the server in GB */ public int getDiskSizeGB() { - return diskSize; + return diskSizeGB; } /** * @return the memory of the server in MB */ public int getMemorySizeMB() { - return memorySize; + return memorySizeMB; } /** * @return the transfer of the server */ public int getTransferGB() { - return transfer; + return transferGB; } /** @@ -213,8 +214,8 @@ public class ServerDetails extends Server { @Override public String toString() { return String.format( - "[id=%s, hostname=%s, datacenter=%s, platform=%s, templateName=%s, description=%s, cpuCores=%d, memorySize=%d, diskSize=%d, transfer=%d, cost=%s, ips=%s]", id, - hostname, datacenter, platform, templateName, description, cpuCores, memorySize, diskSize, transfer, cost, ips); + "[id=%s, hostname=%s, datacenter=%s, platform=%s, templateName=%s, description=%s, cpuCores=%d, memorySizeMB=%d, diskSizeGB=%d, transferGB=%d, cost=%s, ips=%s]", id, + hostname, datacenter, platform, templateName, description, cpuCores, memorySizeMB, diskSizeGB, transferGB, cost, ips); } } diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/CloneServerOptions.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/CloneServerOptions.java index 4f5956c9bf..07f423a538 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/CloneServerOptions.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/CloneServerOptions.java @@ -24,31 +24,31 @@ package org.jclouds.glesys.options; public class CloneServerOptions extends EditServerOptions { public static class Builder { /** - * @see org.jclouds.glesys.options.CloneServerOptions#disksize + * @see org.jclouds.glesys.options.CloneServerOptions#diskSizeGB */ - public static CloneServerOptions disksize(int disksize) { - return CloneServerOptions.class.cast(new CloneServerOptions().disksize(disksize)); + public static CloneServerOptions diskSizeGB(int diskSizeGB) { + return CloneServerOptions.class.cast(new CloneServerOptions().diskSizeGB(diskSizeGB)); } /** - * @see org.jclouds.glesys.options.CloneServerOptions#memorysize + * @see org.jclouds.glesys.options.CloneServerOptions#memorySizeMB */ - public static CloneServerOptions memorysize(int memorysize) { - return CloneServerOptions.class.cast(new CloneServerOptions().memorysize(memorysize)); + public static CloneServerOptions memorySizeMB(int memorySizeMB) { + return CloneServerOptions.class.cast(new CloneServerOptions().memorySizeMB(memorySizeMB)); } /** - * @see org.jclouds.glesys.options.CloneServerOptions#cpucores + * @see org.jclouds.glesys.options.CloneServerOptions#cpuCores */ public static CloneServerOptions cpucores(int cpucores) { - return CloneServerOptions.class.cast(new CloneServerOptions().cpucores(cpucores)); + return CloneServerOptions.class.cast(new CloneServerOptions().cpuCores(cpucores)); } /** - * @see org.jclouds.glesys.options.CloneServerOptions#cpucores + * @see org.jclouds.glesys.options.CloneServerOptions#transferGB */ - public static CloneServerOptions transfer(int transfer) { - return CloneServerOptions.class.cast(new CloneServerOptions().transfer(transfer)); + public static CloneServerOptions transferGB(int transferGB) { + return CloneServerOptions.class.cast(new CloneServerOptions().transferGB(transferGB)); } /** diff --git a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/EditServerOptions.java b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/EditServerOptions.java index e852124f30..3b9d4d1892 100644 --- a/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/EditServerOptions.java +++ b/sandbox-providers/glesys/src/main/java/org/jclouds/glesys/options/EditServerOptions.java @@ -28,35 +28,32 @@ public class EditServerOptions extends BaseHttpRequestOptions { public static class Builder { /** - * @see org.jclouds.glesys.options.EditServerOptions#disksize + * @see org.jclouds.glesys.options.EditServerOptions#diskSizeGB */ - public static EditServerOptions disksize(int disksize) { - EditServerOptions options = new EditServerOptions(); - return options.disksize(disksize); + public static EditServerOptions disksizeGB(int disksizeGB) { + return new EditServerOptions().diskSizeGB(disksizeGB); } /** - * @see org.jclouds.glesys.options.EditServerOptions#memorysize + * @see org.jclouds.glesys.options.EditServerOptions#memorySizeMB */ - public static EditServerOptions memorysize(int memorysize) { - EditServerOptions options = new EditServerOptions(); - return options.memorysize(memorysize); + public static EditServerOptions memorysizeMB(int memorysizeMB) { + return new EditServerOptions().memorySizeMB(memorysizeMB); } /** - * @see org.jclouds.glesys.options.EditServerOptions#cpucores + * @see org.jclouds.glesys.options.EditServerOptions#cpuCores */ public static EditServerOptions cpucores(int cpucores) { EditServerOptions options = new EditServerOptions(); - return options.cpucores(cpucores); + return options.cpuCores(cpucores); } /** - * @see org.jclouds.glesys.options.EditServerOptions#cpucores + * @see org.jclouds.glesys.options.EditServerOptions#transferGB */ - public static EditServerOptions transfer(int transfer) { - EditServerOptions options = new EditServerOptions(); - return options.transfer(transfer); + public static EditServerOptions transferGB(int transferGB) { + return new EditServerOptions().transferGB(transferGB); } /** @@ -77,26 +74,26 @@ public class EditServerOptions extends BaseHttpRequestOptions { } /** Configure the size of the disk, in GB, of the server */ - public EditServerOptions disksize(int disksize) { - formParameters.put("disksize", Integer.toString(disksize)); + public EditServerOptions diskSizeGB(int diskSizeGB) { + formParameters.put("disksize", Integer.toString(diskSizeGB)); return this; } /** Configure the amount of RAM, in MB, allocated to the server */ - public EditServerOptions memorysize(int memorysize) { - formParameters.put("memorysize", Integer.toString(memorysize)); + public EditServerOptions memorySizeMB(int memorySizeMB) { + formParameters.put("memorysize", Integer.toString(memorySizeMB)); return this; } /** Configure the number of CPU cores allocated to the server */ - public EditServerOptions cpucores(int cpucores) { + public EditServerOptions cpuCores(int cpucores) { formParameters.put("cpucores", Integer.toString(cpucores)); return this; } /** Configure the transfer setting for the server */ - public EditServerOptions transfer(int transfer) { - formParameters.put("cpucores", Integer.toString(transfer)); + public EditServerOptions transferGB(int transferGB) { + formParameters.put("transfer", Integer.toString(transferGB)); return this; } diff --git a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java index f287aabd79..79f281cee9 100644 --- a/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java +++ b/sandbox-providers/glesys/src/test/java/org/jclouds/glesys/features/ServerClientExpectTest.java @@ -156,8 +156,8 @@ public class ServerClientExpectTest extends BaseRestClientExpectTest