Null during get Fixed IP with OpenStack4j

asked 2014-09-08 22:22:37 -0600

anhdenday gravatar image

updated 2015-08-03 18:19:30 -0600

smaffulli gravatar image

Dear All,

I want to get fixed IP from Openstack4J, I make a main method as below to test

public static void main(String[] args) {

     OSClient osClient= OSFactory.builder().endpoint(enpoint).credentials("keystoneUsername", "keystonePasswd").tenantName("Tenant").authenticate();
            List<String> pools = osClient.compute().floatingIps().getPoolNames();
            for (String str: pools){
                FloatingIP ip = osClient.compute().floatingIps().allocateIP(str);
                System.out.println("Pool name is: " + ip.getPool());
                System.out.println("Fixed_IP: "+ ip.getFixedIpAddress());
                System.out.println("Floating_IP: "+ ip.getFloatingIpAddress());

The result is:

Pool name is: public
Fixed_IP: null
Pool name is: testNetwork
Fixed_IP: null

I dont know why Fixed_IP is null. But if i call create instance with fixed_ip it's work and i check in my dashboard "IP Address" field, it's have an ip address. I dont know why:( Please help me to check it

edit retag flag offensive close merge delete