mirror of https://github.com/apache/jclouds.git
glesys now returns server state in create response
This commit is contained in:
parent
73cc4a0837
commit
95935f861c
|
@ -109,7 +109,7 @@ public class ServerDetailsToNodeMetadata implements Function<ServerDetails, Node
|
|||
.processors(ImmutableList.of(new Processor(from.getCpuCores(), 1.0)))
|
||||
.volumes(ImmutableList.<Volume> of(new VolumeImpl((float) from.getDiskSizeGB(), true, true)))
|
||||
.hypervisor(from.getPlatform()).build());
|
||||
builder.state(from.getState() != null ? serverStateToNodeState.get(from.getState()) : NodeState.PENDING);
|
||||
builder.state(serverStateToNodeState.get(from.getState()));
|
||||
Iterable<String> addresses = Iterables.filter(Iterables.transform(from.getIps(), new Function<Ip, String>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,20 +68,7 @@ public class ServerDetailsToNodeMetadataTest extends BaseGleSYSComputeServiceExp
|
|||
HttpResponse
|
||||
.builder()
|
||||
.statusCode(200)
|
||||
.payload(
|
||||
payloadFromString("{\"response\":{\"status\":{\"code\":200,\"timestamp\":\"2012-02-10T11:28:50+01:00\",\"text\":\"OK\"},\"server\":{\"state\":\"running\"},\"debug\":{\"input\":{\"serverid\":\"xm3276891\",\"statustype\":\"state\"}}}}"))
|
||||
.build())
|
||||
.put(HttpRequest
|
||||
.builder()
|
||||
.method("POST")
|
||||
.endpoint(URI.create("https://api.glesys.com/server/status/format/json"))
|
||||
.headers(
|
||||
ImmutableMultimap.<String, String> builder().put("Accept", "application/json")
|
||||
.put("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build())
|
||||
.payload(
|
||||
newUrlEncodedFormPayload(ImmutableMultimap.<String, String> builder()
|
||||
.put("serverid", "xm3276891").put("statustype", "state").build())).build(),
|
||||
HttpResponse.builder().statusCode(206).payload(payloadFromResource("/server_status.json"))
|
||||
.payload(payloadFromResource("/server_details.json"))
|
||||
.build()).build()
|
||||
|
||||
).getInstance(ServerDetailsToNodeMetadata.class);
|
||||
|
|
|
@ -159,7 +159,7 @@ public class ServerClientExpectTest extends BaseRestClientExpectTest<GleSYSClien
|
|||
Cost cost = Cost.builder().amount(13.22).currency("EUR").timePeriod("month").build();
|
||||
return ServerDetails.builder().id("xm3276891").transferGB(50).hostname("glesys-s-6dd").cpuCores(1).memorySizeMB(512)
|
||||
.diskSizeGB(5).description("glesys-s-6dd").datacenter("Falkenberg").platform("Xen")
|
||||
.templateName("Ubuntu 11.04 x64").cost(cost).ips(ip).build();
|
||||
.templateName("Ubuntu 11.04 x64").state(Server.State.LOCKED).cost(cost).ips(ip).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"response":{"status":{"code":200,"timestamp":"2012-02-10T11:11:05+01:00","text":"OK"},"server":{"serverid":"xm3276891","hostname":"glesys-s-6dd","description":"glesys-s-6dd","cpucores":1,"memorysize":512,"disksize":5,"transfer":50,"templatename":"Ubuntu 11.04 x64","datacenter":"Falkenberg","managedhosting":"no","platform":"Xen","cost":{"amount":13.22,"currency":"EUR","timeperiod":"month"},"iplist":[{"ipaddress":"109.74.10.45","version":4,"cost":2,"currency":"EUR"}]},"debug":{"input":{"serverid":"xm3276891"}}}}
|
||||
{"response":{"status":{"code":200,"timestamp":"2012-02-10T11:11:05+01:00","text":"OK"},"server":{"serverid":"xm3276891","hostname":"glesys-s-6dd","description":"glesys-s-6dd","cpucores":1,"memorysize":512,"disksize":5,"transfer":50,"templatename":"Ubuntu 11.04 x64","datacenter":"Falkenberg","managedhosting":"no","platform":"Xen","cost":{"amount":13.22,"currency":"EUR","timeperiod":"month"},"iplist":[{"ipaddress":"109.74.10.45","version":4,"cost":2,"currency":"EUR"}], "state":"locked"},"debug":{"input":{"serverid":"xm3276891"}}}}
|
Loading…
Reference in New Issue