Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

Create host record in non-default zone

New Member
Posts: 1
2250     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: 181
2251     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