cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question
Highlighted
DPB_Point
Nickel

API - Adding network objects with the same IP than others already created

Jump to solution

HI!

I am trying to create network objects in a checkpoint due to a migration. As in ASA we could have created objects with the same network range(duplicated objects), I am having several problems to migrate it succesfully.

I am using a csv file in which I have included the objects with the syntax that Checkpoint allows. I use the following command:

mgmt_cli add network -r true --batch prueba.csv -d IBDL_CALES

I have also added the ignore-warnings field, ignore-errors and set-if-exists fields but none of them let me create the object that has the same IP or IP range than the ones that are created in the Checkpoint. The output I get is the following:

Line 2: code: "err_validation_failed"
message: "Validation failed with 1 warning"
warnings:
- message: "More than one network have the same IP x.x.x.x/y.y.y.y"

Does Any of you know how to supress that warnings and create that duplicated objects?

 

It's important to me creating them because they are a lot of objects(I have the same problem ith the hosts) and then We want to migrate the policies too and we must have the same objects than in the ASA.

Tags (2)
1 Solution

Accepted Solutions
DPB_Point
Nickel

Re: API - Adding network objects with the same IP than others already created

Jump to solution

I have just found out how to solve it. The problem was that it's compulsory to include it in the csv file as a field and you can't type it as a field in the mgmt_cli command.

Thanks for the support!!!

0 Kudos
6 Replies
Admin
Admin

Re: API - Adding network objects with the same IP than others already created

Jump to solution
Just to clarify, you have an object that covers x.y.z.w/a.b.c.d and want to create another with a different name?
Are you adding set-of-exists true to your CLI command or the CSV?
0 Kudos

Re: API - Adding network objects with the same IP than others already created

Jump to solution
set-if-exists will update the object not create a second one. If he is trying to create different named objects but same subnet it would just update the name.

Re: API - Adding network objects with the same IP than others already created

Jump to solution
add this to your command 'ignore-warnings true ignore-errors true'

That will ignore the errors...
DPB_Point
Nickel

Re: API - Adding network objects with the same IP than others already created

Jump to solution

As I have mentioned before, I have already tried to put that ignore errors field and the warnings field and I continue receiving the following error:

Line 2: code: "err_validation_failed"
message: "Validation failed with 1 warning"
warnings:
- message: "More than one network have the same IP x.x.x.x/y.y.y.y"


Executed command failed. Changes are discarded.

0 Kudos
DPB_Point
Nickel

Re: API - Adding network objects with the same IP than others already created

Jump to solution

I have just found out how to solve it. The problem was that it's compulsory to include it in the csv file as a field and you can't type it as a field in the mgmt_cli command.

Thanks for the support!!!

0 Kudos

Re: API - Adding network objects with the same IP than others already created

Jump to solution

Hello DPB_Point ,

 

what is the exact syntax in csv file?

 

I tried to put ignore_warnings ignore_errors, ignore-warnings, ignore-errors in the first line, but still giving an error:

 

error message:

Line 4: code: "err_validation_failed"
message: "Validation failed with 1 warning"
warnings:
- message: "Multiple objects have the same IP address 1.1.1.3"


Executed command failed. Changes are discarded.

 

Thank you,

 

Marko

 

 

0 Kudos