Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Floating IP formart #302

Open
wgjr opened this issue Apr 2, 2020 · 2 comments
Open

Create Floating IP formart #302

wgjr opened this issue Apr 2, 2020 · 2 comments

Comments

@wgjr
Copy link

wgjr commented Apr 2, 2020

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.

@ntorga
Copy link

ntorga commented Apr 2, 2020

"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.

@haphan
Copy link
Collaborator

haphan commented Apr 3, 2020

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants