Created
November 7, 2017 23:21
-
-
Save josejulio/188229eae0d6443de4939109dab1741e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var groupDefinition = new GroupDefinition(); | |
groupDefinition.name = 'Servers by plugins'; | |
groupDefinition.description = 'Group servers by plugin'; | |
groupDefinition.expression = 'resource.type.category=SERVER\n' | |
+'groupby resource.type.plugin'; | |
groupDefinition.recalculationInterval = 60000; | |
// Returns the new group definition that is ready to be used on other | |
// calls or throws an exception | |
groupDefinition = GroupDefinitionManager.createGroupDefinition(groupDefinition); | |
// Forces refresh of the members | |
GroupDefinitionManager.calculateGroupMembership(groupDefinition.id); | |
// Update the groupDefinition | |
groupDefinition.name = 'Servers by plugins UPDATED'; | |
groupDefinition = GroupDefinitionManager.updateGroupDefinition(groupDefinition); | |
// Forces refresh | |
GroupDefinitionManager.calculateGroupMembership(groupDefinition.id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment