Skip to content

Assiging next free IP: Invalid request key id3 #24

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

Open
eoinosulli opened this issue Dec 18, 2018 · 2 comments
Open

Assiging next free IP: Invalid request key id3 #24

eoinosulli opened this issue Dec 18, 2018 · 2 comments

Comments

@eoinosulli
Copy link

Hi,

I have just recently started using the php-api client and am trying to get upto speed with how to use it. I am having trouble assigning the next free IP address in a subnet along with properties and values, ie.. hostname, owner, tag, etc..

The call I am executing is as follows :
$API->execute ("POST", "addresses", array("first_free", 3), array("hostname"=>"api.client.hostname", "description"=>"created by API client" , "owner"=>"API_Client", "tag"=>3), $token_file);

From my understanding of the client, this is how it should be accomplished, however, I am returned the error which clearly indicates I am wrong 😆
Array ( [code] => 400 [success] => 0 [message] => Invalid request key id3 [time] => 0.025 )

Just looking for some help as to what I am doing wrong?
Any help would be appreciated.
Cheers!

@Neurozone
Copy link

I'm not the developper, but the 3 must be an id of an existing subnet in you ipam

@eoinosulli
Copy link
Author

Cheers for the update.
I actually found the issue and it turned out to be an issue with the POST functionality of the client itself.
The curl_set_params function wasn't properly pushing the params to the server for POST requests.

Once I updated the function to use CURLOPT_POSTFIELDS in cases of POST, then it worked no bother.

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

2 participants