cluster

package
v1.1.0-rc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

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) 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

Jump to

Keyboard shortcuts

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