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

Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution

Hi CP-Team,

 

I am trying to add a bunch of network-objects at a time. I have a csv-file with this syntax:

 

name, comments, subnet, mask-length, color

<nam_1>, <com_1>, <x.x.x.x>>, 16, forest green

 

If I no call the csv via <mgmt_cli add network --batch test_add.csv> I get warnings if a object is reached, which has the same network-definition. 
I would like the API to just skip these elements, but process the others instead of stopping and discarding all. (the --ignore-errors would just ignore the warning and double objects, what is not my intension).

 

Best regards

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Admin
Admin

Re: Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution
There is not a skip-if-exists option.
The set-if-exists option will update the existing object, assuming you're using the same name,
But it sounds like you have two different object names with the same network definition.
And, at the moment, your options are to remove the offending entries from the CSV or use ignore-warnings true and have multiple definitions of the same network.

View solution in original post

4 Replies
Highlighted
Admin
Admin

Re: Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution

Add set-if-exists true to your command line.

0 Kudos
Highlighted

Re: Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution
Hi PhoneBoy,
thanks for your fast reply.
I didn`t see the <more> options, nice 2 have. In this case I am more looking for a <skip-if-exists> option, but probably it doesn`t exist.
Best regards,
0 Kudos
Highlighted
Admin
Admin

Re: Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution
There is not a skip-if-exists option.
The set-if-exists option will update the existing object, assuming you're using the same name,
But it sounds like you have two different object names with the same network definition.
And, at the moment, your options are to remove the offending entries from the CSV or use ignore-warnings true and have multiple definitions of the same network.

View solution in original post

Highlighted

Re: Management API - Using CSV to bulk add objects - Doubled Items

Jump to solution
That did not resolve the issue. If i add set-if-exists true to my command, I still get the warning and the validation failed. If I add an additions ignore-warnings true, the object is not updated, but a second with same subnet and mask is created.
0 Kudos