- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Unable to create a host record via WAPI (1.7.1)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-12-2018 02:46 AM
Hi,
I'm trying to create a new host record. I get the following error:
"Error": "AdmConProtoError: JSON Decoding: No JSON object could be decoded",
"code": "Client.Ibap.Proto.JSONDecoding",
"text": "JSON Decoding: No JSON object could be decoded"
The method is a POST call. The content type is application/json.
URL: https://1.1.1.7/wapi/v1.7.1/record:host
Data field part of the request:
'{"name":"wtfsvr","ipv4addrs":[{"ipv4addr":"10.1.1.166","mac":"00:00:00:00:00:00"}]}'
Any help is greatly appreciated.
Re: Unable to create a host record via WAPI (1.7.1)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-13-2018 11:04 AM - edited 04-13-2018 11:05 AM
Can you share how you are useing the API call.
I just used the following and it went through:
curl --request POST --url https://testserver/wapi/v2.5/record:host --header 'authorization: Basic <authstringgoeshere.'
--header 'content-type: application/json' --data '{"name": "wtfsvr.example.com","ipv4addrs": [{"ipv4addr": "10.1.1.166","mac": "00:00:00:00:00:00"}]}'
Note that a Host object still needs a zone to be parented in (so the standalone "wtfsvr" record will not work)
Re: Unable to create a host record via WAPI (1.7.1)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-17-2018 11:17 AM
Hi,
I was using an Ansible URI call. It seems that its either the "k1" or the "-X" that is causing the failed request. Using a straight curl with a FQDN worked fine.
curl -k1 -u usernameassword -H Content-Type:application/json -X POST https://1.1.1.1/wapi/v1.7.1/record:host -d '{"ipv4addrs":[{"ipv4addr":"1.10.13.60"}],"name":"wtfsvr.example.com"
I have one more question... Is there a way I can add a description directly into the POST statement? I tried adding a "device_descritption" after the name, but that failed. I see that you can search for that field, but not sure if it can be added while adding a new host record.
Thanks!
Re: Unable to create a host record via WAPI (1.7.1)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-19-2018 02:22 PM
Thanks
Re: Unable to create a host record via WAPI (1.7.1)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2020 01:30 PM
Hi
I tried do perform the same action and
Re: Unable to create a host record via WAPI (1.7.1)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2020 01:36 PM
Hi
I tried to perform the same action but I cannot due to following messsage below so anyone has idea about the issue.
curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://dnslab/wapi/v2.9.7/record:host -d '{"ipv4addrs":[{"ipv4addr":"10.222.0.12"}],"name":"teste4.test.net"}'
{ "Error": "AdmConProtoError: JSON Decoding: No JSON object could be decoded",
"code": "Client.Ibap.Proto.JSONDecoding",
"text": "JSON Decoding: No JSON object could be decoded"
Thanks
Roberto