Reply

GET Method to find if an IP exists on infoblox

New Member
Posts: 1
3160     0

Hi all,

 

    I am tyring to use curl to connect to infoblox, I use GET method to check if the ipaddres exists. The below command i am trying to use and no response from the command. any help highly appreciated.

 

curl -s -k -o result.json -x  GET --user <usernameSmiley Tongueassword> "https://192.1.1.1/wapi/v2.6/fixedaddress?ipvdaddr=10.10.10.1&_return_as_object=1

 

I changed the ipaddress search to hostname search

 

curl -k -s -H 'content: application/json' -x  GET --user <usernameSmiley Tongueassword> "https://192.1.1.1/wapi/v2.6/record:a?name=<fqdn of the server>&_return_as_object=1

 

is the above syntax is correct as both of them did not help.

 

Thanks

 

Raj

Re: GET Method to find if an IP exists on infoblox

Moderator
Moderator
Posts: 321
3160     0

If there is a network to contain it, the IP address always exists.

 

I think the more importanty question is: are there any records using the IP address?

 

Use the "ipv4address" object type, to return the IP address and any objects (records using that IP address.

 

curl -k1 -u admin:infoblox -X GET 'https://192.1.1.1/wapi/v2.6/ipv4address?ip_address=10.10.10.1&_return_as_object=1' 

 

Re: GET Method to find if an IP exists on infoblox

[ Edited ]
New Member
Posts: 2
3160     0

Hi Raj,

It seems there are some issues in your curl commands:

  1. Use -X instead of -x to specify the HTTP request method.
  2. Remove the extra space before "GET" in the first command.
  3. Replace placeholders <username>:<password> and <fqdn of the server> with your actual credentials and server information.

You can follow these commands:

For IP address check:

curl -s -k -o result.json -X GET --user <username>:<password> "https://192.1.1.1/wapi/v2.6/fixedaddress?ipv4addr=10.10.10.1&_return_as_object=1"

For hostname check:

curl -k -s -H 'content: application/json' -X GET --user <username>:<password> "https://192.1.1.1/wapi/v2.6/record:a?name=<fqdn of the server>&_return_as_object=1"

For more information, You can check this:

 https://docs.devopsinfoblox.com/space/NAG8/22250875

I hope this will help you.

Regards
Prisha Singh
Showing results for 
Search instead for 
Did you mean: 

Recommended for You