grafana/pkg/services/ngalert/api/swagger-codegen/Makefile
Sofia Papagiannaki fe628c6282
AlertingNG: base API implementation (#31824)
* AlertingNG: base API implementation

* Pass the interface instead of the base impl

* Ruler mock draft (WIP)

* Update alerting-api dependency

* Improve mock implementation
2021-03-11 21:28:00 +02:00

26 lines
717 B
Makefile

.DEFAULT_GOAL := all
swagger-codegen-api:
swagger-codegen generate -v \
-i https://grafana.github.io/alerting-api/post.json \
-l go-server \
-Dapis \
-o ../ \
--additional-properties packageName=api \
-t ./templates \
# --import-mappings eval.RelativeTimeRange="github.com/grafana/grafana/pkg/services/ngalert/eval" \
# --type-mappings RelativeTimeRange=eval.RelativeTimeRange
copy-files:
python move-and-rename.py
fix:
sed -i -e 's/apimodels\.\[\]PostableAlert/apimodels.PostableAlerts/' ../go/*.go
sed -i -e 's/apimodels\.\[\]UpdateDashboardAclCommand/apimodels.Permissions/' ../go/*.go
goimports -w -v ../go/*.go
rm ../go/*.go-e
clean:
rm -rf ../go
all: swagger-codegen-api fix copy-files clean