Package com.netflix.genie.web.scripts
Class GroovyScriptUtils
java.lang.Object
com.netflix.genie.web.scripts.GroovyScriptUtils
Utility functions that can be used within Groovy scripts executed from Genie.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiongetAgentLauncherSelectionContext(groovy.lang.Binding binding) Given theBindingthat a script has attempt to extract the cluster selection context.static Set<com.netflix.genie.common.internal.dtos.Cluster>getClusters(groovy.lang.Binding binding) Deprecated.static ClusterSelectionContextgetClusterSelectionContext(groovy.lang.Binding binding) Given theBindingthat a script has attempt to extract the cluster selection context.static Set<com.netflix.genie.common.internal.dtos.Command>getCommands(groovy.lang.Binding binding) Deprecated.static CommandSelectionContextgetCommandSelectionContext(groovy.lang.Binding binding) Given theBindingthat a script has attempt to extract the command selection context.getProperties(groovy.lang.Binding binding) Given theBindingthat a script has attempt to extract the properties map.
-
Method Details
-
getCommandSelectionContext
public static CommandSelectionContext getCommandSelectionContext(groovy.lang.Binding binding) throws IllegalArgumentException Given theBindingthat a script has attempt to extract the command selection context.- Parameters:
binding- TheBindingfor the script- Returns:
- The
CommandSelectionContextinstance - Throws:
IllegalArgumentException- If there is no context parameter for the script or it is not aCommandSelectionContext
-
getClusterSelectionContext
public static ClusterSelectionContext getClusterSelectionContext(groovy.lang.Binding binding) throws IllegalArgumentException Given theBindingthat a script has attempt to extract the cluster selection context.- Parameters:
binding- TheBindingfor the script- Returns:
- The
ClusterSelectionContextinstance - Throws:
IllegalArgumentException- If there is no context parameter for the script or it is not aClusterSelectionContext
-
getAgentLauncherSelectionContext
public static AgentLauncherSelectionContext getAgentLauncherSelectionContext(groovy.lang.Binding binding) throws IllegalArgumentException Given theBindingthat a script has attempt to extract the cluster selection context.- Parameters:
binding- TheBindingfor the script- Returns:
- The
ClusterSelectionContextinstance - Throws:
IllegalArgumentException- If there is no context parameter for the script or it is not aClusterSelectionContext
-
getProperties
Given theBindingthat a script has attempt to extract the properties map.- Parameters:
binding- TheBindingfor the script- Returns:
- The map of properties
-
getClusters
@Deprecated public static Set<com.netflix.genie.common.internal.dtos.Cluster> getClusters(groovy.lang.Binding binding) throws IllegalArgumentException Deprecated.Given theBindingthat a script has attempt to extract the clusters parameter.- Parameters:
binding- TheBindingof the script- Returns:
- The set of
Cluster's - Throws:
IllegalArgumentException- If there is no clusters parameter, it isn't a set, is empty or doesn't contain allClusterinstances
-
getCommands
@Deprecated public static Set<com.netflix.genie.common.internal.dtos.Command> getCommands(groovy.lang.Binding binding) throws IllegalArgumentException Deprecated.Given theBindingthat a script has attempt to extract the commands parameter.- Parameters:
binding- TheBindingof the script- Returns:
- The set of
Command's - Throws:
IllegalArgumentException- If there is no commands parameter, it isn't a set, is empty or doesn't contain allCommandinstances
-
getClusterSelectionContext(Binding)orgetCommandSelectionContext(Binding)instead