## Usage of simulator
### Setting up
Preferred way to start simulator is to use `docker-compose up -d` command.
-All required docker images will be downloaded from ONAP Nexus, however there is possibility to build those
-images locally. It can be achieve by invoking `mvn clean install -P docker` from top directory.
+All required docker images will be downloaded from ONAP Nexus, however there is a possibility to build those
+images locally. It can be achieved by invoking `mvn clean install -P docker` from top directory.
### API
Simulator provides REST endpoints which can be used to trigger sending events to VES.
-double
-boolean
Searching for null values as well as incorporating regex expression with intention to find a match is not supported.
-Search expression must be valid JSON, thus no duplicate keys are allowed - user could specify the same parameter multiple times, but only last occurrence will be applied to query.
+Search expression must be a valid JSON, thus no duplicated keys are allowed - user could specify the same parameter multiple times, but only last occurrence will be applied to query.
Example search expression:
{"domain": "notification", "sequence": 1, "startEpochMicrosec": 1531616794, "sampleDouble": 2.5}
RandomInteger with parameters will automatically find minimal and maximal value form the given attributes so no particular order of those is expected.
How does it work?
-When user do not want to fill in parameter values that are not relevant from user perspective but are mandatory by end system, then keyword feature should be used.
+When user does't want to fill in parameter values that are not relevant from user perspective but are mandatory by end system, then keyword feature should be used.
In template, keyword strings are substituted in runtime with appropriate values autogenerated by simulator.
Example can be shown below:
### In place variables support
Simulator supports dynamic keywords e.g. #dN to automatically substitute selected phrases in defined json schema.
-Keywords have to be specified as separated json values, so no mixing keywords inside textual fields are acceptable. Current implementation
+Keywords have to be specified as separate json values, so no mixing keywords inside textual fields are acceptable. Current implementation
supports placing variables in json templates as well as in patches latter sent as part of the requests.
####Example:
```curl --cacert rootCA.crt --cert client.crt --key client.key https://VES_SECURED_URL -d "{}" -X POST -H "Content-type: application/json" -kv```
#### How to refresh configuration of app
-Depends your needs, you are able to change client certificate, replace trustStore to accept new server certificate change keystore and truststore passwords or completely disable client cert authentication.
+Depending on your needs, you are able to change client certificate, replace trustStore to accept new server certificate change keystore and truststore passwords or completely disable client cert authentication.
For this purpose:
1. Go to the pnf simulator container into the /app folder.
- ssl.clientCertificatePassword=collector (to replace password for keystore)
- ssl.trustStoreDir=/app/store/trustStore (to replace truststore file)
- ssl.trustStorePassword=collector (to replace password for truststore)
-4. Refresh configuration sending simple POST request to correct actuator endpoint at: ```curl http://localhost:5001/refresh -H 'Content-type: application/json' -X POST --data '{}'```
+4. Refresh configuration by sending simple POST request to correct actuator endpoint at: ```curl http://localhost:5001/refresh -H 'Content-type: application/json' -X POST --data '{}'```