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

How to create a new Network with multiple groups via csv on mgmt_cli

Hi Mates,

try to create a csv that creates a new network object and put it into more then one group at creation.
At the moment this works but I do not know how to add more then one group.

 

name,subnet,subnet-mask,comments,color,groups
NW_TestNeT,10.11.12.0,255.255.255.0,NW-Description,orange,Group1

 

Cheers,
David

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin

In the header line, use groups.1, groups.2, etc (for as many groups as you wish to add)
Then in the data lines, you can list multiple groups.

View solution in original post

0 Kudos
4 Replies
PhoneBoy
Admin
Admin

In the header line, use groups.1, groups.2, etc (for as many groups as you wish to add)
Then in the data lines, you can list multiple groups.

0 Kudos
D_W
Advisor

Worked! thx
In which documentation can this be found?

0 Kudos
Bob_Zimmerman
Authority
Authority

This is just a side-effect of how you have to specify arrays in mgmt_cli calls and how its CSV handling works. I haven't seen good documentation for mgmt_cli.

In short, the CSV handling works by taking each line of the CSV after the header, and mixing it with the header to construct an API command. You end up with the contents of cell 1A followed by the contents of nA followed by the contents of 1B followed by the contents of nB, and so on.

mgmt_cli doesn't have a direct concept of arrays in its input. Instead, you have to specify the array members in the form "<key>.<index>". For example, to specify that the key "groups" should contain a three-member array, you need to provide "groups.1 <value> groups.2 <value> groups.3 <value>".

0 Kudos
PhoneBoy
Admin
Admin

Sadly, this is not well documented (officially).
It comes up periodically on CheckMates.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events