service

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: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Running     = "running"
	Offline     = "offline"
	Unknown     = "unknown"
	Error       = "error"
	Init        = "init"
	InitSuccess = "init_success"
	InitFailed  = "init_failed"
	Installing  = "installing"
)

Variables

This section is empty.

Functions

func Duplicate

func Duplicate(a interface{}) (ret []interface{})

Duplicate Duplicate

Types

type AppService

type AppService struct {
	Prefix string
	// contains filtered or unexported fields
}

AppService app service

func CreateAppService

func CreateAppService(c *option.Conf) *AppService

CreateAppService create

func (*AppService) FindAppEndpoints

func (a *AppService) FindAppEndpoints(appName string) []*config.Endpoint

FindAppEndpoints 获取app endpoint

type DiscoverAction

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

DiscoverAction DiscoverAction

func CreateDiscoverActionManager

func CreateDiscoverActionManager(conf *option.Conf, kubecli kubecache.KubeClient) *DiscoverAction

CreateDiscoverActionManager CreateDiscoverActionManager

func (*DiscoverAction) DiscoverClusters

func (d *DiscoverAction) DiscoverClusters(
	tenantService,
	serviceCluster string) (*envoyv1.CDSCluter, *util.APIHandleError)

DiscoverClusters cds discover create cluster by get depend app endpoints from plugin config

func (*DiscoverAction) DiscoverListeners

func (d *DiscoverAction) DiscoverListeners(
	tenantService, serviceCluster string) (*envoyv1.LDSListener, *util.APIHandleError)

DiscoverListeners lds create listens by get depend app endpoints from plugin config

func (*DiscoverAction) DiscoverService

func (d *DiscoverAction) DiscoverService(serviceInfo string) (*envoyv1.SDSHost, *util.APIHandleError)

DiscoverService sds

func (*DiscoverAction) ToolsGetRainbondResources

func (d *DiscoverAction) ToolsGetRainbondResources(namespace, sourceAlias, pluginID string) (*api_model.ResourceSpec, error)

ToolsGetRainbondResources get plugin configs from etcd if not exist return error

func (*DiscoverAction) ToolsGetSourcesEnv

func (d *DiscoverAction) ToolsGetSourcesEnv(
	namespace, sourceAlias, envName string) ([]byte, *util.APIHandleError)

ToolsGetSourcesEnv rds envName maybe is plugin id

type NodeService

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

NodeService node service

func CreateNodeService

func CreateNodeService(c *option.Conf, nodecluster *node.Cluster, kubecli kubecache.KubeClient) *NodeService

CreateNodeService create

func (*NodeService) AddNode

func (n *NodeService) AddNode(node *client.APIHostNode) *utils.APIHandleError

AddNode add node

func (*NodeService) CheckNode

func (n *NodeService) CheckNode(nodeUID string) (*model.InstallStatus, *utils.APIHandleError)

CheckNode check node install status

func (*NodeService) CordonNode

func (n *NodeService) CordonNode(nodeID string, unschedulable bool) *utils.APIHandleError

CordonNode set node is unscheduler

func (*NodeService) DeleteNode

func (n *NodeService) DeleteNode(nodeID string) *utils.APIHandleError

DeleteNode delete node only node status is offline and node can be deleted

func (*NodeService) DownNode

func (n *NodeService) DownNode(nodeID string) (*client.HostNode, *utils.APIHandleError)

DownNode down node

func (*NodeService) GetAllNode

func (n *NodeService) GetAllNode() ([]*client.HostNode, *utils.APIHandleError)

GetAllNode get all node

func (*NodeService) GetNode

func (n *NodeService) GetNode(nodeID string) (*client.HostNode, *utils.APIHandleError)

GetNode get node info

func (*NodeService) GetNodeResource

func (n *NodeService) GetNodeResource(nodeUID string) (*model.NodePodResource, *utils.APIHandleError)

GetNodeResource get node resource

func (*NodeService) GetServicesHealthy

func (n *NodeService) GetServicesHealthy() (map[string][]map[string]string, *utils.APIHandleError)

func (*NodeService) InitStatus

func (n *NodeService) InitStatus(nodeIP string) (*model.InitStatus, *utils.APIHandleError)

InitStatus node init status

func (*NodeService) InstallNode

func (n *NodeService) InstallNode(nodeID string) *utils.APIHandleError

InstallNode install a node

func (*NodeService) PutNodeLabel

