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

Position of rules in batch upload

Hi All,

I'm using the API with the mgmt_cli --batch parameter to do a mass upload of rules. Has anyone had any luck with using something other than top or bottom in the position parameter? If I run the command manually I can use above, below, etc but when I use those parameters in the csv it returns an error for invalid value for position, and shows the only two values as top or bottom. Anyone have any experience with this?

Tags (3)
0 Kudos
3 Replies
Admin
Admin

Re: Position of rules in batch upload

What is the full CLI you are trying?

And have you tried it without the CSV file (i.e. just adding a single rule) to validate the syntax is correct?

Highlighted

Re: Position of rules in batch upload

Here is a sample of one of the rules. If you try running this just in the CLI it succeeds. If I run this from the batch it'll fail with invalid parameter position. Valid entries are [top, bottom]

mgmt_cli add nat-rule -d Sandbox_Lab_2 package Standard original-source Source1 original-destination Destination1_NAT method static translated-destination Destination1 comments "sample rule"  position.above "# NAT Rules for Vendors"
Admin
Admin

Re: Position of rules in batch upload

I was able to insert NAT rules above a manually created NAT rule successfully.

The CLI call? mgmt_cli -r true add nat-rule --batch csv

The header of my CSV file looks something like this:

package,original-source,original-destination,method,translated-source,translated-destination,comments,position.above

What I used in position.above was the rule UID of the rule I wanted to put the rules above.

0 Kudos