- Prime Network Customization Overview
- Modeling and Displaying Additional NE Properties
- Adding Support for New Devices, Software Versions and Modules Using the VCB
- Creating Commands and Command Scripts to Perform Device Configuration Operations
- Deploying Activation Workflows to Devices Using Transaction Manager
- Adding Support for New Events Using the VCB
- Adding New Threshold-Crossing Alarms
- Adding External Launch Points to the GUI Client
- Soft Properties: Supported Parsing Operators, Rules, and Regular Expressions
- VCB: CLI Commands and Template Reference
- Command Manager and Command Builder: Macro Language and Beanshell Reference
Adding External Launch Points to the GUI Client
These topics describe how to add launch points from Prime Network to external applications:
Overview: Adding External Launch Points
If you have configurator or higher privileges, Prime Network allows you to add right-click menu options to elements in order to launch external applications or URLs. These are called external launch points. When the external launch point is clicked, it invokes the external application (for example, a script or batch file), or opens the specified URL in the default browser. Figure 8-1 illustrates a new launch point named My Utilities.
Figure 8-1 External Launch Point Example
You can add launch points to any IMO, including network elements, links, tickets, and events. You identify the IMO according to IMO type. The launch points appear as additional right-click menu options on all IMOs of the specified type.
You can narrow down the instances on which the external launch point appears by filtering by any of the properties of the IMO. You can also create a launch point on a property of a referenced IMO.
When you add a launch point, the site.xml file is updated on the Prime Network gateway. The new launch point (right-click menu option) will appear in all Prime Network clients that connect to the gateway.
The scripts or batch files used in the external launch point definition can be copied to one of the following locations:
- The Prime Network client machine—In this case, the launch point will only be functional on that client.
- The Prime Network gateway, under the Main/webstart/scripts directory—In this case, the scripts will be downloaded automatically to all clients associated with the gateway, upon next login. The launch points will be functional from all these clients. Please follow the instructions in Enabling Automatic Download of BQL Scripts to Clients, to enable the automatic download of the scripts to the clients.
- A shared location.
Adding an External Launch Point to the GUI Client
Adding an external launch point involves the following steps:
1. Identifying the IMO Context and Properties
4. Enabling Automatic Download of BQL Scripts to Clients
Note You should maintain a list of all the IMO contexts where launch points have been added, as there is no way to get such a list from the system. This will enable you to update or delete external launch points at a later stage.
Identifying the IMO Context and Properties
To identify the IMO context and properties:
Step 1 Select a network element from the Tree pane.
Step 2 Press F2. The All Properties viewer appears in a separate window.
Step 3 Make a note of the IMO type. If you are in the Map pane, you should make a note of the IMO type that is part of ContainedIMO and not part of IHierarchyNode; for example, IPortConnector or IManagedElement.
Example 1: Identifying IManagedElement in the Tree pane:
Example 2: Identifying IPortConnector in the Tree pane:
Example 3: Identifying IManagedElement in the Map pane:
Step 4 Make a note of the property key name; for example, in IManagedElement write down IP; in IPortConnector write down PortAlias.
Creating BQL Scripts
Read the Cisco Prime Network Integration Developer Guide for an understanding of Broadband Query Language (BQL), and as a prerequisite to understanding this section.
Table 8-1 describes the format and syntax that you must follow when writing the BQL set command to launch an external application:
|
|
|
---|---|---|
|
||
|
The OID contains the context and unique name of the external launch point. It defines the IMO type on which the external launch point is defined, for example: |
|
type="management.IExternalLaunchFilterParameter"> <Value type="String">reg-exp</Value> <Property type="String">ObjectId.Key</Property> </management.IExternalLaunchFilterParameter> <management.IExternalLaunchFilterParameter type="management.IExternalLaunchFilterParameter"> <Value type="String">reg-exp</Value> <Property type="String">@IBusinessObject.Notes</Property> </management.IExternalLaunchFilterParameter> type="management.IExternalLaunchFilterParameter"> <Value type="String">reg-exp</Value> <Property type="String">~time~</Property> </management.IExternalLaunchFilterParameter> type="management.IExternalLaunchFilterParameter"> <Value type="String">reg-exp</Value> <Property type="String">ScriptMetadataOids</Property> <Match type="String">all</Match> </management.IExternalLaunchFilterParameter> type="management.IExternalLaunchFilterParameter"> |
Enables you to apply a filter to narrow down the instances on which the external launch point will be available. For example, you can use this filter if you want only IMOs with specific properties to have the external launch point, rather than all IMOs of the specified type. You can use any of the IMO’s properties in the filter. The filter property value can be:
Multiple filter criteria are also supported. The |
|
|
Defines the details of the executable steps or batch file to be invoked. You:
To define a string that represents the URL or script which is executed along with its parameters, use the LinetoExecute property. |
|
Launching a URL with the Gateway IP, network element IP, and logged-in username parameters, using / as delimiter: Launching a URL from the soft property from the interface of the supported IMO: |
Defines a string that represents the URL or script which is executed along with its parameters.
Note The & character should be written as You can define the launch point of the external application from a soft property of the supported IMO by using the OID of the supported IMO. Note The soft property need to be already defined in the IMO of the supported network element. |
|
The wording of the right-click menu option to be used for the external launch. Note Unless you want to create a mnemonic, do not use an underscore ( |
||
The menu path to be followed to get to the external launch point. You can have a sub-menu separated by a forward slash (/). |
||
|
All external launch parameters must be passed in an array. See management.IExternalLaunchParameter. |
|
|
Defines the minimum user role required to use the launch point—administrator, configurator, and so on. If this is not defined, all users will have access to the launch point. |
|
|
Defines the number of items that must be selected for the launch point to be displayed. For example, if the selection limit is 2, the right-click menu option will not appear if only one item is selected, or if three items are selected. It will only appear if two items are selected. |
|
|
||
Index value defines the order in which the parameters will be passed to the script. |
||
|
Defines the IMO context type. You can also leave this field empty. You can pass the parameter not only from the IMO and its parent on which you set the menu but also from the IMO tree up to IManagedElement. It can be the parent or the higher level IMO depending on the IMO that you have selected for your menu. |
|
<PropertyName type="String">LatestState</PropertyName> Example 3 (retrieving properties of a contained IMO): <PropertyName type="String">ObjectId.Key</PropertyName> Example 4 (retrieving properties not available at time of execution): <PropertyName type="String">Port#PortDescription</PropertyName> |
Defines the property or soft property name within the IMO context type. This value is used as an argument when invoking the application. You can also have any constant value. If the property value is another IMO, you can retrieve the properties of this IMO using a dot notation (see Example 3). If the property value is an OID, you can retrieve the properties of the referenced IMO using the # notation (see Example 4). |
|
The script will be called once, with the required properties of all selected IMOs passed at the same time. |
If the value is set to true, a single script will be run for all the selected objects. If set to false, a script will be run for each of the selected objects. |
|
|
If you want a null value not to be ignored or replaced with an empty string, you can use the ReplaceNullWith string. This is optional. In the example, the null value will be replaced by N/A. See Defining Soft Property Parameters for a BQL Script for more information on the usage of this property. |
Defining Soft Property Parameters for a BQL Script
You can use a soft property as a parameter in an external launch BQL command. You can specify the soft property that you want to define the external launch to be performed. To specify this, enter the following in the line to execute property of the BQL Command:
<LineToExecute type="String">http://url.example.com/$GW$/$com.sheer.imo.IEthernetService.NetworkElemnt#~soft property~$/$USERNAME$</LineToExecute>
To define a soft property parameter you need to write the soft property name (not the label) in the PropertyName entry, and add the following entry to the parameter definition:
<SoftProperty type="boolean">true</SoftProperty>
If you do not add this entry, by default the value is assumed to be false.
Parameters that have the value true for the soft property entry are not validated in the definition of the command.
The launch point will be visible even if the IMO does not have the soft property defined on it. When a soft property is not defined, an appropriate message is displayed after the command is run.
Note If you create an ExternalBatchtoExecute-based external launch command that includes a soft property and the specified soft property does not exist on the IMO, the output will have an empty string (" "). This is to ensure that any logic built in to the script which depends on the parameter order, functions as desired. You may use the ReplaceNullWith external launch command parameter if you want to get a different string for the null value.
Running BQL Scripts
See the Cisco Prime Network Integration Developer Guide to understand how to run a BQL script.
Enabling Automatic Download of BQL Scripts to Clients
You have the option to have the scripts downloaded automatically to all clients associated with the gateway, upon next login.
To enable automatic download of scripts to clients:
Step 1 Create a directory for your scripts under the Main/webstart/scripts directory on the Prime Network gateway.
Step 2 Run [~/Main/scripts]% updateXLaunchScripts.pl on the gateway to update the auto-deployable scripts jar.
The next time a client connects to the gateway, the scripts will be downloaded and extracted by the client application.
Deleting an External Launch Point
You can delete an external application launch point using the BQL Delete command.
Note See the Cisco Prime Network Integration Developer Guide for an understanding of BQL, and as a prerequisite to understanding this section.
Step 1 Create a BQL script with the Delete command as shown below:
Step 3 Launch Prime Network Vision to verify that the launch point has been removed.
Sample BQL Scripts for Launching External Applications
This chapter provides example scripts for launching external applications using BQL.
Note See Table 8-1 for details on the syntax used in the commands.
For details about the format an d the syntax of BQL scripts, see Creating BQL Scripts.
Note <param name = “replace”>
is always set to true. This value replaces the old value with the new value based on the script that is invoked.
Example 1
This example runs a single script on the selected tickets with their latest state and last modification time as parameters.
Example 2
This example runs a single script on the selected tickets with their latest state and last modification time as parameters, for tickets that include Layer 2 in their description.
Example 3
This example includes a soft property parameter in a BQL command for an external launch point on a network element.
Example 4
This example uses a batch file to invoke an application.
Example 5
This example executes a script C:/script.batch
with parameters PortAlias and the logged-in username.
(Name=example)]}</ID
Example 6
This example launches a URL with parameter values Gateway IP, the NE IP and the logged-in username, using / (forward slash) as delimiter.
Example 7
This example launches a URL with parameters a, b, and c, whose values are the soft property showClock
, a constant string constant
, and the logged-in username.
Example 8
This example launches a URL with parameters a, b, c, and d, whose values are the IMO property IP, property PortAlias, a constant string any_const_parameter
, and the logged-in username, using the existing Parameters element.
Example 9
This examples uses an environment variable to invoke an application.
Example 10
This example uses multiple IMO contexts to launch an application.