def create_floatingip(context, content):
LOG.info('<STR_LIT>' %<EOL>(id, context.tenant_id, content))<EOL>network_id = content.get('<STR_LIT>')<EOL>if not network_id:<EOL><INDENT>raise n_exc.BadRequest(resource='<STR_LIT>',<EOL>msg='<STR_LIT>')<EOL><DEDENT>fixed_ip_address = content.get('<STR_LIT>')<EOL>ip_address = content.get('<STR_LIT>')<EOL>port_id = content.get('<STR_LIT>')<EOL>port = None<EOL>port_fixed_ip = {}<EOL>network = _get_network(context, network_id)<EOL>if port_id:<EOL><INDENT>port = _get_port(context, port_id)<EOL>fixed_ip = _get_fixed_ip(context, fixed_ip_address, port)<EOL>port_fixed_ip = {port.id: {'<STR_LIT:port>': port, '<STR_LIT>': fixed_ip}}<EOL><DEDENT>flip = _allocate_ip(context, network, port, ip_address, ip_types.FLOATING)<EOL>_create_flip(context, flip, port_fixed_ip)<EOL>return v._make_floating_ip_dict(flip, port_id)<EOL>
Allocate or reallocate a floating IP.

    :param context: neutron api request context.
    :param content: dictionary describing the floating ip, with keys
        as listed in the RESOURCE_ATTRIBUTE_MAP object in
        neutron/api/v2/attributes.py.  All keys will be populated.

    :returns: Dictionary containing details for the new floating IP.  If values
        are declared in the fields parameter, then only those keys will be
        present.