|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectorg.linkedin.glu.orchestration.engine.plugins.builtin.DocumentationPlugin
class DocumentationPlugin
This class is not a useful plugin per se, and is meant as documentation to describe each plugin hooks.
A plugin is simply a class with (groovy) closures, each of them defining a specific hook. You can define as many or as little of those closures as you want and you can 'spread' them accross different classes (for example, you can have a plugin class handling only the 'deployment' related plugin hooks, and another handling the hooks for a different part of the system). If a closure is missing, then it will simply not be called.
To make your plugin available to glu, you must add its class name in the configuration file:
orchestration.engine.plugins = [ 'org.linkedin.glu.orchestration.engine.plugins.builtin.StreamFileContentPlugin', 'org.acme.MyPlugin', etc... ]
Make sure that the jar file(s) containing your plugin (and its dependencies) is available to glu. If you are using the (console) server to deploy the glu webapp, then you can follow the steps that explain how to use the MySql driver in the documentation (http://linkedin.github.com/glu/docs/latest/html/console.html#example-for-a-different-database-mysql): you would copy your jar file(s) in the same location.
A closure receives arguments provided by the caller which depend on the hook (see individual documentation below). The arguments received is a map.
In a "post" hook (which means a hook that is being called after a given call), one of these arguments is always provided:
Every hook should return null
if you do not want to override the value that
the original caller returns, otherwise return your own value!
In a "pre" plugin, you can generally modify the arguments provided in the map:
def xxx_pre_yyy = { args -> args.description = "${args.description} / foo" return null }
Field Summary | |
---|---|
static java.lang.String |
MODULE
|
static Logger |
log
|
Property Summary | |
---|---|
java.lang.Object |
CommandsService_post_executeCommand
Called after the command completes (typical use case would be some sort of notification (email, sms, etc...) |
java.lang.Object |
CommandsService_pre_executeCommand
Called when a command is about to be executed. |
java.lang.Object |
DeploymentService_onStart_executeDeploymentPlan
Called when the plan has started executing. |
java.lang.Object |
DeploymentService_post_executeDeploymentPlan
Called when the deployment ends to allow you to do any kind of post deployment action (typical use case would be some sort of notification (email, sms, etc...) |
java.lang.Object |
DeploymentService_pre_executeDeploymentPlan
Called before executing a deployment plan to allow you to either tweak the plan or prevent
entirely its execution (you can throw a |
java.lang.Object |
FileSystemCommandExecutionIOStorage_createInputStream
Called to create an input stream to read a command IO from the filesystem. |
java.lang.Object |
FileSystemCommandExecutionIOStorage_createOutputStream
Called to create an output stream to write a command IO from the filesystem. |
java.lang.Object |
PlannerService_post_computePlans
Called after computing the plans which allows you to tweak the plan or add some metadata |
java.lang.Object |
PlannerService_pre_computePlans
Called before computing any plans which allows you to tweak the creation of the plan including the ability to create your own actions. |
java.lang.Object |
PluginService_initialize
This closure is called once when the application boots up to give a chance to the plugin to initialize itself. |
java.lang.Object |
SystemService_post_parseSystemModel
Called after parsing the system model to give you a chance to tweak the model built by glu. |
java.lang.Object |
SystemService_pre_parseSystemModel
Called before parsing the system model to give you a chance to preprocess it or process it entirely |
java.lang.Object |
UserService_post_authenticate
Called after user authentication. |
java.lang.Object |
UserService_post_authorize
Called after user authorization. |
java.lang.Object |
UserService_post_restAuthenticateAndAuthorize
Called after rest user authentication and authorization. |
java.lang.Object |
UserService_pre_authenticate
Called when a user authenticate. |
java.lang.Object |
UserService_pre_authorize
Called to authorize a user. |
java.lang.Object |
UserService_pre_restAuthenticateAndAuthorize
This call is wrapping the entire rest authentication and authorization flow, thus allowing you to write your entire REST auth code. |
Method Summary |
---|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final java.lang.String MODULE
public static final Logger log
Property Detail |
---|
java.lang.Object CommandsService_post_executeCommand
args.serviceResult
- the CommandExecution
object with all the details about the
executionnull
(the result is unused since executing a command is asynchronous)
java.lang.Object CommandsService_pre_executeCommand
args.fabric
- the fabric the agent belongs toargs.agent
- the agent on which the command will be executedargs.args
- the arguments for the command (see Agent.executeShellCommand
for
detailsargs.onResultStreamAvailable
- the closure that will be called when the results are availablenull
(the result is unused... you can tweak args instead)
java.lang.Object DeploymentService_onStart_executeDeploymentPlan
args.model
- the SystemModel
object used to generate the plan (note that the
model may be filtered, and you can call unfilter()
on it
to get the full model)args.plan
- the Plan
object representing the plan that will be executedargs.description
- the description to use for this planargs.deploymentId
- the id of the deployment (the key to be able to query the progress
of the deployment)null
(the result is unused since executing a plan is asynchronous)
java.lang.Object DeploymentService_post_executeDeploymentPlan
args.model
- the SystemModel
object used to generate the plan (note that the
model may be filtered, and you can call unfilter()
on it
to get the full model)args.plan
- the Plan
object representing the planargs.description
- the description to use for this planargs.deploymentId
- the id of the deployment (same as onStart
hook)args.serviceResult
- the IPlanExecution
object with all the details about the
executionnull
(the result is unused since executing a plan is asynchronous)
java.lang.Object DeploymentService_pre_executeDeploymentPlan
java.security.AccessControlException
).
Note that as with any "pre" hook, you can change and/or replace any of the arguments and the
caller will use the new ones.args.model
- the SystemModel
object used to generate the plan (note that the
model may be filtered, and you can call unfilter()
on it
to get the full model)args.plan
- the Plan
object representing the plan that will be executedargs.description
- the description to use for this plannull
(the result is unused since executing a plan is asynchronous)
java.lang.Object FileSystemCommandExecutionIOStorage_createInputStream
args.resource
- the resource (org.linkedin.util.io.resource.Resource
) from
which to create an input stream.null
if you don't want to do anything, otherwise an InputStream
java.lang.Object FileSystemCommandExecutionIOStorage_createOutputStream
args.resource
- the resource (org.linkedin.util.io.resource.Resource
) from
which to create an output stream.null
if you don't want to do anything, otherwise an OutputStream
java.lang.Object PlannerService_post_computePlans
args.params.planType
- the type of plan to create (ex: bounce, deploy, transition, etc...)args.params.stepType
- the type of steps to create (ex: sequential or parallel)args.params.name
- (optional) the name of the plan if providedargs.params.*
- any other params needed by the plan creation (provided in the "plans"
and "mountPointActions" configuration parameters)args.metadata
- metadata to use for the planargs.serviceResult
- the collection of plansargs.params.stepType
)
java.lang.Object PlannerService_pre_computePlans
args.params.planType
- the type of plan to create (ex: bounce, deploy, transition, etc...)args.params.stepType
- the type of steps to create (ex: sequential or parallel)args.params.name
- (optional) the name of the plan if providedargs.params.*
- any other params needed by the plan creation (provided in the "plans"
and "mountPointActions" configuration parameters)args.metadata
- metadata to use for the planargs.params.stepType
)
java.lang.Object PluginService_initialize
args.applicationContext
- the (spring) application context used to start the
(grails) application: all beans created are available in this
callargs.config
- is a groovy.util.ConfigObject
and contains all the values
defined in the configuration file
java.lang.Object SystemService_post_parseSystemModel
args.source
- same value passed in the "pre" hookargs.serviceResult
- the SystemModel
objectargs.serviceException
- if there is an exception (most likely while parsing the model)args.serviceResult
and returning null
java.lang.Object SystemService_pre_parseSystemModel
args.source
- can be a String
, an InputStream
or anything
that can be turned into a URI. You can modify this attribute and the caller will pick it upSystemModel
object, otherwise return null
java.lang.Object UserService_post_authenticate
args.authToken
- is a shiro authentication token object (username/password)args.serviceResult
- the username (when authentication worked)args.serviceException
- whenever authentication failednull
to let the caller return its value
java.lang.Object UserService_post_authorize
args.filter
- is a grails filter plugin object which gives you access to all methods
and closures available from the filter (ex: filter.request, filter.response,
filter.name, filter.accessControl {...}, etc...)args.serviceResult
- true
or false
depending on the filter
resultargs.serviceException
- whenever there was an exception with authorizationtrue
to authorize the call, false
to deny it, or
null
to let glu proceed with authorization
java.lang.Object UserService_post_restAuthenticateAndAuthorize
args.filter
- is a grails filter plugin object which gives you access to all methods
and closures available from the filter (ex: filter.request, filter.response,
filter.name, filter.accessControl {...}, etc...)args.serviceResult
- true
or false
depending on the filter
resultargs.serviceException
- whenever there was an exception with authorizationtrue
to authorize the call, false
to deny it, or
null
to let glu proceed with authorization
java.lang.Object UserService_pre_authenticate
null
value will bypass the authentication entirely!
args.authToken
- is a shiro authentication token object (username/password)null
to let glu proceed with authentication
java.lang.Object UserService_pre_authorize
org.linkedin.glu.console.filters.AuthFilters
for an example of what you can do
args.filter
- is a grails filter plugin object which gives you access to all methods
and closures available from the filter (ex: filter.request, filter.response,
filter.name, filter.accessControl {...}, etc...)true
to authorize the call, false
to deny it, or
null
to let glu proceed with authorization
java.lang.Object UserService_pre_restAuthenticateAndAuthorize
null
value, then the plugins UserService_pre_authenticate
,
UserService_post_authenticate
, UserService_pre_authorize
and
UserService_post_authorize
won't be called
args.filter
- is a grails filter plugin object which gives you access to all methods
and closures available from the filter (ex: filter.request, filter.response,
filter.name, filter.accessControl {...}, etc...)true
to authorize the call, false
to deny it, or
null
to let glu proceed with authorization
Groovy Documentation