Reply
Highlighted
Accepted Solution

Populating zone with records using "import zone" option via API

JOppers
Techie
Posts: 2
4302     0

Hi,

 

The GUI gives the option to "import zone" (populating the zone with records using a zone transfer). Is this option also available via the API?

 

If yes, what is the command to trigger this?

 

regards,

Jos

 

Re: Populating zone with records using "import zone" option via API

Moderator BRampling
Moderator
Posts: 69
4303     0

The import_from field in the zone_auth object is equivalent to the GUI Import Zone function. I'll try to post an example for you.

Re: Populating zone with records using "import zone" option via API

Moderator BRampling
Moderator
Posts: 69
4303     0

I just tested this and it imported the zone contents via zone transfer:

 

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://10.60.27.4/wapi/v2.6/zone_auth -d '{"fqdn":"blair.com","grid_primary":[{"name":"infoblox.localdomain"}],"restart_if_needed":true,"import_from":"10.60.27.5"}'

Re: Populating zone with records using "import zone" option via API

JOppers
Techie
Posts: 2
4303     0

Many thanks for this update. This solved our problem.

Now we are able to populate the zone using a transfer initiate by a script.

 

kindly regards,

Jos

Re: Populating zone with records using "import zone" option via API

verne
Techie
Posts: 12
4303     0

anyone have thoughts on, when using this method, how to preserve (ie, copy over) custom SOA values  ... refresh, retry, expire, etc?

 

my testing shows the Grid defaults (or defaults at another level) are applied to the new zone and the original custom values are ignored.

 

FYI, the serial number IS copied over, then incremented  ... that's OK.

 

Re: Populating zone with records using "import zone" option via API

jmnieto
Techie
Posts: 2
4303     0

In my case this doesn't seem to work. I'm trying to populate one zone from a BIND server to Infoblox and the result is this error:

 

{ "Error": "AdmConDataError: None (IBDataConflictError: IB.Data.ConflictSmiley Very Happyuplicate object 'domain.lab' of type zone exists in the database.)",
  "code": "Client.Ibap.Data.Conflict",
  "text": "Duplicate object 'finalfive.lab' of type zone exists in the database."

 

Apparently, it's trying to create the zone, which I don't want because I already have the zone created, just like it is usually done by the GUI.

 

This is the entire command:

 

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://X.X.X.X/wapi/v2.7/zone_auth -d '{"fqdn":"domain.lab","grid_primary":[{"name":"myinfobloxmaster.lab"}],"restart_if_needed":true,"import_from":"Y.Y.Y.Y"}'

 

Where X.X.X.X is the GM IP and Y.Y.Y.Y is the BIND Server IP.

Re: Populating zone with records using "import zone" option via API

Moderator BRampling
Moderator
Posts: 69
4303     0

You need to use PUT, not POST. Same issue as in this thread, there are examples there:

 

https://community.infoblox.com/t5/API-Integration/API-functionality-for-doing-automated-zone-transfe...

 

Re: Populating zone with records using "import zone" option via API

jmnieto
Techie
Posts: 2
4303     0

Many thanks. I got it working with the procedure in that thread.

Showing results for 
Search instead for 
Do you mean 

Recommended for You