- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
wapi: Invalid value for auto_create_reversezone: 0: Must be boolean type
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 07:40 AM - edited 08-09-2022 07:41 AM
Hi,
I'm trying to add a network via the wapi. I use perl to communicate with the wapi. When I'm trying to POST following body to "https://<url>/wapi/v2.11.3/request":
[ { "method" : "POST", "object" : "network", "data" : { "network" : "10.4.3.0/24", "auto_create_reversezone" : 0, }, } ]
I'm getting following error:
{ "Error": "AdmConProtoError: Invalid value for auto_create_reversezone: 0: Must be boolean type", "code": "Client.Ibap.Proto", "text": "Invalid value for auto_create_reversezone: 0: Must be boolean type" }
Perl do not have boolean but its not perls fault, because the data structure is anyway converted to json
Solved! Go to Solution.
Re: wapi: Invalid value for auto_create_reversezone: 0: Must be boolean type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 11:47 AM
The attribute/value pair for "auto_create_reversezone" is not required, as the default setting for this call is false, meaning it will NOT create the reverse zone automatically, by default.
But to fix this specific call, and for Infoblox REST in general, the boolean values are true or false, without surrounding quotes.
Re: wapi: Invalid value for auto_create_reversezone: 0: Must be boolean type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 06:49 AM
Hi,
thank you for the quick and helpful answer. The problem is, perl don't have boolean variables. But I use the JSON module (lib) in Perl. The module is providing a JSON->boolean(0) method, so the resulting JSON-Object is created as you mentioned in your answer with:
"auto_create_reversezone" : false,
Re: wapi: Invalid value for auto_create_reversezone: 0: Must be boolean type
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 01:35 PM - edited 08-11-2022 01:37 PM
I get around that by using JSON::true and JSON::false.
For example, creating & pushing a DNS A record:
$record{"name"} = $fqdn; $record{"ipv4addr"} = $obj->{"ipv4addr"}; $record{"view"} = $view;
if(defined
$
ttl)
{
$record{"use_ttl"} = JSON::true;
$record{"ttl"} = $ttl;
}
my $request = HTTP::Request->new(POST => "https://$ib_addr/$api/record:a");
$request->content_type('application/json');
$request->content($json->encode(\%record));
my $response = $ua->request($request);
my $msg = $response->{'_msg'};
Re: wapi: Invalid value for auto_create_reversezone: 0: Must be boolean type
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2022 03:28 AM
greats. That is a much cleaner solution! Thx