Plugin Documentation
Table of Contents
Introduction
A number of generic and re-usable plugins have been created for DirectedGraph. The word plugin here means a karaf extension that can be installed in the controller and called by SLI.
SLI requires the java interface follow a set interface (SvcLogicJavaPlugin) to function properly.
Once the karaf extension is installed in the controller the directed graphs can freely call that plugin. Many times this is done through an execute node.
Properties Node
The code is hosted in gerrit under the sdnc/plugins directory. This node loads a properties file on disk and puts the contents into context memory so they can be accessed.
RestapiCallNode
Obsolete ? The code is hosted in gerrit under the sdnc/plugins directory. This node allows a directed graph to make REST requests. The javadocs are very helpful.
New December 2018 :
Plugins are in the CCSDK plugin project since Casablanca release.
There are 2 RestAdapter plugins but I advice to use only the following plugin with SDNC or APPC :
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="restapiUrl" value="`$distant_url`" />
<parameter name="httpMethod" value="get"/>
<parameter name="responsePrefix" value="RESPONSE"/>
httpMethod will be get, post, delete, put, patch
requestBody will contain the body of your post/put/patch
more details in the code : https://gerrit.onap.org/r/#/admin/projects/ccsdk/sli/plugins
have a look at RestapiCallNode.java source code to have a complete view on Parameters
SQL Resource
The code is hosted in gerrit under the sdnc/adaptors directory . This resource allows a graph to run SQL statements against a SQL database. If it is a query results are written to context memory.
Any time you have context memory values in a SqlResource block the white space around them is absolutely crucial. If the whitespace was removed from the above query it would not function properly.
Sample code blocks are below.
insert
<save plugin='com.att.sdnctl.sli.resource.sql.SqlResource'
resource='SQL'
key='INSERT INTO DATA_OBJECT_MAPPING (data_object_key, data_object_type, service_type, data_object_key2, data_object_key2_type) VALUES ( $service-data.service-information.service-instance-id ,"uCPE","uCPE", $service-data.ucpe-request-information.ucpe-host-name ,"ucpe-hostname")'
force='true' pfx='save-result'>
select
<get-resource plugin="com.att.sdnctl.sli.resource.sql.SqlResource" resource="SQL"
key=
"SELECT * FROM DEVICE2IPADDRESS_CONSUMPTION where
device_id = $customize-ips-request-input.customize-ips-information.vnf-loopback-ip-blocks[$j].vnf-name AND
address_type = 'NMLAN' AND
ip_version = 'Ipv6' ;
"
pfx="tmp.DEVICE2IPADDRESS_CONSUMPTION_V4_CONSUMPTION_Update">
delete
<delete
plugin='com.att.sdnctl.sli.resource.sql.SqlResource'
resource="SQL"
key="DELETE FROM DEVICE2IPADDRESS_MAPPING WHERE device_id = $service-data.service-information.service-instance-id">
update
<save plugin='com.att.sdnctl.sli.resource.sql.SqlResource'
resource='SQL'
key='UPDATE VPE_LOCK SET vpn_lock = $vpe-lock.vpe-lock-type WHERE vpe_name = $vpe-lock.vpe-name'
force='true' pfx='save-result'>
SliPluginUtils
The code is hosted in gerrit under the sdnc/core directory. The javadocs are very helpful .
Notable methods:
generateUUID - generates a UUID and writes it to context memory
setTime - generates a timestamp and writes it to context memory
printContext - dumps content memory to a text file for easy debugging
SliStringUtils
This comes packaged with SliPluginUtils. The javadocs are very helpful . The class exposes existing Java string methods to directed graph.
DME2
This comes packaged with SliPluginUtils. Further details can be found at DME2 (fill in link).
AAI Service
This plugin allows directed graphs to communicate with AAI. It is complex so it has separate pages hosted at AAIService (fill in link).