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
Amsterdam DG
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.
Node | Comment |
---|---|
DGSTART | Standard starting node for any DG |
Module | This matches our YANG Model name VCPE-API |
Method | The RPC that will be used by the northbound system to call SDNC |
BLOCK | wrap these nodes into a succes/fail transaction with "atomic" one branch at a time execute |
RECORD | Save some data to a file. Click on the node to see the fields that are being saved |
SET | Set the order status to Active |
SET service data to input | In 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 indicator | Set the response on success. A real DG has error legs we are worrying about in this example |
RETURN : Success | HTTP 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
- Go to the swagger ui on the SDNC controller at http://<sdnc_ip:8282/apidoc/explorer/index.html
- Select the SLI-API to open up its methods
- Select the "/operations/SLI-API:execute-graph"
- Paste the json string from the first step into the box
Click on "Try It out!"
- You should see a 200 ok response and any data returned by the Directed Graph
Log into SDNC and check the svclogic.log and see the results.
Other Topics
Understanding the the GENERIC-RESOURCE-APIs
Next Steps
- You can add additional parameters to the input JSON and create input for other operations like vBRG config
- You can add a REST API CALL Node to call the Netconf interface to configure a vGW device
- You can add an AAI node to update AAI
- You can repeat this process for other Directed Graph like Deactivate
7 Comments
Geora Barsky
What is username/password to access SLI-API swagger UI: http://<sdnc_ip:8282/apidoc/explorer/index.html
I tried admin/admin - not working
Thank you
Sudhakar Reddy
Try admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
Geora Barsky
Thank you
that one works
krishna moorthy
This error occurs when i try to upload the XML. I used the above directed graph. Is there any dependencies to be added for SDNC component? I have set up the onap platform on kubernetes.
Thank you.
Brian Freeman
Its seems like its something to do with the copy from clipboard. Open the Service Logic Node (the node after DG Start) and simply close the node , SAVE and then try upload xml. I think the issue is the DG in the wiki is pre-Amsterdam and now there is something new in Amsterdam that is resolved if the node is opened and re-saved.
I added an Amsterdam JSON string - see if either method works for you.
Try that and reply with results.
krishna moorthy
Yeah. Tried your solution. It's working now. Thank you so much
Chetan Singh
krishna moorthy
Brian Freeman
I was trying the above tutorial ( deployed sdnc ) but in the swagger UI i dont have the SLI-API module . Is there a way to enable it ? can you give some pointers?