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

Bulk add of network objects via API does not work

 

Hi all,

 

maybe you can spot the error as I cannot see what is not correct:

 

CSV content

name,subnet,mask-length,tags,set-if-exists,color,comments,groups
ne_myDCs_8.25.203.0-24,8.25.203.0,24,myDCs,true,red,CmyDCs,ge_myDCs
ne_myDCs_8.34.34.0-24,8.34.34.0,24,myDCs,true,red,CmyDCs,ge_myDCs
ne_myDCs_8.35.35.0-24,8.35.35.0,24,myDCs,true,red,CmyDCs,ge_myDCs
ne_myDCs_52.18.93.240-32,52.18.93.240,32,myDCs,true,red,CmyDCs,ge_myDCs

 

API

[Expert@FW:0]#  mgmt_cli add network --batch cp_bulk_add_networks.csv

Username: admin

Password:

Line 269: code: "generic_err_invalid_parameter"

message: "Invalid parameter for [color]. The invalid value [CmyDCs] should be replaced by one of the following values: [aquamarine, black, blue, crete blue, burlywood, cyan, dark green, khaki, orchid, dark orange, dark sea green, pink, turquoise, dark blue, firebrick, brown, forest green, gold, dark gold, gray, dark gray, light green, lemon chiffon, coral, sea green, sky blue, magenta, purple, slate blue, violet red, navy blue, olive, orange, red, sienna, yellow]"

 

Thanks and regards

Thomas

0 Kudos
7 Replies
Maarten_Sjouw
Champion
Champion

The most common problem occurs here again, add the full path to the CSV file and it should work just fine
mgmt_cli add network --batch /home/admin/cp_bulk_add_networks.csv
Oh and besides that try Red instead of red
Regards, Maarten
0 Kudos
TomShanti
Collaborator

Hi Maarten,

 

thanks for your reply.

Shame on me it actually turned out that my 700+ line CSV was not correctly formatted on each line.

 

Regards Thomas

0 Kudos
Maarten_Sjouw
Champion
Champion

To my knowledge there is a max of 500 objects the API can handle at one time..
Regards, Maarten
0 Kudos
PhoneBoy
Admin
Admin

In R80.40 there is a specific API call to add things in batch that is significantly faster.
0 Kudos
TomShanti
Collaborator

 

Thanks, I´ll definetly have to take a look at it because the bulk add as I did it blocked the whole management (including logins) for about 10 minutes.

 

Regards Thomas

0 Kudos
PhoneBoy
Admin
Admin

In the meantime, you can see better performance by publishing a smaller number of changes at a time.
0 Kudos
HeikoAnkenbrand
Champion Champion
Champion

It's just an idea. I'm not sure if it only an output limit. Perhaps this will also help to enter the values.

mgmt_cli ...limit 1000...

 

➜ CCSM Elite, CCME, CCTE
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events