Purpose
The purpose of SNIRO Emulator is to mock SNIRO homing functionality, which can be used to demo use cases.
It consists of a HTTP server that we could connect to as we would to an actual web service.
Set up
SNIRO emulator is built using microservices architecture to support portability and evolution. It is built based on wiremock testing tool wireMock.
It is deployed as dedicated docker container either using OOM based kubernetes deployment or as an additional container inside Robot VM using Heat template deployment technique.
- OOM based deployment
Since emulator is not core component of ONAP, it is not included in the list of all components that are deployed by "all" option of OOM oneclick/createALL.bash script.
In order to run it, one should explicitly deploy is using "-a" option : - Heat based deployment
SNIRO emulator container is added into Robot VM and exposed at the port 8080
It will be up and running automatically once Robot VM is spun up
Using emulator
Admin API Reference
The server provides various admin API to handle stubbing.
The API can be viewed through swagger page:
http://<ROBOT_VM_HOST>:8080/__admin/swagger-ui/
Some of the most useful APIs:
Some of the useful APIs are:
/__admin/mappings
GET /__admin/mappings --> Gets all defined mappings
POST /__admin/mappings --> Create a new stub mapping
GET /__admin/mappings/{guid} --> Get a single stub mapping
/__admin/requests
POST /__admin/requests/count --> Count requests logged in the journal matching the specified criteria
POST /__admin/mappings/reset --> Reset stub mappings (restore to defaults defined back the backing store)