mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: region statusstandalone resource get status api missing
This commit is contained in:
@@ -77,3 +77,13 @@ func (model *SStatusStandaloneResourceBase) PerformStatus(ctx context.Context, u
|
||||
func (model *SStatusStandaloneResourceBase) IsInStatus(status ...string) bool {
|
||||
return utils.IsInStringArray(model.Status, status)
|
||||
}
|
||||
|
||||
func (model *SStatusStandaloneResourceBase) AllowGetDetailsStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
|
||||
return IsAdminAllowGetSpec(userCred, model, "status")
|
||||
}
|
||||
|
||||
func (model *SStatusStandaloneResourceBase) GetDetailsStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
ret := jsonutils.NewDict()
|
||||
ret.Add(jsonutils.NewString(model.Status), "status")
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
@@ -183,6 +183,10 @@ func (model *SVirtualResourceBase) AllowPerformMetadata(ctx context.Context, use
|
||||
return model.IsOwner(userCred) || IsAdminAllowPerform(userCred, model, "metadata")
|
||||
}
|
||||
|
||||
func (model *SVirtualResourceBase) AllowGetDetailsStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
|
||||
return model.IsOwner(userCred) || IsAdminAllowGetSpec(userCred, model, "status")
|
||||
}
|
||||
|
||||
func (model *SVirtualResourceBase) GetTenantCache(ctx context.Context) (*STenant, error) {
|
||||
// log.Debugf("Get tenant by Id %s", model.ProjectId)
|
||||
return TenantCacheManager.FetchTenantById(ctx, model.ProjectId)
|
||||
|
||||
Reference in New Issue
Block a user