This is a configuration agent which exposes HTTPS endpoints to perform dynamic network configuration on switches running SONiC. It restful API server is go-server-server
mkdir debs; cd debssudo wget https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-all/lastSuccessfulBuild/artifact/target/debs/*zip*/debs.zipsudo unzip debs.zip
- Modify
copy.shSDIR path to point to your downloaded debs from the previous step - Execute ./build.sh
- The above should generate 2 Docker images, 1 which is used for local development on your VM and 1 which is used for deployment on a TOR
- Run
docker imagesto check if rest-api dockers were generated
REPOSITORY TAG IMAGE ID CREATED SIZE
rest-api-image latest d2815fcb7356 2 days ago 222MB
rest-api-image-test_local latest e62219a0bae2 2 days ago 222MB rest-api-image-test_localis for local testing on a dev VM andrest-api-imageis for TOR testing/deployment- The production image is also stored into a compressed archive
rest-api-image.gz
docker run -d --rm -p8090:8090 -p6379:6379 --name rest-api --cap-add NET_ADMIN --privileged -t rest-api-image-test_local:latestcd testpython apitest.py
docker exec -it rest-api bashvim /tmp/rest-api.err.log
- scp/copy over the generated archive(
rest-api-image.gz) to your switch docker load < rest-api-image.gzdocker run -d -p=8090:8090/tcp -v /var/run/redis/redis.sock:/var/run/redis/redis.sock --name rest-api --cap-add NET_ADMIN --privileged -t rest-api-image:latest