- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- mgmt_cli csv multiple service ports addition
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mgmt_cli csv multiple service ports addition
Hello,
I am trying to create access rules using CSV (bulk method). As you all may know, there can be multiple sources, destinations or services in the rule however, the service parameter in CSV only allows one value a time.
I have tried all combinations to have mgmt_cli parse the CSV column values as list but it doesn't seem to be working. The only way I get it working is by defining multiple columns, like:
layer,source,destination,service.1,service.2,service.3,service.4,service.5,action,name,position,track
Network,dummy-src-1,dummy-dest-1,http,https,ssh,http_proxy,,accept,this-is-a-dummy-rule,2,log
As it can be seen, I had to leave service.5 field Null like ,, for the call to be successful. It is though not very scalable and there are times when it will be required to add maybe 10 services. Yes, a Group can be an option but let's keep at as a last resort.
I have tried:
layer,source,destination,service,action,name,position,track
Network,dummy-src-1,dummy-dest-1,[http,https,ssh,http_proxy],accept,this-is-a-dummy-rule,2,log
Line 2: code: "generic_err_object_not_found"
message: "Requested object [HTTPS, HTTP] not found"
layer,source,destination,service,action,name,position,track
Network,dummy-src-1,dummy-dest-1,["http","https","ssh","http_proxy"],accept,this-is-a-dummy-rule,2,log
Error occured during parsing of CSV file.
Line 2 column 6: Unexpected character in csv file. Double-quotes are expected to come in pairs.
Failed to read parameters file [add_rules.csv]: Invalid format
And multiple other combinations that will make this post very long without any luck.
This is a very practical example so does anyone know how to get that working in a scalable fashion?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Effectively, you’re specifying name/value pairs in the CSV file.
The header row contains the name, the other rows contain the values.
Unfortunately, there is no way to specify multiple values other than the method you describe (e.g. service.1, service.2) and is consistent with how you’d construct the mgmt_cli call without a CSV file.
Bottom line: this is expected behavior.
