Difference between revisions of "Useful Functions"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
(Created page with "Sleep function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); }")
 
Line 4: Line 4:
 
   while (new Date().getTime() < start + delay);
 
   while (new Date().getTime() < start + delay);
 
  }
 
  }
 +
 +
Adding Attributes, automaticaly creating the category if it doesn't exists
 +
actions.addIPAttribute("172.21.40.14","State","New York"); //Add "New York" Attribute to "State" category for this ip
 +
actions.addMACAttribute("a4:ba:db:ff:18:bc","State","Washington"); //Add "Washington" Attribute to "State" category for this mac
 +
actions.addMACAttribute("a4:ba:db:ff:18:bc","City","Colorado");

Revision as of 11:25, 1 February 2017

Sleep

function sleep(delay) {
 var start = new Date().getTime();
 while (new Date().getTime() < start + delay);
}

Adding Attributes, automaticaly creating the category if it doesn't exists

actions.addIPAttribute("172.21.40.14","State","New York"); //Add "New York" Attribute to "State" category for this ip 
actions.addMACAttribute("a4:ba:db:ff:18:bc","State","Washington"); //Add "Washington" Attribute to "State" category for this mac 
actions.addMACAttribute("a4:ba:db:ff:18:bc","City","Colorado");