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 theBinding
that a script has attempt to extract the cluster selection context.getClusters
(groovy.lang.Binding binding) Deprecated.static ClusterSelectionContext
getClusterSelectionContext
(groovy.lang.Binding binding) Given theBinding
that a script has attempt to extract the cluster selection context.getCommands
(groovy.lang.Binding binding) Deprecated.static CommandSelectionContext
getCommandSelectionContext
(groovy.lang.Binding binding) Given theBinding
that a script has attempt to extract the command selection context.getProperties
(groovy.lang.Binding binding) Given theBinding
that a script has attempt to extract the properties map.
-
Method Details
-
getCommandSelectionContext
public static CommandSelectionContext getCommandSelectionContext(groovy.lang.Binding binding) throws IllegalArgumentException Given theBinding
that a script has attempt to extract the command selection context.- Parameters:
binding
- TheBinding
for the script- Returns:
- The
CommandSelectionContext
instance - 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 theBinding
that a script has attempt to extract the cluster selection context.- Parameters:
binding
- TheBinding
for the script- Returns:
- The
ClusterSelectionContext
instance - 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 theBinding
that a script has attempt to extract the cluster selection context.- Parameters:
binding
- TheBinding
for the script- Returns:
- The
ClusterSelectionContext
instance - Throws:
IllegalArgumentException
- If there is no context parameter for the script or it is not aClusterSelectionContext
-
getProperties
Given theBinding
that a script has attempt to extract the properties map.- Parameters:
binding
- TheBinding
for the script- Returns:
- The map of properties
-
getClusters
@Deprecated public static Set<Cluster> getClusters(groovy.lang.Binding binding) throws IllegalArgumentException Deprecated.Given theBinding
that a script has attempt to extract the clusters parameter.- Parameters:
binding
- TheBinding
of 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 allCluster
instances
-
getCommands
@Deprecated public static Set<Command> getCommands(groovy.lang.Binding binding) throws IllegalArgumentException Deprecated.Given theBinding
that a script has attempt to extract the commands parameter.- Parameters:
binding
- TheBinding
of 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 allCommand
instances
-
getClusterSelectionContext(Binding)
orgetCommandSelectionContext(Binding)
instead