fix: remove apiversion param from session

This commit is contained in:
QIU Jian
2022-08-25 09:43:50 +08:00
committed by Qiu Jian
parent c6f557fd68
commit 293afd2e69
165 changed files with 381 additions and 487 deletions
@@ -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)
+1 -1
View File
@@ -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")
}
+1 -1
View File
@@ -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)