Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Chun_Cheng
Explorer
Jump to solution

Batch add objects , what is the correct CSV format

I created a CSV file , the format is below

I then transferred this csv file to the Checkpoint management server, run the batch command,  i got the following errors

Can someone please assist?

Thanks

0 Kudos
2 Solutions

Accepted Solutions
Vladimir
Champion
Champion

Please see How to import multiple objects into R80.x Management database using .csv file for the accepted CSV format.

When you are showing it in a spreadsheet, we do not know what the delimiters are when it is opened in the text editor.

Additionally, if you are creating this file on Windows, it is likely that the EOL (end of line) characters are incorrect.

You can either compensate it by using dos2unix https://bencane.com/2014/02/11/converting-files-from-windows-format-to-unix-format-with-dos2unix/ 

or using something like Notepad++ to save the file in the compatible format.

Regards,

Vladimir

View solution in original post

0 Kudos
PhoneBoy
Admin
Admin
See the API documentation for add-dns-domain:
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-dns-domain~v1.6
Specifically look under "Parameter Name" as these what you can use in the first line of the CSV.
Note that you do not need to include all of the parameters, only the required ones along with the ones you wish to set to non-default values.

View solution in original post

0 Kudos
12 Replies
Vladimir
Champion
Champion

Please see How to import multiple objects into R80.x Management database using .csv file for the accepted CSV format.

When you are showing it in a spreadsheet, we do not know what the delimiters are when it is opened in the text editor.

Additionally, if you are creating this file on Windows, it is likely that the EOL (end of line) characters are incorrect.

You can either compensate it by using dos2unix https://bencane.com/2014/02/11/converting-files-from-windows-format-to-unix-format-with-dos2unix/ 

or using something like Notepad++ to save the file in the compatible format.

Regards,

Vladimir

0 Kudos
Chun_Cheng
Explorer

thank you so much. txt works.

Also, what is the format of the file if I need to batch add networks.

0 Kudos
PhoneBoy
Admin
Admin

Depends on what parameters you want to set.

In general, the first line is the name of the parameters you want to set, which must match exactly the parameter name in the API documentation.

0 Kudos
Rabindra_Khadka
Contributor
hello @PhoneBoy do you have excel csv format of dns-domain object (fqdn object), can you please help me on this
0 Kudos
PhoneBoy
Admin
Admin
See the API documentation for add-dns-domain:
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-dns-domain~v1.6
Specifically look under "Parameter Name" as these what you can use in the first line of the CSV.
Note that you do not need to include all of the parameters, only the required ones along with the ones you wish to set to non-default values.
0 Kudos
Rabindra_Khadka
Contributor
Thanks for the idea. it works
but what about the groups, if we want to assign all the list of domain on the paticular group at the same time via csv format
0 Kudos
Rabindra_Khadka
Contributor
I didn't find "Parameter Name" for the groups in dns-domain section
0 Kudos
PhoneBoy
Admin
Admin
That's because the API doesn't support this operation for Domain objects (i.e. adding it to a group on creation).
That will have to be done as a separate API call.
0 Kudos
David_Brodin
Contributor

I know this is an old thread, but I found out for service groups on r80.40, the csv-format is:

 

name,members,members,members,members
"icmp-requests","echo-request","info-req","mask-request","timestamp"

 

I haven't tried any other type of groups, so I'm not sure that the format is universal - it is per group, but if some groups have more or less members, I'd think the import would fail as those columns are empty.

Instead I created a REST-API-script that did the export/import of service-groups for me. I'll be publishing it on GitHub and Checkmates this week.

 

My bad, published it on github, but forgot to link it here. Created a new post as not to spam external links:

0 Kudos
denmamom
Explorer

Hi! 

Can you please check what I am doing wrong 

mgmt_cli add dns-domain --batch file

[Expert@smartcenter:0]# cat file
name,is-sub-domain
".example1.com",false
".example2.com",false

I tried to use single quotes, without quotes and nothing is worked for me, I am always receive error 

 Line 2: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [name]"

Line 3: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [name]"

by the way mgmt_cli add dns-domain name ".example1.com" is-sub-domain false, work just fine

 

Any help ? Thanks

0 Kudos
Wei_Justin
Explorer

Hi Please revise correct format for batch file as below, then do command again, thanks.

name,is-sub-domain
.example1.com,false
.example2.com,false

0 Kudos
Wei_Justin
Explorer

Hi , Please revise the correct format as below, then do command again, thanks.

name,is-sub-domain
.example1.com,false
.example2.com,false

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events