func (n *NodeService) PutNodeLabel(nodeID string, labels map[string]string) *utils.APIHandleError

PutNodeLabel update node label

func (*NodeService) UpNode

func (n *NodeService) UpNode(nodeID string) (*client.HostNode, *utils.APIHandleError)

UpNode up node

type PrometheusService

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

PrometheusService prometheus service

func CreatePrometheusService

func CreatePrometheusService(c *option.Conf, ms *masterserver.MasterServer) *PrometheusService

CreatePrometheusService create prometheus service

func (*PrometheusService) Exec

Exec exec prometheus query

func (*PrometheusService) ExecRange

func (ts *PrometheusService) ExecRange(expr, start, end, step string) (*model.Prome, *utils.APIHandleError)

ExecRange exec prometheus query range

type TaskGroupService

type TaskGroupService struct {
	SavePath string
	// contains filtered or unexported fields
}

TaskGroupService task group

func CreateTaskGroupService

func CreateTaskGroupService(c *option.Conf, ms *masterserver.MasterServer) *TaskGroupService

CreateTaskGroupService create Task group service

func (*TaskGroupService) AddTaskGroup

func (ts *TaskGroupService) AddTaskGroup(t *model.TaskGroup) *utils.APIHandleError

AddTaskGroup add task group

func (*TaskGroupService) DeleteTaskGroup

func (ts *TaskGroupService) DeleteTaskGroup(taskGroupID string) *utils.APIHandleError

DeleteTaskGroup delete TaskGroup delete group but do not delete task in this group

func (*TaskGroupService) ExecTaskGroup

func (ts *TaskGroupService) ExecTaskGroup(taskGroupID string, nodes []string) *utils.APIHandleError

ExecTaskGroup exec group task

func (*TaskGroupService) GetTaskGroup

func (ts *TaskGroupService) GetTaskGroup(taskGroupID string) (*model.TaskGroup, *utils.APIHandleError)

GetTaskGroup get Task group

func (*TaskGroupService) GetTaskGroups

func (ts *TaskGroupService) GetTaskGroups() ([]*model.TaskGroup, *utils.APIHandleError)

GetTaskGroups get tasks

type TaskService

type TaskService struct {
	SavePath string
	// contains filtered or unexported fields
}

TaskService task services

func CreateTaskService

func CreateTaskService(c *option.Conf, ms *masterserver.MasterServer) *TaskService

CreateTaskService create task service

func (*TaskService) AddTask

func (ts *TaskService) AddTask(t *model.Task) *utils.APIHandleError

AddTask add task

func (*TaskService) DeleteTask

func (ts *TaskService) DeleteTask(taskID string) *utils.APIHandleError

DeleteTask delete task by taskID

func (*TaskService) ExecTask

func (ts *TaskService) ExecTask(taskID string, nodes []string) *utils.APIHandleError

ExecTask exec a task in nodes

func (*TaskService) GetTask

func (ts *TaskService) GetTask(taskID string) (*model.Task, *utils.APIHandleError)

GetTask get task by taskID

func (*TaskService) GetTasks

func (ts *TaskService) GetTasks() ([]*model.Task, *utils.APIHandleError)

GetTasks get tasks

func (*TaskService) GetTasksByNode

func (ts *TaskService) GetTasksByNode(n *client.HostNode) ([]*model.Task, *utils.APIHandleError)

GetTasksByNode get tasks by node

func (*TaskService) ReloadStaticTasks

func (ts *TaskService) ReloadStaticTasks()

ReloadStaticTasks reload task

type TaskTempService

type TaskTempService struct {
	SavePath string
	// contains filtered or unexported fields
}

TaskTempService task temp service

func CreateTaskTempService

func CreateTaskTempService(c *option.Conf) *TaskTempService

CreateTaskTempService create task temp service

func (*TaskTempService) DeleteTaskTemp

func (ts *TaskTempService) DeleteTaskTemp(tempID string) *utils.APIHandleError

DeleteTaskTemp delete task temp

func (*TaskTempService) GetTaskTemp

func (ts *TaskTempService) GetTaskTemp(tempID string) (*model.TaskTemp, *utils.APIHandleError)

GetTaskTemp get task temp

func (*TaskTempService) SaveTaskTemp

func (ts *TaskTempService) SaveTaskTemp(t *model.TaskTemp) *utils.APIHandleError

SaveTaskTemp add task temp

Jump to

Keyboard shortcuts

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