- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Create host record in non-default zone
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 08:59 AM
Hi all,
I'm trying to create internal host records via api using this endpoint:
Invoke-RestMethod -Method Post -Uri "https://infoblox.mycompany.com/wapi/v2.5/record:host" -ContentType 'application/json' -Body $JSONBody -Credential $mycreds
When i add a record using default zone, it works fine. example:
$JSONBody = @"
{
"ipv4addrs": [
{
"ipv4addr": "10.4.2.1"
}
],
"name": "myServer.mycompany.com",
}
"@
But when i try to add a record in a different zone (a zone we do already have configured), it gives me a 400 error. I've tried the following bodys, all giving me the same 400 error.
$JSONBody = @"
{
"ipv4addrs": [
{
"ipv4addr": "10.1.3.1"
}
],
"name": "myServer.myothercompany.com",
"view": "default",
"zone": "myothercompany.com"
}
"@
$JSONBody = @"
{
"ipv4addrs": [
{
"ipv4addr": "10.1.3.1"
}
],
"name": "myServer.myothercompany.com",
"zone": "myothercompany.com"
}
$JSONBody = @"
{
"ipv4addrs": [
{
"ipv4addr": "10.1.3.1"
}
],
"name": "myServer.myothercompany.com",
"view": "Internal",
"zone": "myothercompany.com"
}
and a few more intuitive post bodies...
Help! Been stumbling through this for 4 hours now. Thank you
Re: Create host record in non-default zone
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 10:16 PM
Hi,
Could you please try the following JSON body?
$JSONBody = @" { "ipv4addrs": [ { "ipv4addr": "10.1.3.1" } ], "name": "myServer.myothercompany.com", "view": "Internal" }
The parameter "zone" cannot be written into.
Thanks and Regards,
Krishna Vasudevan