cluster

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructClusterResources added in v0.14.6

func ConstructClusterResources(nodes []model.NodeInfo,
	nodeResources []model.ResourceInfo, queueName string) (map[string]*NodeResourcesResponse, error)

func CreateOrDeleteClusterObject

func CreateOrDeleteClusterObject(ctx *logger.RequestContext, request ObjectRequest, action string) error

func DeleteCluster

func DeleteCluster(ctx *logger.RequestContext, clusterName string) error

func GetClusterObject

func GetClusterObject(ctx *logger.RequestContext, request *ObjectRequest) (interface{}, error)

func InitDefaultCluster added in v0.14.3

func InitDefaultCluster(clusterType string) error

InitDefaultCluster init default cluster for single cluster environment

func IsLastClusterPk

func IsLastClusterPk(ctx *logger.RequestContext, pk int64) bool

func ListClusterQuota

func ListClusterQuota(ctx *logger.RequestContext, clusterNameList []string) (map[string]ClusterQuotaReponse, error)

根据clusterNameList列出其对应的cluster quota信息 如果clusterNameList为空,则返回所有集群的cluster quota信息

func ListClusterResources added in v0.14.6

ListClusterResources return the node resources in clusters, lists can be filtered by labels in pods or nodes

func UpdateClusterObject

func UpdateClusterObject(ctx *logger.RequestContext, clusterName string, clusterObject map[string]interface{}) error

Types

type ClusterCommonInfo

type ClusterCommonInfo struct {
	ID            string   `json:"clusterId"`     // 集群id
	Description   string   `json:"description"`   // 集群描述
	Endpoint      string   `json:"endpoint"`      // 集群endpoint, 比如 http://10.11.11.47:8080
	Source        string   `json:"source"`        // 来源, 比如 OnPremise (内部部署)、AWS、CCE
	ClusterType   string   `json:"clusterType"`   // 集群类型,比如kubernetes/local/yarn
	Version       string   `json:"version"`       // 集群版本v1.16
	Status        string   `json:"status"`        // 集群状态,可选值为online, offline
	Credential    string   `json:"credential"`    // 用于存储集群的凭证信息,比如k8s的kube_config配置
	Setting       string   `json:"setting"`       // 存储额外配置信息
	NamespaceList []string `json:"namespaceList"` // 命名空间列表,json类型,如["ns1", "ns2"]
}

type ClusterQuotaReponse

type ClusterQuotaReponse struct {
	NodeQuotaInfoList []schema.NodeQuotaInfo `json:"nodeList"`
	Summary           schema.QuotaSummary    `json:"summary"`
	ErrMessage        string                 `json:"errMsg"`
}

type CreateClusterRequest

type CreateClusterRequest struct {
	ClusterCommonInfo
	Name string `json:"clusterName"` // 集群名字
}

type CreateClusterResponse

type CreateClusterResponse struct {
	model.ClusterInfo
}

type GetClusterResponse

type GetClusterResponse struct {
	model.ClusterInfo
}

func GetCluster

func GetCluster(ctx *logger.RequestContext, clusterName string) (*GetClusterResponse, error)

type ListClusterRequest

type ListClusterRequest struct {
	Marker          string   `json:"marker"`
	MaxKeys         int      `json:"maxKeys"`
	ClusterNameList []string `json:"clusterNameList"`
	ClusterStatus   string   `json:"clusterStatus"`
}

type ListClusterResourcesRequest added in v0.14.6

type ListClusterResourcesRequest struct {
	ClusterNameList []string `json:"clusterNames"` // list resources by cluster
	QueueName       string   `json:"queueName"`    // list resources by queue
	Labels          string   `json:"labels"`
	LabelType       string   `json:"-"`
	PageNo          int      `json:"pageNo"`
	PageSize        int      `json:"pageSize"`
}

type ListClusterResponse

type ListClusterResponse struct {
	common.MarkerInfo
	ClusterList []model.ClusterInfo `json:"clusterList"`
}

func ListCluster

func ListCluster(ctx *logger.RequestContext, marker string, maxKeys int,
	clusterNameList []string, clusterStatus string) (*ListClusterResponse, error)

type NodeResourcesResponse added in v0.14.6

type NodeResourcesResponse struct {
	Allocatable map[string]map[string]interface{} `json:"allocatable"`
	Capacity    map[string]map[string]string      `json:"capacity"`
	Labels      map[string]map[string]string      `json:"labels"`
	ClusterName string                            `json:"clusterName,omitempty"`
	QueueName   string                            `json:"queueName,omitempty"`
}

type ObjectRequest

type ObjectRequest struct {
	ClusterName      string                  `json:"-"`
	GroupVersionKind schema.GroupVersionKind `json:"-"`
	Object           map[string]interface{}  `json:"-"`
	Name             string                  `json:"name"`
	Namespace        string                  `json:"namespace"`
	Kind             string                  `json:"kind"`
	APIVersion       string                  `json:"apiVersion"`
}

type UpdateClusterReponse

type UpdateClusterReponse struct {
	model.ClusterInfo
}

func UpdateCluster

func UpdateCluster(ctx *logger.RequestContext,
	clusterName string, request *UpdateClusterRequest) (*UpdateClusterReponse, error)

type UpdateClusterRequest

type UpdateClusterRequest struct {
	ClusterCommonInfo
}

Jump to

Keyboard shortcuts

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