Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Nick_Doropoulos
Advisor

Importing NAT policies with api in batch mode

I am trying to import a set of NAT policies which exist in a csv file. The file's headings are the following:

packagepositionoriginal-sourcetranslated-sourceoriginal-destinationtranslated-destinationoriginal-servicetranslated-serviceenabled

The problem occurs when I run the following command:

mgmt_cli add nat-rule --batch [csv file]

And I get dozens of lines of this output:

message: "Requested object [x] not found"

And yet I know for a fact that all of the objects referenced already exist in the database since I had imported every other type of object first, leaving the NAT policies deliberately as the last item to import.

Has anybody else had problems with this? I am also struggling to find any examples on bulk-importing nat policies via api so any help would be much appreciated.

Thanks in advance.

4 Replies
Maarten_Sjouw
Champion
Champion

Have you tested the adding of 1 rule without csv? I was struggling with csv import last week as well and ended up doing a line by line as their was only 20 or so lines I wanted to import. I still needed to triple check why the file we used did not work.

For me at that time it was quicker to use Notepad ++ in column mode to add the commands around the values.

Regards, Maarten
0 Kudos
JozkoMrkvicka
Authority
Authority

Is there TAB in the csv file ? Did you use Excel ? Try to use simple notepad or notepad++ instead.

Or maybe try to use " " in csv.

Kind regards,
Jozko Mrkvicka
0 Kudos
Alessandro_Marr
Advisor

Try to load just one line on your csv file.

Amiad_Stern

Hi Nicholas Doropoulos‌ ,

Did you solve your issues? if not, please execute the "faulty" command and then perform: api status -s  (the output for this command is .tgz file with relevant logs)

Please send me the logs to amiads@checkpoint.com

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events