script
ScriptManager

The script manager controls all scripts in the system. It controls creation, execution, and script contents.



public class ScriptManager

Properties
script.AbstractScriptBinding-Set type=Children-Set
script.AbstractXmlApiScript-Set type=Children-Set
script.Bundle-Set type=Children-Set
script.ControlScript-Set type=Children-Set
script.HandlerBinding-Set type=Children-Set
script.InvokerBinding-Set type=Children-Set
script.Script-Set type=Children-Set
script.TemplateBinding-Set type=Children-Set
script.VelocityTemplate-Set type=Children-Set
  
Properties inherited from ManagedObject
actionMask, children-Set, deploymentState, isFaultSquelched, name, objectFullName, selfAlarmed
 
Methods

cancelExecution

This method is used to cancel the execution of a script. If a script is currently executing, it will not cancel it, it must wait until the script is finished. It will cancel scripts that are queued to execute.
Input Parameters:
clientId : string - The client ID of the client that requested the execution of the target script.
targetScriptResultObjectFullNameListToBeCanceled : List (
Pointer) - The list of target scripts to cancel.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
objectFullNameList : List (Pointer) - The full name list of all the targets that could be cancelled.
Exceptions:
script.ScriptManager.cancelExecutionException

cancelRunningCliExecution

This method is used to cancel the running execution of a CLI script. If a CLI script is currently executing, it will be cancelled.
Input Parameters:
clientId : string - The client ID of the client that requested the execution of the target script.
aInTargetScriptFdn : string - The FDN of target scripts.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false

cancelScriptFlow

This method will request to stop a running script flow. It is not guaranteed that the script flow will be aborted.
Input Parameters:
clientId : string - Identifies the client ID that requested the execution (used for sending an event to the specific client when execution is complete).
targetScriptResultObjectFullNameToBeCanceled :
Pointer - The FDN of target script result object to cancel. This result object is returned by method executeScriptFlow.
targetScriptConfig : config(script.TargetScript) - The configuration info for the target script to cancel.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
cancelRequestSubmitted : boolean - Returns true if the request was succesfully submitted (it does not mean that the script execution was actually stopped). Returns false if the cancel request could not be submitted (the script already finished execution or user has no privileges to cancel this task).
Exceptions:
script.ScriptManager.cancelScriptFlowException

configure

Create and modify a script through the script manager.
Input Parameters:
deployer : Deployer - the deployment state
synchronousDeploy : boolean - (Optional) Specify whether to block until the changes have been fully deployed to the network. A value of "true" means to block. A value of "false" means to return immediately. Default: false (asynchronous)
clearOnDeployFailure : boolean - (Optional) Specify whether to clear any failed deployers. A value of "true" means to clear. A value of "false" means to leave the failed deployer. Default: false
deployRetries : int - (Optional) The number of times to attempt re-deployment during synchronous deployment. This parameter is meaningless in the asynchronous case. Default: 0
deployRetryInterval : long - (Optional) The number of milliseconds to wait between deployment retries. This parameter is meaningless in the asynchronous case. Default: 0
taskDescription : string - (Optional) A user friendly description of what the operation does. This information will be used by the task manager.
configInfo : generic.CommonManagedContainmentEntityConfigurationInformation - The script configuration information.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
objectFullName : string - The newly created scripts full name.
Exceptions:
script.ScriptManager.configureException

executeCLIScript

This method is called to execute target scripts.

For example:

<script.ScriptManager.executeCLIScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<targetScriptFullNameList>
<pointer>script-manager:script-4:target-script-1</pointer>
</targetScriptFullNameList>
<resultFilter></resultFilter>
</script.ScriptManager.executeCLIScript>
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
targetScriptFullNameList : List (
Pointer) - Identifies the list of target scripts to execute.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeCLIScriptException

executeCLITargetScripts

This method is called to execute target scripts with runtime parameters.

For example:

<script.ScriptManager.executeCLITargetScripts xmlns="xmlapi_1.0">
<isSynchronized>true<<isSynchronized>
<clientId>user@1</clientId>
<listOfTargetScriptConfigInfo>
<script.TargetScript>
<actionMask>
<bit>create</bit>
</actionMask>
<objectFullName>script-manager:script-6:target-script-1</objectFullName>
<script.TargetParameter-Set>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>1</value>
<objectFullName>script-manager:script-6:target-script-1:target-parameter-bitmask2</objectFullName>
<parameterName>bitmask2</parameterName>
</script.TargetParameter>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>1</value>
<objectFullName>script-manager:script-6:target-script-1:target-parameter-bitmask1</objectFullName>
<parameterName>bitmask1</parameterName>
</script.TargetParameter>
</script.TargetParameter-Set>
</script.TargetScript>
</listOfTargetScriptConfigInfo>
</script.ScriptManager.executeCLITargetScripts>
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
listOfTargetScriptConfigInfo : List (
generic.CommonManagedContainmentEntityConfigurationInformation) - The configuration info for the targets when executing (runtime parameters).
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeCLITargetScriptsException

