for (String zoneId : zones) {
ServerApi serverApi = api.getServerApiForZone(zoneId);
try {
serverId = createServer(zoneId, Server.Status.ACTIVE).getId();
Server server = serverApi.get(serverId);
assertEquals(server.getStatus(), Server.Status.ACTIVE);
RebuildServerOptions options = new RebuildServerOptions().
withImage(server.getImage().getId()).
name("newName").
adminPass("password").
ipv4Address("1.1.1.1").
ipv6Address("fe80::100");
serverApi.rebuild(serverId, options);
Server rebuiltServer = serverApi.get(serverId);
assertEquals("newName", rebuiltServer.getName());
assertEquals("1.1.1.1", rebuiltServer.getAccessIPv4());
assertEquals("fe80::100", rebuiltServer.getAccessIPv6());
} finally {
serverApi.delete(serverId);
}
}