script
TargetScript

This class defines the association between a target (e.g. network element) and a script. It contains the version and parameters that will be used when executing the script. Note: This object must be configured through the AbstractScript.



public class TargetScript

Properties
creationTime

type=Date

description The description of the target script instance.

type=string
default=
minimum=0
maximum=255
Displayed(tab/group)=Description

executionDate The execution date of a target script will be saved in the DB after each execution and will be displayed every time target script window is opened. Please note that displaying the execution date is not tied to script results.

type=Date

mtosi_id The unique ID of the target script.

type=long
access=read-create
default=0
minimum=1
maximum=2147483647
Displayed(tab/group)=Target Script ID

mtosi_version The version number of the script used for display purposes.

type=int
access=read-create
default=0

numberOfExecutions

type=long
default=0

numberOfSavedResults

type=int
default=0

script.LargeTextTargetParameter-Set type=Children-Set
script.TargetParameter-Set type=Children-Set
script.TargetScriptResult-Set type=Children-Set
spanObjectPointer A pointer to the parent spanEnabled object.

type=string
access=read-only
default=
minimum=0
maximum=252

state The state of the target script, only configured target scripts can be configured.

type=script.TargetScriptState
access=read-only
default=configured
Displayed(tab/group)=State

status The status of a target script will be saved in the DB after each execution and will be displayed every time target script window is opened. Please note that displaying the status is not tied to script results.

type=script.TargetScriptStatusType
default=unknown

targetName The name of the target script.

type=string
default=
minimum=0
maximum=255
Displayed(tab/group)=Name

targetObjectFullName The full name of the target script.

type=Pointer
access=read-create
default=N/A
Displayed(tab/group)=Target

versionFullName The full name of the associated version of the target script.

type=Pointer
default=N/A
Displayed(tab/group)=Version

versionMode The state of the target script, only configured target scripts can be configured.

type=script.ModeType
default=Released
Displayed(tab/group)=Version Mode

  
Properties inherited from ManagedObject
actionMask, children-Set, deploymentState, isFaultSquelched, name, objectFullName, selfAlarmed
 
Methods

cancelExecution

This method is used to cancel the execution of a target script. If a target script is currently executing, it will not cancel it, it must wait until the target script is finished. It will cancel a target script that is queued to execute.
Input Parameters:
instanceFullName : string - the full name of the object.
clientId : string - The client ID of the client that requested the cancel execution of the target script.
targetScriptResultObjectFullNameToBeCanceled :
Pointer - The target script result object full name that you want cancelled.
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
isCancelSuccessful : boolean - True if it could be cancelled, false otherwise.
Exceptions:
script.TargetScript.cancelExecutionException

configure

This method is used to configure the target script. It can be used to modify the parameters or the name, but it can not be used to change the version (see AbstractScript for more details).
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.
instanceFullName : string - the full name of the object.
configInfo : generic.CommonManagedContainmentEntityConfigurationInformation - The target 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 : Pointer - The target script full name.
Exceptions:
script.TargetScript.configureException

executeCLIScript

This method is used to execute a CLI target script.

For example:

<script.TargetScript.executeCLIScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<instanceFullName>script-manager:script-4:target-script-1</instanceFullName>
<resultFilter></resultFilter>
</script.TargetScript.executeCLIScript>
Input Parameters:
instanceFullName : string - the full name of the object.
isSynchronized : boolean - Identifies if the call to execute the script should wait until the script has 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).
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:
targetScriptResult : generic.CommonManagedContainmentEntityInformation - The list of TargetScriptResultInfo object identifying the status of the executed target script.
Exceptions:
script.TargetScript.executeCLIScriptException

executeCLITargetScript

This method is used to execute a target script with runtime parameters.

For example:

<script.TargetScript.executeCLITargetScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<instanceFullName>script-manager:script-17:target-script-1</instanceFullName>
<configInfo>
<item>
<key>script-manager:script-17:target-script-1:target-parameter-portId</key>
<value>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>1/1/2</value>
<parameterName>portId</parameterName>
</script.TargetParameter>
</value>
<value>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>1/1/2</value>
<parameterName>portId</parameterName>
</script.TargetParameter>
</value>
</item>
</configInfo>
</script.TargetScript.executeCLITargetScript>
Input Parameters:
instanceFullName : string - the full name of the object.
isSynchronized : boolean - Identifies if the call to execute the script should wait until the script has 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).
configInfo : Map (
Pointer to generic.CommonManagedEntityConfigurationInformation) - 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:
targetScriptResult : generic.CommonManagedContainmentEntityInformation - The list of TargetScriptResultInfo object identifying the status of the executed target script.
Exceptions:
script.TargetScript.executeCLITargetScriptException

executeScript

This method is used to execute a target script.

For example:

<script.TargetScript.executeScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<instanceFullName>script-manager:xmlApiScript-56:target-script-3</instanceFullName>
<resultFilter></resultFilter>
</script.TargetScript.executeScript>
Input Parameters:
instanceFullName : string - the full name of the object.
isSynchronized : boolean - Identifies if the call to execute the script should wait until the script has 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).
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:
targetScriptResult : generic.CommonManagedContainmentEntityInformation - The list of TargetScriptResultInfo object identifying the status of the executed target script.
Exceptions:
script.TargetScript.executeScriptException

executeTargetScript

This method is used to execute a target script with runtime parameters.

For example:

<script.TargetScript.executeTargetScript xmlns="xmlapi_1.0">
<isSynchronized>true</isSynchronized>
<clientId>user@1</clientId>
<instanceFullName>script-manager:xmlApiScript-55:target-script-3</instanceFullName>
<configInfo>
<item>
<key>script-manager:xmlApiScript-55:target-script-3:target-parameter-classToFind</key>
<value>
<script.TargetParameter>
<actionMask>
<bit>create</bit>
</actionMask>
<value>rp.PolicyStatement</value>
<parameterName>classToFind</parameterName>
</script.TargetParameter>
</value>
</item>
</configInfo>
</script.TargetScript.executeTargetScript>
Input Parameters:
instanceFullName : string - the full name of the object.
isSynchronized : boolean - Identifies if the call to execute the script should wait until the script has 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).
configInfo : Map (
Pointer to generic.CommonManagedEntityConfigurationInformation) - 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:
targetScriptResult : generic.CommonManagedContainmentEntityInformation - The list of TargetScriptResultInfo object identifying the status of the executed target script.
Exceptions:
script.TargetScript.executeTargetScriptException

preview

This method is used to preview targets based on the script version and the parameters configured for the target.
Input Parameters:
instanceFullName : string - the full name of the object.
configInfo : Map (
Pointer to generic.CommonManagedEntityConfigurationInformation) - The configuration info for the targets when executing (runtime parameters).
continueOnFailure : continueOnFailure - (Optional) Continue processing requests in this stream if an exception occurs, unless the request is invalid. Default: false
Output Parameters:
targetBody : string - The preview result.
Exceptions:
script.TargetScript.previewException