feat(apigateway): add rpc methods of scheduler for apigateway (#21380)

This commit is contained in:
Zexi Li
2024-10-10 19:07:51 +08:00
committed by GitHub
parent 8e0507d002
commit c75c07a40d
@@ -21,6 +21,7 @@ import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/scheduler"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
@@ -118,6 +119,18 @@ func (this *SchedulerManager) DoForecast(s *mcclient.ClientSession, params jsonu
return obj, err
}
func (this *SchedulerManager) DoHistoryList(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
return this.HistoryList(s, params)
}
func (this *SchedulerManager) DoHistoryShow(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
sessionId, err := params.GetString("session_id")
if err != nil {
return nil, httperrors.NewNotFoundError("session_id")
}
return this.HistoryShow(s, sessionId, params)
}
func (this *SchedulerManager) Cleanup(s *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
url := newSchedURL("cleanup")
return modulebase.Post(this.ResourceManager, s, url, params, "")