Update INFO.yaml with new PTL
[demo.git] / vnfs / TestVNF / README.md
1 # TestVNF - NetconfServer
2
3 TestVNF - NetconfServer is a partial implementation of a netconf server for netconf termination. It uses [Apache MINA SSHD](https://github.com/apache/mina-sshd) and extends a netconf subsystem.
4 The system doesn't provide persistence out of the box even though it could be done through groovy files, which remain external to the system and takes actions based on netconf operations.
5
6 ## Requirements
7 * Java 8
8 * Maven
9 * MariaDB
10
11 ## Usage
12
13 ### To run the maven project
14 Go to netconfserver and execute the following commands in a terminal.
15
16         $ mvn package
17
18 The jar file is created in the target folder
19         
20         $ java -cp target/netconfsystem-jar-with-dependencies.jar com.ericsson.testvnf.server.Server <NETCONFTEMPLATESDIRECTORY> <TIMEDELAYFORSENDINGEVENTS>
21
22 Run the jar file. Also, specify the arguments.
23         
24 NETCONFTEMPLATESDIRECTORY is the directory which contains the netconf templates, YANG models and the groovy files to be executed based on netconf RPC request.
25 TIMEDELAYFORSENDINGEVENTS is the time delay in milliseconds set between sending each of the events by the VNF.
26
27 The values for host and port are taken from <NETCONFTEMPLATESDIRECTORY>/netconftemplates/server-config.properties. If the config file is missing, then the server is started on the default value 0.0.0.0:2052
28
29 * __sample rpc requests__ directory contains some sample rpc requests to test the TestVNF.
30
31 * __netconftemplates__ directory contains sample netconftemplates and groovy files for performing actions based on netconf requests.
32
33 ### To run in docker
34 Go to docker directory for details on how to run the netconf server in docker.
35
36 ## Description
37 TestVNF - NetconfServer is a partial implementation of a netconf server for netconf termination. It uses Apache MINA SSHD and extends a netconf subsystem..
38 Action taken by the netconf server is kept independent of the server implementation. Groovy files used to perform actions based on netconf RPC operations are kept external to the project in a directory or in an FTP server. The location is passed while running the project. This external directory will also contain the sample templates and yang models to be used by the server.
39
40 ## Example
41 A client is connecting to the netconf server.
42 The server sends back a hello message from the location <NETCONFTEMPLATESDIRECTORY>/netconftemplates/hello.xml
43
44 The client then sends an edit-config netconf request on the candidate data store.
45 The server parses the RPC request from the client and gets the operation and configuration datastore. Based on these the correct groovy file is selected and the data is sent to that groovy file. 
46
47 <NETCONFTEMPLATESDIRECTORY>/netconftemplates/edit-config/candidate/response.groovy is the groovy file selected in this case.
48
49 If the operation doesn't involve a configuration data store, for example, for close-session
50
51 <NETCONFTEMPLATESDIRECTORY>/netconftemplates/close-session/NA/response.groovy is executed by the system.
52
53 ### Custom operations
54 The netconf system supports custom operations without the need for recompiling the project.
55 Consider a custom operation send-models which send events to a specified target one by one with a time delay.
56
57 A client can get the schema of this operation by sending a get-schema request to the server.
58 The server picks up the correct yang models and sends back to the client. For this, the model has to be present in the netconftemplates directory as <operation_name>-schema.yang.
59
60 <NETCONFTEMPLATESDIRECTORY>/netconftemplates/send-models-schema.yang is selected in the aforementioned case.
61
62 When the client sends a send-models request to the server, the action is performed by executing the below groovy file.
63
64 <NETCONFTEMPLATESDIRECTORY>/netconftemplates/send-models/NA/response.groovy
65
66 When an edit-config request with the same target name as specified in send-models request is sent to the netconf system, the sending of events is terminated.