Alerting: Code-gen parsing of URL parameters and fix related bugs (#50731)

* Extend template and generate

* Generate and fix up alertmanager endpoints

* Prometheus routes

* fix up Testing endpoints

* touch up ruler API

* Update provisioning and fix 500

* Drop dead code

* Remove more dead code

* Resolve merge conflicts
This commit is contained in:
Alexander Weaver
2022-06-23 15:13:39 -05:00
committed by GitHub
parent 80f6560c9c
commit 0d9389e1f4
21 changed files with 262 additions and 262 deletions
@@ -19,16 +19,16 @@ type {{classname}}ForkingService interface { {{#operation}}
{{#operations}}{{#operation}}
func (f *Forked{{classname}}) {{nickname}}(ctx *models.ReqContext) response.Response {
{{#pathParams}}
{{paramName}}Param := web.Params(ctx.Req)[":{{baseName}}"]
{{/pathParams}}
{{#bodyParams}}
conf := apimodels.{{dataType}}{}
if err := web.Bind(ctx.Req, &conf); err != nil {
return response.Error(http.StatusBadRequest, "bad request data", err)
}
return f.fork{{nickname}}(ctx, conf)
{{/bodyParams}}
{{^bodyParams}}
return f.fork{{nickname}}(ctx)
{{/bodyParams}}
return f.fork{{nickname}}(ctx{{#bodyParams}}, conf{{/bodyParams}}{{#pathParams}}, {{paramName}}Param{{/pathParams}})
}
{{/operation}}{{/operations}}