I am currently creating OpenStack virtual machines programmatically using OpenStack API. I need to associate floating IP(s) to the server(s) created. The API documentation on this is not clear to me. The compute API says it is deprecated, though I tried to use it, but I am not sure how to correctly use it. There is no API to first create the floating IP - using the compute API for floating IP. I have also tried using the Neutron networking API for floating IP, also this does not show how to associate the floating IP to a new server. It is asking for a port id, and the response of the create server API does not return a port id, neither does it return an IP address.
Could someone please direct me on this?