for (String zoneId : zones) {
ServerApi serverApi = api.getServerApiForZone(zoneId);
try {
serverId = createServer(zoneId, null).getId();
Server server = serverApi.get(serverId);
assertEquals(server.getStatus(), 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);
}
}