mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudMonitoring: use CallResourceHandler instead of PluginProxy (#41064)
This commit is contained in:
@@ -31,7 +31,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
|
||||
) {
|
||||
super(instanceSettings);
|
||||
this.authenticationType = instanceSettings.jsonData.authenticationType || 'jwt';
|
||||
this.api = new API(`${instanceSettings.url!}/cloudmonitoring/v3/projects/`);
|
||||
this.api = new API(`/api/datasources/${this.id}/resources/cloudmonitoring/v3/projects/`);
|
||||
this.variables = new CloudMonitoringVariableSupport(this);
|
||||
this.intervalMs = 0;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
|
||||
value: projectId,
|
||||
label: name,
|
||||
}),
|
||||
baseUrl: `${this.instanceSettings.url!}/cloudresourcemanager/v1/`,
|
||||
baseUrl: `/api/datasources/${this.id}/resources/cloudresourcemanager/v1/`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -90,33 +90,5 @@
|
||||
"name": "Grafana Labs",
|
||||
"url": "https://grafana.com"
|
||||
}
|
||||
},
|
||||
"routes": [
|
||||
{
|
||||
"path": "cloudmonitoring",
|
||||
"method": "GET",
|
||||
"url": "https://monitoring.googleapis.com",
|
||||
"jwtTokenAuth": {
|
||||
"scopes": ["https://www.googleapis.com/auth/monitoring.read"],
|
||||
"params": {
|
||||
"token_uri": "{{.JsonData.tokenUri}}",
|
||||
"client_email": "{{.JsonData.clientEmail}}",
|
||||
"private_key": "{{.SecureJsonData.privateKey}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "cloudresourcemanager",
|
||||
"method": "GET",
|
||||
"url": "https://cloudresourcemanager.googleapis.com",
|
||||
"jwtTokenAuth": {
|
||||
"scopes": ["https://www.googleapis.com/auth/cloudplatformprojects.readonly"],
|
||||
"params": {
|
||||
"token_uri": "{{.JsonData.tokenUri}}",
|
||||
"client_email": "{{.JsonData.clientEmail}}",
|
||||
"private_key": "{{.SecureJsonData.privateKey}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user