RapidOSS integrates with other systems via datasources. Datasources encapsulate the connection information and use the operations of the underlying custom adapter to operate on the external system.
Smarts plugin adds two new datasources to the existing datasources of RapidOSS:
- SmartsNotificationDatasource
- SmartsTopologyDatasource
Different instances (for different Smarts servers) of these two datasources are available in your scripts to operate on notifications or topology objects in your Smarts server.
In order to call the operations on any datasource:
- an instance of the datasource must have been created and
- the instance should be retrieved in the script
Defining Instances of Datasources
While defining a Smarts connector in the Smarts tab of the admin UI, an instance of the notification or the topology datasource along with an instance of smarts connection will be created for you. If the name of your connector is MyConn then the name of the datasource will be:
- MyConnNotificationDs - if connector type is Notification
- MyConnTopologyDs - if connector type is Topology
Retrieving an Instance and Invoking Operations
Here is an example script where an instance of a notification datasource and an instance of a topology datasource are retrieved and operations are invoked.
def samNotifDs = SmartsNotificationDatasource.get(name:"MyConnNotificationDs")
def samTopoDs = SmartsTopologyDatasource.get(name:"MyConnTopologyDs")
def localDeviceName = samTopoDs.getProperty(["CreationClassName":"IP", "Name":"InstanceNameIP"], "SystemName")
def peribitProps = samTopoDs.getProperties(["CreationClassName":"PeribitSession", "Name":peribitTunnelName], ["Prop1", "Prop2", "Prop3"]);
def tunnelObj = samTopoDs.getObject(["CreationClassName":"IPSecTunnel", "Name":"IPSecTunnelInstance"])
def notifyParams = [EventName:"Down", ClassName:"IPSecTunnel", InstanceName:"IPSecTunnelInstance", Severity:"1"]
notifyParams.EventText = "Primary IPSec Tunnel IPSecTunnelInstance is Down"
samNotifDs.addNotification(notifyParams)
samNotifDs.clearNotification(["ClassName":"IPSecTunnel", "InstanceName":"IPSecTunnelInstance" , "EventName":"Down"])
 | Best documentation on the available operations for Smarts datasources are the source files themselves. These operations are defined in the following 2 files:
- RS_HOME/RapidSuite/operations/datasource/SmartsNotificationDatasourceOperations.groovy
- RS_HOME/RapidSuite/operations/datasource/SmartsTopologyDatasourceOperations.groovy
|
Add Comment