Skip to content

Create Floating IP formart #302

Description

@wgjr

Good morning,
I'm having trouble using createFloatingIp.

Following the source code and documentation, I came to the following
Docs: https://docs.openstack.org/api-ref/network/v2/?expanded=create-floating-ip-detail

         $options = [
             'tenant_id' => '2xxxxxxxxxxxxxxxxxxx',
             'floatingNetworkId' => 'exxx-zxxx-xxxx-xxxxx'
         ];

         $ networking = $OpenStack->networkingV2ExtLayer3()->createFloatingIp($options);

I get the following feedback:
The remote server returned a "400 Bad Request" error for the following transaction:

	Request
	~~~~~~~
	POST /v2.0/floatingips HTTP/1.1
	User-Agent: GuzzleHttp/6.5.1 curl/7.64.1 PHP/7.3.11
	Content-Type: application/json
	Host: xxxxxxx.com:13696

	{"floatingip":{"floating_network_id":"exxxx-xxxx-xxxxx-9xx7-xxxxxxx"}}

	Response
	~~~~~~~~
	HTTP/1.1 400 Bad Request
	Content-Type: application/json
	Content-Length: 170
	X-Openstack-Request-Id: req-exxxx-xxxx-xxxx-xxxx-xxx2xxxx3x
	Date: Thu, 02 Apr 2020 13:09:53 GMT

	Further information
	~~~~~~~~~~~~~~~~~~~
	Please ensure that your input values are valid and well-formed. Visit
	http://docs.php-opencloud.com/en/latest/http-codes for more information about debugging HTTP status codes, or
	file a support issue on https://github.com/php-opencloud/openstack/issues.

 
Can someone help me? How far I found this route is not in the documentation.

Activity

  1. ntorga commented on Apr 2, 2020

    @ntorga

    "400 Bad Request" when creating floating IP addresses has 4 possible explanations as explained on the documentation:

    As long as your networks are correctly configured, you are likely trying to create a floating IP inside a private network. I would recommend list all networks via "https://docs.openstack.org/api-ref/network/v2/?expanded=#list-networks" and check the "router:external" prop.

  2. haphan commented on Apr 3, 2020

    @haphan
    Collaborator

    Hi, @ntorga good point. I just want to add that you would typically need to specify fixedIpAddress or portId.

    A full example can be seen here in our floatingIps integration test which tests the complete flow from creating an external Network to assigning floating IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions