mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: remove apiversion param from session
This commit is contained in:
@@ -451,7 +451,7 @@ func JsonToMetric(obj *jsonutils.JSONDict, name string, tags map[string]string,
|
||||
}
|
||||
|
||||
func SendMetrics(s *mcclient.ClientSession, metrics []influxdb.SMetricData, debug bool, database string) error {
|
||||
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType)
|
||||
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType, "")
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "GetServiceURLs")
|
||||
}
|
||||
@@ -596,7 +596,7 @@ func MakePullMetricRoutineWithDur(ctx context.Context, factory ICloudReportFacto
|
||||
go func() {
|
||||
timer := time.NewTimer(0)
|
||||
for {
|
||||
session := auth.GetAdminSession(ctx, "", "")
|
||||
session := auth.GetAdminSession(ctx, "")
|
||||
select {
|
||||
case <-closeChan:
|
||||
log.Warningf("closed provider: %s,name: %s. pull metric", provider.Name, provider.Name)
|
||||
@@ -618,7 +618,7 @@ func MakePullMetricRoutineAtZeroPoint(ctx context.Context, factory ICloudReportF
|
||||
next := now.Add(time.Hour * 24 * interval)
|
||||
date := time.Date(next.Year(), next.Month(), next.Day(), 0, 0, 0, 0, next.Location())
|
||||
timer.Reset(date.Sub(now))
|
||||
session := auth.GetAdminSession(ctx, "", "")
|
||||
session := auth.GetAdminSession(ctx, "")
|
||||
select {
|
||||
case <-closeChan:
|
||||
log.Warningf("closed provider: %s,brand: %s. pull metric", provider.Name, provider.Brand)
|
||||
|
||||
@@ -52,7 +52,7 @@ func jsonToMetric(obj *jsonutils.JSONDict, name string, tags []string, metrics [
|
||||
}
|
||||
|
||||
func sendMetrics(s *mcclient.ClientSession, metrics []influxdb.SMetricData, debug bool) error {
|
||||
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType)
|
||||
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType, "")
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "GetServiceURLs")
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func StartService() {
|
||||
}
|
||||
|
||||
func getCloudproviderList(ctx context.Context) ([]jsonutils.JSONObject, error) {
|
||||
session := auth.GetAdminSessionWithPublic(context.Background(), "", "")
|
||||
session := auth.GetAdminSessionWithPublic(context.Background(), "")
|
||||
query := jsonutils.NewDict()
|
||||
query.Add(jsonutils.NewString("10"), common.KEY_LIMIT)
|
||||
query.Add(jsonutils.NewString("true"), common.KEY_ADMIN)
|
||||
|
||||
Reference in New Issue
Block a user