grafana/pkg/tsdb/cloudwatch/models/request/resource_request.go
Erik Sundell 017da781cf
Cloudwatch: Refactor dimension values resource request (#57346)
* refactor dimension values backend

* fix test file name
2022-10-24 15:04:25 +02:00

23 lines
341 B
Go

package request
import (
"fmt"
"net/url"
)
type ResourceRequest struct {
Region string
}
func getResourceRequest(parameters url.Values) (*ResourceRequest, error) {
request := &ResourceRequest{
Region: parameters.Get("region"),
}
if request.Region == "" {
return nil, fmt.Errorf("region is required")
}
return request, nil
}