Documentation
¶
Index ¶
- Constants
- type Cluster
- func (c *Cluster) Create(req *apistructs.ClusterCreateRequest) (int64, error)
- func (c *Cluster) CreateWithEvent(req *apistructs.ClusterCreateRequest) (int64, error)
- func (c *Cluster) DeleteByName(clusterName string) error
- func (c *Cluster) DeleteWithEvent(clusterName string) error
- func (c *Cluster) DereferenceCluster(userID string, req *apistructs.DereferenceClusterRequest) error
- func (c *Cluster) GetClusterByIDOrName(idOrName string) (*apistructs.ClusterInfo, error)
- func (c *Cluster) ListCluster() (*[]apistructs.ClusterInfo, error)
- func (c *Cluster) ListClusterByOrg(orgID int64) (*[]apistructs.ClusterInfo, error)
- func (c *Cluster) ListClusterByOrgAndType(orgID int64, clusterType string) (*[]apistructs.ClusterInfo, error)
- func (c *Cluster) ListClusterServices(cluster string) ([]apistructs.ServiceUsageData, error)
- func (c *Cluster) PushWithEvent(req *apistructs.ClusterCreateRequest) (int64, error)
- func (c *Cluster) StatisticsClusterResource(cluster, orgName string, hostsNum uint64) (map[string]uint64, error)
- func (c *Cluster) Update(orgID int64, req *apistructs.ClusterUpdateRequest) (int64, error)
- func (c *Cluster) UpdateWithEvent(orgID int64, req *apistructs.ClusterUpdateRequest) (int64, error)
- type Option
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 (*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 ¶
DeleteByName 根据 clusterName 删除集群
func (*Cluster) DeleteWithEvent ¶
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 WithContainerService ¶
WithContainerService 配置 container service
func WithTicketService ¶
WithTicketService 配置 ticket service
Click to show internal directories.
Click to hide internal directories.