Plugins: Migrate CloudWatch to backend plugin SDK (#31149)
* first pass * add instance manager * fix tests * remove dead code * unexport fields * cleanup * remove ds instance from executor * cleanup * inline im * remove old func * get error working * unexport field * let fe do its magic * fix channel name * revert some tsdb changes * fix annotations * cleanup
This commit is contained in:
@@ -15,37 +15,9 @@ import (
|
||||
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
|
||||
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
|
||||
"github.com/grafana/grafana-aws-sdk/pkg/awsds"
|
||||
"github.com/grafana/grafana/pkg/components/securejsondata"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
type fakeDataSourceCfg struct {
|
||||
assumeRoleARN string
|
||||
externalID string
|
||||
}
|
||||
|
||||
func fakeDataSource(cfgs ...fakeDataSourceCfg) *models.DataSource {
|
||||
jsonData := simplejson.New()
|
||||
jsonData.Set("defaultRegion", defaultRegion)
|
||||
jsonData.Set("authType", "default")
|
||||
for _, cfg := range cfgs {
|
||||
if cfg.assumeRoleARN != "" {
|
||||
jsonData.Set("assumeRoleArn", cfg.assumeRoleARN)
|
||||
}
|
||||
if cfg.externalID != "" {
|
||||
jsonData.Set("externalId", cfg.externalID)
|
||||
}
|
||||
}
|
||||
return &models.DataSource{
|
||||
Id: 1,
|
||||
Database: "default",
|
||||
JsonData: jsonData,
|
||||
SecureJsonData: securejsondata.SecureJsonData{},
|
||||
}
|
||||
}
|
||||
|
||||
type FakeCWLogsClient struct {
|
||||
cloudwatchlogsiface.CloudWatchLogsAPI
|
||||
logGroups cloudwatchlogs.DescribeLogGroupsOutput
|
||||
|
||||
Reference in New Issue
Block a user