Hi, Sorry I was using the wrong API. Solved it now.
We have to use FloatingIPApi.update() method Thanks. On Mon, Nov 17, 2014 at 11:45 AM, akhil.pillai <[email protected]> wrote: > Hi Raj, > > Floating IPs can be in the following states : > 1. Unallocated : Suppose we have a pool of 10 Floating IPs and all are > unallocated. > 2. Allocated : Now when u allocate an IP . One IP is allocated and rest 9 > becomes unallocated > 3. Assigned : When u assign an allocated Floating IP to a VM it goes in > assigned state. > > Regards, > Akhil > > Sent from my Xiaomi > On Nov 17, 2014 11:23 AM, Raj <[email protected]> wrote: > > Hi, > > Say I know the floating IP and it is not assigned to any ports yet. > > How can I update the floating IP so that it will be assigned to a port? > > I tried the following, seems it is not working. > > FloatingIP selectedFloatingIP = unassignedFloatingIPs.get(0); > > updatedFloatingIP = FloatingIP.updateBuilder() > .tenantId(selectedFloatingIP.getTenantId()) > .portId(port.getNetworkId()) > > .fixedIpAddress(port.getFixedIps().iterator().next().getIpAddress()) > .floatingNetworkId(externalNetworkUuid) > > .floatingIpAddress(selectedFloatingIP.getFloatingIpAddress()) > .build(); > > Can anyone please help me? > > Thanks. > > -- > Rajkumar Rajaratnam > Committer & PMC Member, Apache Stratos > Software Engineer, WSO2 > > -- Rajkumar Rajaratnam Committer & PMC Member, Apache Stratos Software Engineer, WSO2
