cluster

package
v1.0.0-RC Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DiceProject     = "dice_project"
	DiceApplication = "dice_application"
	DiceRuntime     = "dice_runtime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster 集群操作封装

func New

func New(options ...Option) *Cluster

New 新建 Cluster 实例,操作应用资源

func (*Cluster) Create

func (c *Cluster) Create(req *apistructs.ClusterCreateRequest) (int64, error)

Create 创建集群

func (*Cluster) CreateWithEvent

func (c *Cluster) CreateWithEvent(req *apistructs.ClusterCreateRequest) (int64, error)

CreateWithEvent 创建集群 & 发送事件

func (*Cluster) DeleteByName

func (c *Cluster) DeleteByName(clusterName string) error

DeleteByName 根据 clusterName 删除集群

func (*Cluster) DeleteWithEvent

func (c *Cluster) DeleteWithEvent(clusterName string) error

DeleteWithEvent 删除集群 & 发送事件

func (*Cluster) DereferenceCluster

func (c *Cluster) DereferenceCluster(userID string, req *apistructs.DereferenceClusterRequest) error

DereferenceCluster 解除关联集群关系

func (*Cluster) GetClusterByIDOrName

func (c *Cluster) GetClusterByIDOrName(idOrName string) (*apistructs.ClusterInfo, error)

GetClusterByIDOrName 根据 id/clusterName 获取集群详情

func (*Cluster) ListCluster

func (c *Cluster) ListCluster() (*[]apistructs.ClusterInfo, error)

ListCluster 获取全部集群列表

func (*Cluster) ListClusterByOrg

func (c *Cluster) ListClusterByOrg(orgID int64) (*[]apistructs.ClusterInfo, error)

ListClusterByOrg 根据 orgID 获取集群列表

func (*Cluster) ListClusterByOrgAndType

func (c *Cluster) ListClusterByOrgAndType(orgID int64, clusterType string) (*[]apistructs.ClusterInfo, error)

func (*Cluster) ListClusterServices

func (c *Cluster) ListClusterServices(cluster string) ([]apistructs.ServiceUsageData, error)

ListClusterServicesList 获取指定集群的服务和addon列表

func (*Cluster) PushWithEvent

func (c *Cluster) PushWithEvent(req *apistructs.ClusterCreateRequest) (int64, error)

PushWithEvent 创建/更新集群 & 发送对应事件

func (*Cluster) StatisticsClusterResource

func (c *Cluster) StatisticsClusterResource(cluster, orgName string, hostsNum uint64) (map[string]uint64, error)

StatisticsClusterResource 根据给定集群统计项目,应用,主机,异常主机和runtime的数量

func (*Cluster) Update

func (c *Cluster) Update(orgID int64, req *apistructs.ClusterUpdateRequest) (int64, error)

Update 更新集群

func (*Cluster) UpdateWithEvent

func (c *Cluster) UpdateWithEvent(orgID int64, req *apistructs.ClusterUpdateRequest) (int64, error)

UpdateWithEvent 更新集群 & 发送事件

type Option

type Option func(*Cluster)

Option 定义 Cluster 对象的配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithContainerService

func WithContainerService(con *container.Container) Option

WithContainerService 配置 container service

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

func WithHostService

func WithHostService(h *host.Host) Option

WithHostService 配置 host service

func WithTicketService

func WithTicketService(t *ticket.Ticket) Option

WithTicketService 配置 ticket service

Jump to

Keyboard shortcuts

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