Skip to content

Instantly share code, notes, and snippets.

@chelnak
Created July 27, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelnak/bf597945da40cb5bea9602a8df0955e6 to your computer and use it in GitHub Desktop.
Save chelnak/bf597945da40cb5bea9602a8df0955e6 to your computer and use it in GitHub Desktop.
Get an NSX Security Tag by name
/*
- Get an NSX Security Tag by name
Inputs:
NSXEndpoint [NSXConnection]
securityGroupName [String]
*/
var nsxSecurityTags = NSXSecurityTagManager.getSecurityTags(NSXEndpoint);
return nsxSecurityTags.filter(nameEquals(securityTagName))[0];
function nameEquals(name) {
return function(i) {
return i.name.toLowerCase() === name.toLowerCase();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment