mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 08:42:15 +08:00
DataSources: Add datasource fetching + querying interface (#80749)
* first pass * separate oss + enterprise * tidy things up * add ctx * fix tests * use standalone svcs * mv plugin context provide * fix wire * fix import
This commit is contained in:
@ -46,7 +46,7 @@ func (r *subResourceREST) NewConnectOptions() (runtime.Object, bool, string) {
|
||||
}
|
||||
|
||||
func (r *subResourceREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) {
|
||||
pluginCtx, err := r.builder.getDataSourcePluginContext(ctx, name)
|
||||
pluginCtx, err := r.builder.pluginContext.PluginContextForDataSource(ctx, r.builder.pluginJSON.ID, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -65,8 +65,8 @@ func (r *subResourceREST) Connect(ctx context.Context, name string, opts runtime
|
||||
}
|
||||
|
||||
path := req.URL.Path[idx+len("/resource"):]
|
||||
err = r.builder.client.CallResource(ctx, &backend.CallResourceRequest{
|
||||
PluginContext: *pluginCtx,
|
||||
err = r.builder.querier.Resource(ctx, &backend.CallResourceRequest{
|
||||
PluginContext: pluginCtx,
|
||||
Path: path,
|
||||
Method: req.Method,
|
||||
Body: body,
|
||||
|
Reference in New Issue
Block a user