Create the SLI-API input model

Here is a simplistic model of the attributes that might be needed as input to the VCPE-API:vcpe-vgw-activate REST API call from SO to SDNC. The module-name and rpc-name must match the Directed Graph you will be creating in the next section. The parameters section contains the parameters that you would expect to get in from SO.

This is not a complete list but should give you a framework for prototyping.


Save this as a text file so you can copy/paste it into the SDNC apidoc swagger interface in step 3. For now the parameter names will be the variables we use in the Directed Graph in step 2.

{
"input": {
	"module-name": "VCPE-API",
	"rpc-name": "vcpe-vgw-activate",
	"mode": "sync",
	"sli-parameter": [
		{
			"parameter-name": "vcpe-vgw-activate-input.vgw-oam-address",
			"string-value": "10.1.20.2"
		}, 
		{
		"parameter-name": "vcpe-vgw-activate-input.vgw-vlanid",
		"string-value": "101"
		},
		{
		"parameter-name": "vcpe-vgw-activate-input.dcae-collector-ip",
		"string-value": "10.0.0.1"
		}
		]
	}
}



Create the Directed Graph

Go to the dbguilder applicaiont on port 3000 of the SDNC (http://10.0.7.1:3000/#)  login with dguser/test123

Create a new tab by clicking on the "+" simbol on the right hand side if you dont have a blank pane already.

Here is a getting started json string

[{"id":"d79d0d35.a622a8","type":"dgstart","name":"DGSTART","outputs":1,"x":112,"y":62,"z":"9a684888.3f2538","wires":[["e8368657.f2d8f"]]},{"id":"e8368657.f2d8f","type":"service-logic","name":"VCPE-API 0.0.1-DEMO","module":"VCPE-API","version":"0.0.1-DEMO","comments":"","xml":"<service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='VCPE-API' version='0.0.1-DEMO'>","outputs":1,"x":318.1666564941406,"y":87.16667175292969,"z":"9a684888.3f2538","wires":[["69f272d9.6bf4f4"]]},{"id":"69f272d9.6bf4f4","type":"method","name":"method vcpe-vgw-activate","xml":"<method rpc='vcpe-vgw-activate' mode='sync'>\n","comments":"","outputs":1,"x":182.16668701171875,"y":151.16665649414062,"z":"9a684888.3f2538","wires":[["2cdda2a7.c88146"]]},{"id":"2cdda2a7.c88146","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":390,"y":239,"z":"9a684888.3f2538","wires":[["2fed121c.e86f76","f5677f8e.1ec748","942de7f6.8bda2","100c8a63.bf0bee","d9c7cd5d.e69768"]]},{"id":"2fed121c.e86f76","type":"set","name":"set: order-status = Active","xml":"<set>\n\t<parameter name=\"service-data.oper-status.order-status\" value=\"Active\"/>","comments":"","x":612,"y":351,"z":"9a684888.3f2538","wires":[]},{"id":"100c8a63.bf0bee","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n\t<parameter name=\"error-code\" value=\"200\" />","comments":"","x":584,"y":538,"z":"9a684888.3f2538","wires":[]},{"id":"f5677f8e.1ec748","type":"set","name":"set: service-data = input","xml":"<set>\n\t<parameter name=\"service-data.\" value=\"vcpe-vgw-activate-input.\" />","comments":"","x":611.8888854980469,"y":452.388916015625,"z":"9a684888.3f2538","wires":[]},{"id":"942de7f6.8bda2","type":"set","name":"Set final indicator to Y","xml":"<set>\n<parameter name=\"ack-final\" value=\"Y\"/>","comments":"","x":606.2063369750977,"y":496.1031608581543,"z":"9a684888.3f2538","wires":[]},{"id":"d9c7cd5d.e69768","type":"record","name":"record","xml":"<record plugin=\"org.openecomp.sdnc.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/svclogic.log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"vcpe-vgw-activate\"/>\n<parameter name=\"field3\" value=\"`$vcpe-vgw-activate-input.vgw-oam-address`\"/>\n","comments":"","outputs":1,"x":560,"y":282,"z":"9a684888.3f2538","wires":[[]]}]


Amsterdam DG

[{"id":"38bd709c.175368","type":"dgstart","name":"DGSTART","outputs":1,"x":178.5,"y":80,"z":"f2df1f12.6ab348","wires":[["d0de403c.350ae8"]]},{"id":"d0de403c.350ae8","type":"service-logic","name":"VCPE-API 0.0.1-DEMO","module":"VCPE-API","version":"0.0.1-DEMO","comments":"","xml":"<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='VCPE-API' version='0.0.1-DEMO'>","outputs":1,"x":384.6666564941406,"y":105.16667175292969,"z":"f2df1f12.6ab348","wires":[["ea270635.56b8e"]]},{"id":"ea270635.56b8e","type":"method","name":"method vcpe-vgw-activate","xml":"<method rpc='vcpe-vgw-activate' mode='sync'>\n","comments":"","outputs":1,"x":248.66668701171875,"y":169.16665649414062,"z":"f2df1f12.6ab348","wires":[["39ffd5bc.c63c62"]]},{"id":"39ffd5bc.c63c62","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":456.5,"y":257,"z":"f2df1f12.6ab348","wires":[["b5a325da.3ccee8","d565b9ae.cc476","f1c4d756.c5524","9cd0f957.1aba88","47578ecb.8dd218"]]},{"id":"b5a325da.3ccee8","type":"set","name":"set: order-status = Active","xml":"<set>\n\t<parameter name=\"service-data.oper-status.order-status\" value=\"Active\"/>","comments":"","x":678.5,"y":369,"z":"f2df1f12.6ab348","wires":[]},{"id":"d565b9ae.cc476","type":"set","name":"set: service-data = input","xml":"<set>\n\t<parameter name=\"service-data.\" value=\"vcpe-vgw-activate-input.\" />","comments":"","x":678.3888854980469,"y":470.388916015625,"z":"f2df1f12.6ab348","wires":[]},{"id":"f1c4d756.c5524","type":"set","name":"Set final indicator to Y","xml":"<set>\n<parameter name=\"ack-final\" value=\"Y\"/>","comments":"","x":672.7063369750977,"y":514.1031608581543,"z":"f2df1f12.6ab348","wires":[]},{"id":"9cd0f957.1aba88","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n\t<parameter name=\"error-code\" value=\"200\" />","comments":"","x":650.5,"y":556,"z":"f2df1f12.6ab348","wires":[]},{"id":"47578ecb.8dd218","type":"record","name":"record","xml":"<record plugin=\"org.openecomp.sdnc.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/svclogic.log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"vcpe-vgw-activate\"/>\n<parameter name=\"field3\" value=\"`$vcpe-vgw-activate-input.vgw-oam-address`\"/>\n","comments":"","outputs":1,"x":626.5,"y":300,"z":"f2df1f12.6ab348","wires":[[]]}]


Copy it to your clipboard

On dgbuilder page, select the  menu on the right hand side (the three stackk horizonal bars ) and select "import" and "clipboard"

Paste the json string into the dialog box

Move the resulting DG around the pane.



NodeComment
DGSTARTStandard starting node for any DG
ModuleThis matches our YANG Model name VCPE-API
MethodThe RPC that will be used by the northbound system to call SDNC
BLOCKwrap these nodes into a succes/fail transaction with "atomic" one branch at a time execute
RECORDSave some data to a file. Click on the node to see the fields that are being saved
SETSet the order status to Active
SET service data to inputIn a real application we copy input to the md-sal tree via this type of node. Doing it late in the tree lets us know what existing already in md-sal to distringuish an update from a new.
SET final indicatorSet the response on success. A real DG has error legs we are worrying about in this example
RETURN : SuccessHTTP 200 return of success


Save the DG  using the big red button in the upper right corner

Click on the DGStart node and upload the XML 


Note: you may need to point your dgbuilder at port 32768 running dbguilder outside of the SDNC VM.



Click on the "Activate" link in the DG list to Activate the DG




Your DG is now read for testing.

Use the SLI-API to test the DG and any Adapter nodes


  1. Go to the swagger ui on the SDNC controller at http://<sdnc_ip:8282/apidoc/explorer/index.html
  2. Select the SLI-API to open up its methods
  3. Select the "/operations/SLI-API:execute-graph"
  4. Paste the json string from the first step into the box 



  5. Click on "Try It out!"

  6. You should see a 200 ok response and any data returned by the Directed Graph
  7. Log into SDNC and check the svclogic.log and see the results.


Other Topics

Understanding the the GENERIC-RESOURCE-APIs



Next Steps

  1. You can add additional parameters to the input JSON and create input for other operations like vBRG config
  2. You can add a REST API CALL Node to call the Netconf interface to configure a vGW device
  3. You can add an AAI node to update AAI  
  4. You can repeat this process for other Directed Graph like Deactivate