Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

Create host record in non-default zone

Member
Posts: 1
1581     0

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

Adviser
Posts: 179
1582     0

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

Showing results for 
Search instead for 
Did you mean: 

Recommended for You