region

package
v3.7.0-release+incompa... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: LGPL-3.0 Imports: 22 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTenant string

AllTenant AllTenant

Functions

func LoadConfig

func LoadConfig(regionAPI, token string) (map[string]map[string]interface{}, error)

func SetInfo

func SetInfo(region, t string)

SetInfo 设置

Types

type APIConf

type APIConf struct {
	Endpoints []string `yaml:"endpoints"`
	Token     string   `yaml:"token"`
	AuthType  string   `yaml:"auth_type"`
	Cacert    string   `yaml:"client-ca-file"`
	Cert      string   `yaml:"tls-cert-file"`
	CertKey   string   `yaml:"tls-private-key-file"`
}

APIConf region api config

type ClusterInterface

type ClusterInterface interface {
	GetClusterInfo() (*model.ClusterResource, *util.APIHandleError)
	GetClusterHealth() (*utilhttp.ResponseBody, *util.APIHandleError)
}

ClusterInterface cluster api

type ConfigsInterface

type ConfigsInterface interface {
	Get() (*model.GlobalConfig, *util.APIHandleError)
	Put(*model.GlobalConfig) *util.APIHandleError
}

ConfigsInterface 数据中心配置API

type MonitorInterface

type MonitorInterface interface {
	GetRule(name string) (*model.AlertingNameConfig, *util.APIHandleError)
	GetAllRule() (*model.AlertingRulesConfig, *util.APIHandleError)
	DelRule(name string) (*utilhttp.ResponseBody, *util.APIHandleError)
	AddRule(path string) (*utilhttp.ResponseBody, *util.APIHandleError)
	RegRule(ruleName string, path string) (*utilhttp.ResponseBody, *util.APIHandleError)
}

ClusterInterface cluster api

type NodeInterface

type NodeInterface interface {
	GetNodeByRule(rule string) ([]*client.HostNode, *util.APIHandleError)
	Get(node string) (*client.HostNode, *util.APIHandleError)
	List() ([]*client.HostNode, *util.APIHandleError)
	Add(node *client.APIHostNode) *util.APIHandleError
	Up(nid string) *util.APIHandleError
	Down(nid string) *util.APIHandleError
	UnSchedulable(nid string) *util.APIHandleError
	ReSchedulable(nid string) *util.APIHandleError
	Delete(nid string) *util.APIHandleError
	Label(nid string, label map[string]string) *util.APIHandleError
}

NodeInterface node api

type Region

type Region interface {
	Tenants(name string) TenantInterface
	Resources() ResourcesInterface
	Tasks() TaskInterface
	Nodes() NodeInterface
	Cluster() ClusterInterface
	Configs() ConfigsInterface
	Version() string
	Monitor() MonitorInterface
	DoRequest(path, method string, body io.Reader, decode *utilhttp.ResponseBody) (int, error)
}

Region region api

func GetRegion

func GetRegion() Region

GetRegion GetRegion

func NewRegion

func NewRegion(c APIConf) (Region, error)

NewRegion NewRegion

type ResourcesInterface

type ResourcesInterface interface {
	Tenants(tenantName string) ResourcesTenantInterface
}

ResourcesInterface ResourcesInterface

type ResourcesTenantInterface

type ResourcesTenantInterface interface {
	Get() (*model.TenantResource, *util.APIHandleError)
}

ResourcesTenantInterface ResourcesTenantInterface

type ServiceInterface

type ServiceInterface interface {
	Get() (*dbmodel.TenantServices, *util.APIHandleError)
	Pods() ([]*dbmodel.K8sPod, *util.APIHandleError)
	List() ([]*dbmodel.TenantServices, *util.APIHandleError)
	Stop(eventID string) (string, *util.APIHandleError)
	Start(eventID string) (string, *util.APIHandleError)
	EventLog(eventID, level string) ([]*model.MessageData, *util.APIHandleError)
}

ServiceInterface ServiceInterface

type TaskInterface

type TaskInterface interface {
	Get(name string) (*model.Task, *util.APIHandleError)
	GetTaskStatus(task string) (map[string]*model.TaskStatus, *util.APIHandleError)
	Add(task *model.Task) *util.APIHandleError
	AddGroup(group *model.TaskGroup) *util.APIHandleError
	Exec(name string, nodes []string) *util.APIHandleError
	List() ([]*model.Task, *util.APIHandleError)
}

TaskInterface task api

type TenantInterface

type TenantInterface interface {
	Get() (*dbmodel.Tenants, *util.APIHandleError)
	List() ([]*dbmodel.Tenants, *util.APIHandleError)
	Delete() *util.APIHandleError
	Services(serviceAlias string) ServiceInterface
}

TenantInterface TenantInterface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL