region

package
v3.6.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

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

func NewNode

func NewNode(nodeAPI string)

NewNode new node client

func SetInfo

func SetInfo(region, t string)

SetInfo 设置

Types

type Body

type Body struct {
	SourceSpec *api_model.SourceSpec `json:"source_spec"`
}

Body Body

type ConfigsInterface

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

ConfigsInterface 数据中心配置API

type DefineCloudAuth

type DefineCloudAuth struct {
	GT *api_model.GetUserToken
}

DefineCloudAuth DefineCloudAuth

func (*DefineCloudAuth) GetToken

func (d *DefineCloudAuth) GetToken() ([]byte, error)

GetToken GetToken

func (*DefineCloudAuth) PostToken

func (d *DefineCloudAuth) PostToken() ([]byte, error)

PostToken PostToken

func (*DefineCloudAuth) PutToken

func (d *DefineCloudAuth) PutToken() error

PutToken PutToken

type DefineCloudAuthInterface

type DefineCloudAuthInterface interface {
	GetToken() ([]byte, error)
	PostToken() ([]byte, error)
	PutToken() error
}

DefineCloudAuthInterface DefineCloudAuthInterface

type DefineSources

type DefineSources struct {
	Model Body
	// contains filtered or unexported fields
}

DefineSources DefineSources

func (*DefineSources) DeleteSource

func (d *DefineSources) DeleteSource(sourceAlias string) error

DeleteSource DeleteSource

func (*DefineSources) GetSource

func (d *DefineSources) GetSource(sourceAlias string) ([]byte, error)

GetSource GetSource

func (*DefineSources) PostSource

func (d *DefineSources) PostSource(sourceAlias string) error

PostSource PostSource

func (*DefineSources) PutSource

func (d *DefineSources) PutSource(sourceAlias string) error

PutSource PutSource

type DefineSourcesInterface

type DefineSourcesInterface interface {
	GetSource(sourceAlias string) ([]byte, error)
	PostSource(sourceAlias string) error
	PutSource(SourcesAlias string) error
	DeleteSource(sourceAlias string) error
}

DefineSourcesInterface DefineSourcesInterface

type NodeInterface

type NodeInterface interface {
	Rule(rule string) ([]*model.HostNode, *util.APIHandleError)
	Get(node string) (*model.HostNode, *util.APIHandleError)
	List() ([]*model.HostNode, *util.APIHandleError)
	Add(node *model.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
}

type RNodeClient

type RNodeClient struct {
	NodeAPI string
}

func GetNode

func GetNode() *RNodeClient

func (*RNodeClient) Configs

func (r *RNodeClient) Configs() ConfigsInterface

func (*RNodeClient) Nodes

func (r *RNodeClient) Nodes() NodeInterface

func (*RNodeClient) Request

func (r *RNodeClient) Request(url, method string, body []byte) ([]byte, int, error)

Request Request

func (*RNodeClient) Tasks

func (r *RNodeClient) Tasks() TaskInterface

type Region

type Region struct {
	// contains filtered or unexported fields
}

func GetRegion

func GetRegion() *Region

func NewRegion

func NewRegion(regionAPI, token, authType string) *Region

func (*Region) Tenants

func (r *Region) Tenants() TenantInterface

type ServiceInterface

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

ServiceInterface ServiceInterface

type TaskInterface

type TaskInterface interface {
	Get(name string) (*model.Task, *util.APIHandleError)
	Status(name string) (*TaskStatus, error)
	HandleTaskStatus(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)
	Refresh() *util.APIHandleError
}

type TaskStatus

type TaskStatus struct {
	Status map[string]model.TaskStatus `json:"status,omitempty"`
}

func HandleTaskStatus

func HandleTaskStatus(task string) (*TaskStatus, error)

type TenantInterface

type TenantInterface interface {
	Get(name string) *tenant
	Services() ServiceInterface
	DefineSources(ss *api_model.SourceSpec) DefineSourcesInterface
	DefineCloudAuth(gt *api_model.GetUserToken) DefineCloudAuthInterface
}

TenantInterface TenantInterface

Jump to

Keyboard shortcuts

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