fix(region): host model add api stats (#24956)

This commit is contained in:
wanyaoqi
2026-06-09 23:02:04 +08:00
committed by GitHub
parent 7c7353cf7b
commit 44f7c6e688
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -77,6 +77,7 @@ func init() {
stats, _ := data.GetArray("workers")
printList(&printutils.ListResult{Data: stats}, nil)
}, &options.BaseIdOptions{})
cmd.Get("api-stats", &options.BaseIdOptions{})
cmd.Get("tap-config", &options.BaseIdOptions{})
cmd.GetWithCustomShow("nics", func(data jsonutils.JSONObject) {
results := printutils.ListResult{}
+4
View File
@@ -8197,6 +8197,10 @@ func (h *SHost) GetDetailsWorkerStats(ctx context.Context, userCred mcclient.Tok
return h.Request(ctx, userCred, httputils.GET, "/worker_stats", nil, nil)
}
func (h *SHost) GetDetailsApiStats(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
return h.Request(ctx, userCred, httputils.GET, "/stats", nil, nil)
}
func (hh *SHost) GetDetailsIsolatedDeviceNumaStats(ctx context.Context, userCred mcclient.TokenCredential, input *api.HostIsolatedDeviceNumaStatsInput) (jsonutils.JSONObject, error) {
if !utils.IsInStringArray(input.DevType, api.VALID_PASSTHROUGH_TYPES) {
return nil, httperrors.NewInputParameterError("dev_type %s is invalid", input.DevType)