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 (
|
|
|
|
api_model "github.com/goodrain/rainbond/pkg/api/model"
|
2018-01-02 18:02:08 +08:00
|
|
|
"github.com/goodrain/rainbond/pkg/api/util"
|
2017-11-07 11:40:44 +08:00
|
|
|
dbmodel "github.com/goodrain/rainbond/pkg/db/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
//TenantHandler tenant handler
|
|
|
|
type TenantHandler interface {
|
|
|
|
GetTenants() ([]*dbmodel.Tenants, error)
|
2018-01-02 18:02:08 +08:00
|
|
|
GetTenantsPaged(offset, len int) ([]*dbmodel.Tenants, error)
|
2017-12-07 11:44:56 +08:00
|
|
|
GetTenantsByName(name string) (*dbmodel.Tenants, error)
|
2018-03-23 10:48:12 +08:00
|
|
|
GetTenantsByEid(eid 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)
|
2017-11-07 11:40:44 +08:00
|
|
|
//QueryTsdb(md *api_model.MontiorData) (*tsdbClient.QueryResponse, error)
|
|
|
|
HTTPTsdb(md *api_model.MontiorData) ([]byte, error)
|
2018-01-12 17:29:43 +08:00
|
|
|
GetTenantsResources(tr *api_model.TenantResources) ([]map[string]interface{}, 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
|
2017-11-07 11:40:44 +08:00
|
|
|
}
|