Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Reply
Highlighted

[Solved] Error in updating DNS records via curl command

[ Edited ]
Techie
Posts: 3
1776     0

Hi Guys, I'm new in using Infoblox and learning it a little bit.

 

I deployed an Infoblox appliance in Azure for our POC and try to automate some job to modify a host entry in the DNS using cUrl.

 

The command that I ran successfully to fetch the host record is this:

 

curl -k -u admin:mypassword -X GET "https://10.0.3.4/wapi/v2.6/record:host?_return_as_object=1"

 

And the return output is:

 

{
"result": [
{
"_ref": "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmxvY2FsZG9tYWluLnN2dGVzdHZt:svtestvm.localdomain/default",
"ipv4addrs": [
{
"_ref": "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQubG9jYWxkb21haW4uc3Z0ZXN0dm0uMTAuMC4wLjUu:10.0.0.5/svtestvm.local
domain/default",
"configure_for_dhcp": false,
"host": "svtestvm.localdomain",
"ipv4addr": "10.0.0.5"
}
],
"name": "svtestvm.localdomain",
"view": "default"
}
]
}

 

However when I tried to change the host entry using this command

 

curl -k -u admin:mypassword -H 'content-type:application/json' -X PUT "https://10.0.3.4/wapi/v2.6/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmxvY2FsZG9tYWluLnN2dGVzdHZt:svtestvm..." -d '{"name":"svtestvm1.localdomain"}'

 

I got this error:

 

{ "Error": "AdmConProtoError: When sending FORM arguments no URI arguments can be set (FORM arguments: {\"'{name:svtestvm1.localdomain}'\": ['']} URI
arguments: {'_return_fields+': ['name'], '_return_as_object': ['1']}), please pass all the arguments as FORM arguments.",
"code": "Client.Ibap.Proto",
"text": "When sending FORM arguments no URI arguments can be set (FORM arguments: {\"'{name:svtestvm1.localdomain}'\": ['']} URI arguments: {'_retu
rn_fields+': ['name'], '_return_as_object': ['1']}), please pass all the arguments as FORM arguments."
}

 

I hope someone could help me to solve it. Thanks in advance.

Highlighted

Re: Error in updating DNS records via curl command

Techie
Posts: 3
1777     0

Hi Guys,

 

I made it to work finally. Smiley Happy

 

Here is the working cUrl command.

 

curl -v -trace-ascii -k -u admin:mypassword -H "content-type: application/json" -X PUT "https://10.0.3.4/wapi/v2.6/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmxvY2FsZG9tYWluLnN2dGVzdHZtMQ:svtest..." -d "{\"name\":\"svtestvm.localdomain\"}"

Highlighted

Re: Error in updating DNS records via curl command

Community Manager
Community Manager
Posts: 356
1777     0

To help with your ongoing efforts relating to the WAPI, you might find the Infoblox REST API Guide handy:

 

https://www.infoblox.com/wp-content/uploads/infoblox-deployment-infoblox-rest-api.pdf

 

This guide includes usage guidelines and examples for many different types of operations.

 

Best regards,

Tony

Highlighted

Re: Error in updating DNS records via curl command

Techie
Posts: 3
1777     0

Hi Tony,

 

Yes, it was a good reference and I used it. However some Curl formatting is not accepted in Windows so need to do some mix and match. Thank you for your support.

 

Regards,

 

Ruel

Showing results for 
Search instead for 
Do you mean 

Recommended for You