executeScript

This method is called to execute target scripts.

For example:

<script.ScriptManager.executeScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<targetScriptFullNameList>
<pointer>script-manager:xmlApiScript-6:target-script-1</pointer>
</targetScriptFullNameList>
</script.ScriptManager.executeScript>
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
targetScriptFullNameList : List (
Pointer) - Identifies the list of target scripts to execute.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeScriptException

executeScriptFlow

This method is called to execute a script synchronously. Always latest versions are used, and target information is not stored, instead it is passed in during execution.
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
systemInvokationId : long - Identifies the client request ID that is uniquely identifying this particular request within the client. The client is responsible to generate a unique ID for each request. This value will be set on the script execution events that are created as a result of executing this request.
scriptName :
Pointer - Identifies the script to execute (version is not needed as latest version is executed). This is the fully distinguished name (FDN) of the script to be executed. Alternatively the unique name of the script can be used (scriptName of AbstractScript).
targetScriptConfig : config(script.TargetScript) - The configuration info for the target script when executing.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
result : script.ScriptFlowExecutionResult - The ScriptFlowExecutionResult object identifying the status and the result body of the executed script.
Exceptions:
script.ScriptManager.executeScriptFlowException

executeSystemScripts

This method is called to execute system scripts scripts. Versions are not supported with system scripts, and target information is not stored, instead it is passed in during execution.
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client Id that is requesting the execution (used for sending an event to the specific client when execution is complete).
scriptClassName : string - Identifies the script class name to execute.
scriptName : string - Identifies the script to execute (version is not needed as versions are not supported for system scripts).
listOfSystemScriptTargetConfigInfo : List (
generic.CommonManagedContainmentEntityConfigurationInformation) - The configuration info for the targets when executing.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeSystemScriptsException

executeTargetScripts

This method is called to execute target scripts with runtime parameters.

For example:

<script.ScriptManager.executeTargetScripts xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<listOfTargetScriptConfigInfo>
<script.TargetScript>
<actionMask>
<bit>create</bit>
</actionMask>
<objectFullName>script-manager:xmlApiScript-55:target-script-3</objectFullName>
<script.TargetParameter-Set>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>slope.Policy</value>
<objectFullName>script-manager:xmlApiScript-55:target-script-3:target-parameter-classToFind</objectFullName>
<parameterName>classToFind</parameterName>
</script.TargetParameter>
</script.TargetParameter-Set>
</script.TargetScript>
</listOfTargetScriptConfigInfo>
<</script.ScriptManager.executeTargetScripts>
Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
listOfTargetScriptConfigInfo : List (
generic.CommonManagedContainmentEntityConfigurationInformation) - The configuration info for the targets when executing (runtime parameters).
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeTargetScriptsException

executeTargetScriptsWithParameters

Input Parameters:
isSynchronized : boolean - Identifies if the call to execute the script should wait until all scripts have been executed. True to wait, false otherwise.
clientId : string - Identifies the client ID that is requesting the execution (used for sending an event to the specific client when execution is complete).
targetScriptFullNameList : List (
Pointer) - Identifies the list of target scripts to execute.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
infoList : List (generic.CommonManagedEntityInformation) - The list of TargetScriptResultInfo objects identifying the status of the executed target scripts.
Exceptions:
script.ScriptManager.executeTargetScriptsWithParametersException

getBodyOfTargetScriptResult

This method is called to get the result of an executed target script.
Input Parameters:
targetScriptResultObjectFullName : Pointer - The full name of the target script result object (from the TargetScriptResultInfo).
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
resultBody : string - The result of the executed script (returned as a string).
Exceptions:
script.ScriptManager.getBodyOfTargetScriptResultException

invokeUtilMethod

This method is used to pass the specific util method as an input for the execution of a script and will return the response of the executed util method as an object. Following are the supported alUtil methods: - alUtil.findByClass("aengr.Policy","and(equality(siteId,'xx.xx.xx.xx'),equality(policyName,'xx'))") - alUtil.resolveName("network:xx.xx.xx.xx:Access Egress:xx")
Input Parameters:
utilMethod : string - Specific util method as an input for the execution of a script.
resultFilter : ResultFilter - (Optional) Filter for narrowing down the information returned per object
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
responseObject : List (generic.CommonManagedEntityInformation) - Return the response of the executed util method as an object.
Exceptions:
script.ScriptManager.invokeUtilMethodException

previewScriptWithParameters

Input Parameters:
scriptFullName : Pointer - Identifies the script to preview (version is not needed as latest version is previewed).
parameters : Map (string to config(script.TargetParameter)) - The configuration info for the targets when previewing.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
previewText : string - The preview result.
Exceptions:
script.ScriptManager.previewScriptWithParametersException