mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AzureMonitor: fix Azure Resource Graph queries in Azure China (#35235)
* Optimize Azure Monitor routes * Update API version compatible with Azure China
This commit is contained in:
@@ -226,7 +226,7 @@ func (e *AzureResourceGraphDatasource) getPluginRoute(plugin *plugins.DataSource
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
routeName, err := getResourceGraphApiRoute(cloud)
|
||||
routeName, err := getManagementApiRoute(cloud)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
@@ -43,19 +43,3 @@ func getAppInsightsApiRoute(azureCloud string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
func getResourceGraphApiRoute(azureCloud string) (string, error) {
|
||||
switch azureCloud {
|
||||
case azureMonitorPublic:
|
||||
return "azureresourcegraph", nil
|
||||
case azureMonitorChina:
|
||||
return "chinaazureresourcegraph", nil
|
||||
case azureMonitorUSGovernment:
|
||||
return "govazureresourcegraph", nil
|
||||
case azureMonitorGermany:
|
||||
return "germanyazureresourcegraph", nil
|
||||
default:
|
||||
err := fmt.Errorf("the cloud '%s' not supported", azureCloud)
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user