Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOUDSTACK-10329] Button in ACL rules page to export all rules as a CSV file #2494

Merged
merged 1 commit into from Mar 20, 2018

Conversation

rafaelweingartner
Copy link
Member

This PR introduces a new button in ACS UI to export ACL rules in a CSV file. This is useful for reporting ACL rules configured.

The following picture is a screenshot.
newbutton

@rafaelweingartner rafaelweingartner self-assigned this Mar 16, 2018
@rafaelweingartner rafaelweingartner added this to the 4.12.0.0 milestone Mar 16, 2018
};
var createSafeCsvValue = function(value){
if(value){
return '"' + value + '"';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rafaelweingartner, Thanks for adding this functionality.
Here, Will the input look like this: ("a","b","c"...) or (a,b,c...). The variable csv in generateCsvForAclRules function converts to string when it is initialized (concatenated with a comma string).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nitin-maharana thanks for the review, but I did not quite understand your question.
Here is an example of CSV generated using the code of this PR:

"id","#Rule","CIDR","Action","Protocol","#Protocol","Start Port","End Port","ICMP Type","ICMP Code","Traffic Type","Reason"
"ef06c57e-dc8b-40d9-a461-5a30072384ab","2","19.168.56.0/12","Allow","all",,,,,,"Ingress",
"45835dfb-260c-461d-8051-444ac764151e","102","19.168.56.0/12","Allow","tcp",,"1","1",,,"Ingress",

I am using this createSafeCsvValue to enclose the value with double quotes, which will avoid problems with values that may have commas in them. If you open the file generated with this code in Excel, it is transparent for users.

@nitin-maharana
Copy link
Contributor

Code LGTM.

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rafaelweingartner rafaelweingartner merged commit cd3a128 into apache:master Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants