mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 18:02:22 +08:00
Plugins: Introduce HTTP 207 Multi Status response to api/ds/query (#48550)
* feature toggles * return HTTP 207 from ds/query * add ft check * add API test * add 207 check for qr * change to OR * revert check * add explicit toggle check for cloudwatch * remove unused import * remove from defaults.ini * add status codes to md and update swagger * new fangled http api tests pattern * update swagger * Update docs/sources/http_api/data_source.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * add missing word and reformat Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
@ -249,9 +249,11 @@ type fakePluginClient struct {
|
||||
plugins.Client
|
||||
|
||||
req *backend.CallResourceRequest
|
||||
|
||||
backend.QueryDataHandlerFunc
|
||||
}
|
||||
|
||||
func (c *fakePluginClient) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error {
|
||||
func (c *fakePluginClient) CallResource(_ context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error {
|
||||
c.req = req
|
||||
bytes, err := json.Marshal(map[string]interface{}{
|
||||
"message": "hello",
|
||||
@ -266,3 +268,11 @@ func (c *fakePluginClient) CallResource(ctx context.Context, req *backend.CallRe
|
||||
Body: bytes,
|
||||
})
|
||||
}
|
||||
|
||||
func (c *fakePluginClient) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
|
||||
if c.QueryDataHandlerFunc != nil {
|
||||
return c.QueryDataHandlerFunc.QueryData(ctx, req)
|
||||
}
|
||||
|
||||
return backend.NewQueryDataResponse(), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user