blob: 08c61794e5c200b1c689c532957a23a6a55775ad [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:
Zack Williams6c78f912018-06-21 10:56:24 -07006 ./venv-xosdocs.sh
Zack Williamsda8a5d82017-09-08 12:45:14 -07007
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
Zack Williams6c78f912018-06-21 10:56:24 -070011clean: swagger_clean venv_clean
12
Matteo Scandolo431781c2017-09-06 15:33:07 -070013swagger_clean:
14 rm -rf swagger/specs/*
15
Zack Williamsda8a5d82017-09-08 12:45:14 -070016venv_clean:
17 rm -rf $(DOCSDIR)venv-xosdocs
18
Matteo Scandolo431781c2017-09-06 15:33:07 -070019swagger_serve_spec:
20 http-server --cors ./swagger
21
22# HOW TO
23# - load the virtual env (https://guide.opencord.org/xos/dev/local_env.html)
24# - run `make`
25# - open the browser at `http://127.0.0.1:8080/ui`
26# - you'll see the 'core' apis
27# - you can see a list of available apis at `http://127.0.0.1:8080/specs/`
28# - just replace the swagger file (top bar) with another one to see different APIs (to be improved)