Expose file via FTPES
[integration.git] / test / mocks / pnfsimulator / README.md
1 # PNF Simulator
2 Simulator that generates VES events related to PNF PNP integration.
3
4 ##Downloading simulator
5 Official version of simulator can be downloaded for public ONAP docker registry as image.
6 *docker login -u anonymous -p anonymous nexus3.onap.org:10003*
7
8 Another option is to checkout PNF Simulator project from ONAP Git repository.
9
10 ##Usage of simulator
11
12 ###Configuration
13 The configuration for simulator is stored in */config/config.json* file. 
14 It contains all parameters for simulation such as duration time,interval between messages and values of the configurable fields of VES message. 
15 If you want to change duration or value of message sending to VES collector you just need to edit this file. 
16 The message that is being sent to VES is built inside the simulator and it's content can be found in log of the simulator. 
17 Proper config must contain *simulatorParams*, *commonEventHeaderParams* and *pnfRegistrationParams* or notificationParams. 
18
19 ###Running simulator   
20 The recommended way is to checkout PNF Simulator project from ONAP Git repository and use *simulator*.sh script.
21 If you copy *simulator.sh* script to another location, keep in mind to copy also *docker-compose.yml* and directories: *config,json_schema and netconf*.
22 In order to run simulator, invoke ./simulator.sh start
23 Script downloads if necessary needed Docker images and runs instances of these images.
24
25 ###Logging
26 It is possible to get access to logs by invocation of *./simulator.sh* logs. 
27 The content of the logs is related to the last simulator run. 
28 Every start of simulator will generate new logs. 
29
30 ###SFTP support
31 PNF Simulator allows to serve files via SFTP server. SFTP server has predefined user sftp-user. 
32 Connection to SFTP server is being done with usage of SSH keys. Private key is stored in *ssh* directory.
33 In order to download *sftp-file.txt* file simply run *sftp -P 2222 -i ssh/ssh_host_rsa_key sftp-user@localhost:sftp/sftp-file.txt*
34 In order to add a new file (e.g. test.zip), put the file into *sftp* directory and run simulator.
35 After that again execute sftp command: *sftp -P 2222 -i ssh/ssh_host_rsa_key sftp-user@localhost:sftp/test.zip*
36 In order to disable usage of SSH keys and start using password, change in *docker-compose.yml* service *sftp-service* entry *command* from *sftp-user::1001* to *sftp-user:password:1001*
37
38 ###FTPES support
39 PNF Simulator allows to serve files via FTPES server. FTPES server has predefined user *onap* with password *pano*. 
40 In order to connect execute command *ftp -p localhost 2221* and then when requested provide user and password.
41 In order to download a file execute while being logged in *get file-name-to-be-downloaded*.
42
43 ###Developer mode
44 For development of PNF Simulator, run *simulator.sh* start-dev in order to run Netopeer.
45 After that it is possible to run PNF Simulator from IDE.
46
47
48
49
50
51
52