chelnak
7/27/2016 - 7:45 PM

Get an NSX Security Tag by name

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();

    }

}