blob: 536170dd6af1b4e97ca5e0e1b5e05e4f0d3501fd [file] [log] [blame]
Zack Williamsda8a5d82017-09-08 12:45:14 -07001DOCSDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2
Matteo Scandolo431781c2017-09-06 15:33:07 -07003swagger: swagger_clean swagger_docs swagger_serve_spec
4
Zack Williamsda8a5d82017-09-08 12:45:14 -07005venv-xosdocs:
6 bash venv-xosdocs.sh
7
8swagger_docs: venv-xosdocs
9 bash -c 'source $(DOCSDIR)venv-xosdocs/bin/activate && python $(DOCSDIR)scripts/swagger_docs.py'
Matteo Scandolo431781c2017-09-06 15:33:07 -070010
11swagger_clean:
12 rm -rf swagger/specs/*
13
Zack Williamsda8a5d82017-09-08 12:45:14 -070014venv_clean:
15 rm -rf $(DOCSDIR)venv-xosdocs
16
Matteo Scandolo431781c2017-09-06 15:33:07 -070017swagger_serve_spec:
18 http-server --cors ./swagger
19
20# HOW TO
21# - load the virtual env (https://guide.opencord.org/xos/dev/local_env.html)
22# - run `make`
23# - open the browser at `http://127.0.0.1:8080/ui`
24# - you'll see the 'core' apis
25# - you can see a list of available apis at `http://127.0.0.1:8080/specs/`
26# - just replace the swagger file (top bar) with another one to see different APIs (to be improved)