The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/ngalert/api/Makefile

28 lines
999 B

.DEFAULT_GOAL := all
GENERATED_GO_MATCHERS = ./go/*.go
swagger-codegen-api:
docker run --rm -v $$(pwd):/local --user $$(id -u):$$(id -g) swaggerapi/swagger-codegen-cli generate \
-i /local/tooling/post.json \
-l go-server \
-Dapis \
-o /local \
--additional-properties packageName=api \
-t /local/tooling/swagger-codegen/templates \
# --import-mappings eval.RelativeTimeRange="github.com/grafana/grafana/pkg/services/ngalert/eval" \
# --type-mappings RelativeTimeRange=eval.RelativeTimeRange
copy-files:
ls -1 go | xargs -n 1 -I {} mv go/{} generated_base_{}
fix:
sed -i -e 's/apimodels\.\[\]PostableAlert/apimodels.PostableAlerts/' $(GENERATED_GO_MATCHERS)
sed -i -e 's/apimodels\.\[\]UpdateDashboardAclCommand/apimodels.Permissions/' $(GENERATED_GO_MATCHERS)
sed -i -e 's/apimodels\.\[\]PostableApiReceiver/apimodels.TestReceiversConfigParams/' $(GENERATED_GO_MATCHERS)
goimports -w -v $(GENERATED_GO_MATCHERS)
clean:
rm -rf ./go
all: swagger-codegen-api fix copy-files clean