- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
[Solved] Error in updating DNS records via curl command
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2018 01:23 AM - edited 10-18-2018 08:43 AM
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.
Re: Error in updating DNS records via curl command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2018 08:42 AM
Hi Guys,
I made it to work finally.
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\"}"
Re: Error in updating DNS records via curl command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2018 10:14 AM
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
Re: Error in updating DNS records via curl command
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-28-2018 11:52 PM
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