container

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

Documentation

Index

Constants

View Source
const (
	// EDAS edas集群
	EDAS = "edas"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

Container 资源对象操作封装

func New

func New(options ...Option) *Container

New 新建 Container 实例,通过 Container 实例操作企业资源

func (*Container) ComponentOrAddonSearch

func (c *Container) ComponentOrAddonSearch(cluster, searchType, searchValue string) ([]apistructs.Resource, error)

ComponentOrAddonSearch 按compoenent & addon 过滤 TODO 专为搜索使用,搜索API重构后可去除

func (*Container) ConvertToContainer

func (c *Container) ConvertToContainer(fields map[string]interface{}) *model.Container

ConvertToContainer 根据kafka推送的消息转换成contaienr对象

func (*Container) Create

func (c *Container) Create(container *model.Container) error

Create 创建容器

func (*Container) CreateOrUpdateContainer

func (c *Container) CreateOrUpdateContainer(container *model.Container) error

CreateOrUpdateContainer 创建或更新容器

func (*Container) GetContainerByTaskIDOrContainerID

func (c *Container) GetContainerByTaskIDOrContainerID(cluster, taskID, containerID string) ([]model.Container, error)

GetContainerByTaskIDOrContainerID

func (*Container) GetRunningAddonByClusterAndAddon

func (c *Container) GetRunningAddonByClusterAndAddon(clusterName, addonID string) ([]apistructs.ContainerFetchResponseData, error)

GetRunningAddonByClusterAndAddon 根据 clusterName 获取运行中 addon 容器列表

func (*Container) GetRunningComponentByClusterAndComponent

func (c *Container) GetRunningComponentByClusterAndComponent(clusterName, component string) ([]apistructs.ContainerFetchResponseData, error)

GetRunningComponentByClusterAndComponent 根据 clusterName 获取运行中 component 容器列表

func (*Container) ListAllByService

func (c *Container) ListAllByService(runtimeID, serviceName string) ([]apistructs.Container, error)

ListAllByService 根据serviceName 获取所有实例列表(包含运行中 & 已停止)

func (*Container) ListByApp

func (c *Container) ListByApp(appID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByApp 根据 appID 获取容器列表

func (*Container) ListByCluster

func (c *Container) ListByCluster(clusterName, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByCluster 根据 clusterName 获取容器列表

func (*Container) ListByHost

func (c *Container) ListByHost(clusterName, hostIP string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByHost 根据 clusterName & hostIP 获取容器列表

func (*Container) ListByOrg

func (c *Container) ListByOrg(orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByOrg 根据 orgID 获取容器列表

func (*Container) ListByProject

func (c *Container) ListByProject(projectID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByProject 根据 projectID 获取容器列表

func (*Container) ListByRuntime

func (c *Container) ListByRuntime(runtimeID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)

ListByRuntime 根据 runtimeID 获取容器列表

func (*Container) ListClusterServices

func (c *Container) ListClusterServices(clusterName string) ([]apistructs.ServiceUsageData, error)

ListClusterServicesList 获取指定集群的所有service列表

func (*Container) ListComponentUsageByCluster

func (c *Container) ListComponentUsageByCluster(clusterName string) ([]apistructs.ComponentUsageFetchResponseData, error)

ListComponentUsageByCluster 根据 clusterName 获取平台组件资源使用列表

func (*Container) ListEdasByParams

ListEdasByParams 根据 params 过滤出 EDAS 容器列表

func (*Container) ListRunningByClusterAndHost

func (c *Container) ListRunningByClusterAndHost(clusterName, hostIP string) ([]apistructs.Container, error)

ListRunningByClusterAndHost 根据 cluster & hostIP 获取运行中容器列表

func (*Container) ListRunningByService

func (c *Container) ListRunningByService(runtimeID, serviceName string) ([]apistructs.Container, error)

ListRunningByService 根据serviceName 获取运行中实例列表

func (*Container) ListStoppedByService

func (c *Container) ListStoppedByService(runtimeID, serviceName string) ([]apistructs.Container, error)

ListStoppedByService 根据serviceName 获取已停止实例列表

func (*Container) SearchContainer

func (c *Container) SearchContainer(cluster, keyword, orgID string) ([]apistructs.Resource, error)

SearchContainer 按容器过滤 TODO 搜索API重构后可去除

func (*Container) SearchService

func (c *Container) SearchService(clusterName, keyword, orgID string) ([]apistructs.Resource, error)

SearchService 服务范围内搜索 TODO 专为搜索使用,搜索API重构后可去除

func (*Container) SyncContainerInfo

func (c *Container) SyncContainerInfo(containers []*model.Container) error

SyncContainerInfo 容器全量事件同步

func (*Container) Update

func (c *Container) Update(container *model.Container) error

Update 更新容器

type ContainerList

type ContainerList []model.Container

A slice of Container that implements sort.Interface to sort by Value.

func (ContainerList) Len

func (cl ContainerList) Len() int

func (ContainerList) Less

func (cl ContainerList) Less(i, j int) bool

func (ContainerList) Swap

func (cl ContainerList) Swap(i, j int)

type Option

type Option func(*Container)

Option 定义 Container 对象的配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

Jump to

Keyboard shortcuts

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