Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After compiling the pncsimulator image locally or fetching the docker image from remote registry, executing the command below to start the container:

Code Block
docker run –p 18181:8181 –d –name pncsimu-18181 –t pncsimu:1.0.5

It should be noted that, we redirect the request from host:18181 to container:8181. You can configure whatever port mapping to container:8181 at your discretion.

After starting the container, you should be able to verify the running container by:

Code Block
Dockerdocker container ps –a | grep pncsimu

Step 2.

...

Initialize the simulator

...

The simulator offers a set of administrative APIs which are designed for initialization, management and reset purposes.

To initialize the simulator:
Code Block
curl –X POST –H "content-type:application/json" http://${SERVER_IP:SERVER_PORT}/pncsimu/v1/reload-data -d @INITIAL_DATA_FILE

In our case, the SERVER_PORT is 18181.

Here, INITIAL_DATA_FILE is a JSON representation describing the status of operational datastore.

The file is formatted as follows.

JSON Viewer
{
	"ietf-te:te" : {
    },
	"ietf-network:networks" : {
         		"network" : [
	     ]
	}
}

For demonstration purposes, A sample INITIAL_DATA file is attached.