2018-03-14 14:12:26 +08:00
|
|
|
// Copyright (C) 2014-2018 Goodrain Co., Ltd.
|
2017-11-07 11:40:44 +08:00
|
|
|
// RAINBOND, Application Management Platform
|
2018-03-14 14:33:31 +08:00
|
|
|
|
2017-11-07 11:40:44 +08:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version. For any non-GPL usage of Rainbond,
|
|
|
|
// one or multiple Commercial Licenses authorized by Goodrain Co., Ltd.
|
|
|
|
// must be obtained first.
|
2018-03-14 14:33:31 +08:00
|
|
|
|
2017-11-07 11:40:44 +08:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2018-03-14 14:33:31 +08:00
|
|
|
|
2017-11-07 11:40:44 +08:00
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
2018-04-24 16:44:59 +08:00
|
|
|
api_model "github.com/goodrain/rainbond/api/model"
|
|
|
|
"github.com/goodrain/rainbond/api/util"
|
|
|
|
dbmodel "github.com/goodrain/rainbond/db/model"
|
2017-11-07 11:40:44 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
//TenantHandler tenant handler
|
|
|
|
type TenantHandler interface {
|
2019-08-01 17:19:22 +08:00
|
|
|
GetTenants(query string) ([]*dbmodel.Tenants, error)
|
2017-12-07 11:44:56 +08:00
|
|
|
GetTenantsByName(name string) (*dbmodel.Tenants, error)
|
2019-08-01 17:19:22 +08:00
|
|
|
GetTenantsByEid(eid, query string) ([]*dbmodel.Tenants, error)
|
2017-12-15 16:49:24 +08:00
|
|
|
GetTenantsByUUID(uuid string) (*dbmodel.Tenants, error)
|
2017-12-06 17:09:49 +08:00
|
|
|
GetTenantsName() ([]string, error)
|
2017-11-07 11:40:44 +08:00
|
|
|
StatsMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
|
2017-12-06 15:26:21 +08:00
|
|
|
TotalMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
|
2018-04-26 12:46:26 +08:00
|
|
|
GetTenantsResources(tr *api_model.TenantResources) (map[string]map[string]interface{}, error)
|
2019-01-28 16:00:51 +08:00
|
|
|
GetTenantResource(tenantID string) (TenantResourceStats, error)
|
|
|
|
GetAllocatableResources() (*ClusterResourceStats, error)
|
2018-03-14 11:50:10 +08:00
|
|
|
GetServicesResources(tr *api_model.ServicesResources) (map[string]map[string]interface{}, error)
|
2017-11-07 11:40:44 +08:00
|
|
|
TenantsSum() (int, error)
|
2018-01-02 18:02:08 +08:00
|
|
|
GetProtocols() ([]*dbmodel.RegionProcotols, *util.APIHandleError)
|
2018-03-04 22:48:50 +08:00
|
|
|
TransPlugins(tenantID, tenantName, fromTenant string, pluginList []string) *util.APIHandleError
|
2019-01-24 16:15:45 +08:00
|
|
|
GetServicesStatus(ids string) map[string]string
|
|
|
|
IsClosedStatus(status string) bool
|
2019-08-01 17:19:22 +08:00
|
|
|
BindTenantsResource(source []*dbmodel.Tenants) api_model.TenantList
|
|
|
|
UpdateTenant(*dbmodel.Tenants) error
|
2019-11-05 11:43:10 +08:00
|
|
|
DeleteTenant(tenantID string) error
|
2020-08-04 15:05:57 +08:00
|
|
|
GetClusterResource() *ClusterResourceStats
|
2017-11-07 11:40:44 +08:00
|
|
|
}
|