apis

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 90 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreate  = "create"
	ActionDelete  = "delete"
	ActionUpdate  = "update"
	ActionPatch   = "patch"
	ActionList    = "list"
	ActionGet     = "get"
	ActionCheck   = "check"
	ActionEnable  = "enable"
	ActionDisable = "disable"
)
View Source
const (
	DebugAgentNamespace = "debug-tools"
	DebugAgentImage     = "kubegems/debug-agent:latest"
	DebugToolsImage     = "kubegems/debug-tools:latest"
)
View Source
const ChangeCauseAnnotation = "kubernetes.io/change-cause"
View Source
const WatcherRefreshInterval = 5 * time.Second

Variables

View Source
var NewPageDataFromContext = pagination.NewPageDataFromContext

Functions

func ExtractList

func ExtractList(obj runtime.Object) ([]client.Object, error)

func GetDeploymentInfo

func GetDeploymentInfo(ctx context.Context, cli client.Client, namespace string, name string) (*rollout.RolloutInfo, error)

func GetRolloutInfo

func GetRolloutInfo(ctx context.Context, cli client.Client, namespace, name string) (*rollout.RolloutInfo, error)

func NewJaegerHandler

func NewJaegerHandler(server string) *jaegerHandler

func NewPrometheusHandler

func NewPrometheusHandler(server string) (*prometheusHandler, error)

func NewRolloutInfo

func NewRolloutInfo(ro *rolloutsv1alpha1.Rollout,
	allReplicaSets []appsv1.ReplicaSet,
	allPods []corev1.Pod,
	allExperiments []rolloutsv1alpha1.Experiment,
	allARs []rolloutsv1alpha1.AnalysisRun,
) *rollout.RolloutInfo

func NotOK

func NotOK(c *gin.Context, err error)

func OK

func OK(c *gin.Context, data interface{})

如果是非成功的响应,使用 NotOK

func Run

func Run(ctx context.Context, cluster cluster.Interface, system *system.Options, options *Options, debugOptions *DebugOptions) error

nolint: funlen

func ServeWatchThen

func ServeWatchThen(c *gin.Context, cli client.Client, namespace, name string, watchlist client.ObjectList,
	onchangefunc func(obj client.Object) (interface{}, error),
)

func WatchEvents

func WatchEvents(c *gin.Context, cluster cluster.Interface, list client.ObjectList, opts ...client.ListOption) error

Types

type AlertHandler

type AlertHandler struct {
	*Watcher
}

获取各个集群的告警信息

func (*AlertHandler) Webhook

func (h *AlertHandler) Webhook(c *gin.Context)

@Tags Agent.V1 @Summary 检查alertmanagerconfig @Description 检查alertmanagerconfig @Accept json @Produce json @Success 200 {object} handlers.ResponseStruct{Data=string} "" @Router /alert [post] @Security JWT

type AlertmanagerHandler

type AlertmanagerHandler struct {
	C kubernetes.Interface
	// contains filtered or unexported fields
}

获取各个集群的告警信息

func NewAlertmanagerClient

func NewAlertmanagerClient(server string, k8sclient kubernetes.Interface) (*AlertmanagerHandler, error)

func (*AlertmanagerHandler) CheckConfig

func (h *AlertmanagerHandler) CheckConfig(c *gin.Context)

@Tags Agent.V1 @Summary 检查alertmanagerconfig @Description 检查alertmanagerconfig @Accept json @Produce json @Param form body v1alpha1.AlertmanagerConfig true "body" @Success 200 {object} handlers.ResponseStruct{Data=string} "" @Router /v1/proxy/cluster/{cluster}/custom/alertmanager/v1/alerts/_/actions/check [post] @Security JWT

func (*AlertmanagerHandler) CreateSilence

func (h *AlertmanagerHandler) CreateSilence(c *gin.Context)

@Tags Agent.V1 @Summary 为指定告警规则添加silence @Description 添加告警silence @Accept json @Produce json @Param cluster path string true "cluster" @Param from body types.Silence true "silence" @Success 200 {object} handlers.ResponseStruct{Data=string} "" @Router /v1/proxy/cluster/{cluster}/custom/alertmanager/v1/silence/_/actions/create [post] @Security JWT

func (*AlertmanagerHandler) DeleteSilence

func (h *AlertmanagerHandler) DeleteSilence(c *gin.Context)

@Tags Agent.V1 @Summary get silence @Description get silence @Accept json @Produce json @Param cluster path string true "cluster" @Param id query string true "id" @Success 200 {object} handlers.ResponseStruct{Data=string} "" @Router /v1/proxy/cluster/{cluster}/custom/alertmanager/v1/silence/_/actions/delete [delete] @Security JWT

func (*AlertmanagerHandler) ListAlerts

func (h *AlertmanagerHandler) ListAlerts(c *gin.Context)

@Tags Agent.V1 @Summary 获取alertmanager中的告警数据 @Description 获取alertmanager中的告警数据 @Accept json @Produce json @Param cluster path string true "cluster" @Param filter query string false "filter" @Param receiver query string false "receiver" @Param silenced query bool false "silenced" @Param inhibited query bool false "inhibited" @Param active query bool false "active" @Param unprocessed query bool false "unprocessed" @Success 200 {object} handlers.ResponseStruct{Data=[]client.ExtendedAlert} "labelvalues" @Router /v1/proxy/cluster/{cluster}/custom/alertmanager/v1/alerts [get] @Security JWT

func (*AlertmanagerHandler) ListSilence

func (h *AlertmanagerHandler) ListSilence(c *gin.Context)

@Tags Agent.V1 @Summary get silence @Description get silence @Accept json @Produce json @Param cluster path string true "cluster" @Param filter query string true "filter" @Success 200 {object} handlers.ResponseStruct{Data=string} "" @Router /v1/proxy/cluster/{cluster}/custom/alertmanager/v1/silence [get] @Security JWT

type ArgoRolloutHandler

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

func (*ArgoRolloutHandler) GetRolloutDepInfo

func (h *ArgoRolloutHandler) GetRolloutDepInfo(c *gin.Context)

@Tags Agent.V1 @Summary rollout info @Description rollout info(deployment) @Param cluster path string true "cluster" @Success 200 {object} object "rollout.RolloutInfo" @Router /v1/proxy/cluster/{cluster}/custom/argoproj.io/v1alpha1/namespaces/{namespace}/rollouts/{name}/actions/depinfo [get] @Security JWT

func (*ArgoRolloutHandler) GetRolloutInfo

func (h *ArgoRolloutHandler) GetRolloutInfo(c *gin.Context)

@Tags Agent.V1 @Summary rollout info @Description rollout info(argo rollout) @Param cluster path string true "cluster" @Success 200 {object} object "rollout.RolloutInfo" @Router /v1/proxy/cluster/{cluster}/custom/argoproj.io/v1alpha1/namespaces/{namespace}/rollouts/{name}/actions/info [get] @Security JWT

type ClusterHandler

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

func (*ClusterHandler) APIResources

func (h *ClusterHandler) APIResources(c *gin.Context)

@Tags Agent.V1 @Summary 获取k8s api-resources @Description 获取k8s api-resources @Accept json @Produce json @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=[]object} "resp" @Router /v1/proxy/cluster/{cluster}/api-resources [get]

type ComponentStatus

type ComponentStatus struct {
	IsHealthy bool
	Reasons   []string `json:",omitempty"`
	Count     int
}

type CustomNode

type CustomNode struct {
	Node          *corev1.Node
	TotalRequests map[corev1.ResourceName]resource.Quantity
	TotalLimits   map[corev1.ResourceName]resource.Quantity
}

type DebugOptions

type DebugOptions struct {
	Image       string `json:"image,omitempty"`
	Namespace   string `json:"namespace,omitempty"`
	PodSelector string `json:"podSelector,omitempty"`
	Container   string `json:"container,omitempty"`
}

func NewDefaultDebugOptions

func NewDefaultDebugOptions() *DebugOptions

type EventHandler

type EventHandler struct {
	C client.Client
}

func (*EventHandler) List

func (h *EventHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取Event列表数据 @Description 获取Event列表数据 @Accept json @Produce json @Param order query string false "page" @Param page query int false "page" @Param size query int false "page" @Param search query string false "search" @Param namespace path string true "namespace" @Param cluster path string true "cluster" @Param topkind query string false "topkind" @Param topname query string false "topname" @Success 200 {object} handlers.ResponseStruct{Data=pagination.PageData{List=[]object}} "Event" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/events [get] @Security JWT

type EvtHandler

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

func (EvtHandler) OnAdd

func (eh EvtHandler) OnAdd(obj interface{})

func (EvtHandler) OnDelete

func (eh EvtHandler) OnDelete(obj interface{})

func (EvtHandler) OnUpdate

func (eh EvtHandler) OnUpdate(oldObj interface{}, newObj interface{})

type GVKN

type GVKN struct {
	Action string
	schema.GroupVersionKind
	Namespace     string
	Resource      string
	Name          string
	Labels        map[string]string
	LabelSelector string
}

type JobHandler

type JobHandler struct {
	C client.Client
	// contains filtered or unexported fields
}

func (*JobHandler) List

func (h *JobHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取Job列表数据 @Description 获取Job列表数据 @Accept json @Produce json @Param order query string false "page" @Param search query string false "search" @Param page query int false "page" @Param size query int false "page" @Param namespace path string true "namespace" @Param cluster path string true "cluster" @Param topkind query string false "topkind(cronjob)" @Param topname query string false "topname" @Success 200 {object} handlers.ResponseStruct{Data=pagination.PageData{List=[]object}} "Job" @Router /v1/proxy/cluster/{cluster}/custom/batch/v1/namespaces/{namespace}/jobs [get] @Security JWT

type KubectlHandler

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

func (*KubectlHandler) ExecKubectl

func (h *KubectlHandler) ExecKubectl(c *gin.Context)

ExecKubectl kubectl @Tags Agent.V1 @Summary kubectl @Description kubectl @Param cluster path string true "cluster" @Param stream query string true "stream must be true" @Success 200 {object} object "ws" @Router /v1/proxy/cluster/{cluster}/custom/system/v1/kubectl [get] @Security JWT

type LokiHandler

type LokiHandler struct {
	Server string
}

func (*LokiHandler) AlertRule

func (h *LokiHandler) AlertRule(c *gin.Context)

@Tags Agent.V1 @Summary Loki Alert Rule @Description Loki Alert Rule @Accept json @Produce json @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=map[string]prometheus.RealTimeAlertRule} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/alertrule [get] @Security JWT

func (*LokiHandler) LabelValues

func (h *LokiHandler) LabelValues(c *gin.Context)

@Tags Agent.V1 @Summary Loki LabelValues @Description Loki LabelValues @Accept json @Produce json @Param cluster path string true "cluster" @Param start query string true "The start time for the query as a nanosecond Unix epoch" @Param end query string true "The end time for the query as a nanosecond Unix epoch" @Param label query string true "label" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/labelvalues [get] @Security JWT

func (*LokiHandler) Labels

func (h *LokiHandler) Labels(c *gin.Context)

@Tags Agent.V1 @Summary Loki Labels @Description Loki Labels @Accept json @Produce json @Param cluster path string true "cluster" @Param start query string true "The start time for the query as a nanosecond Unix epoch" @Param end query string true "The end time for the query as a nanosecond Unix epoch" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/labels [get] @Security JWT

func (*LokiHandler) Query

func (h *LokiHandler) Query(c *gin.Context)

@Tags Agent.V1 @Summary Loki Query @Description Loki Query @Accept json @Produce json @Param cluster path string true "cluster" @Param limit query string false "The max number of entries to return" @Param query query string true "loki query language" @Param time query int false "The evaluation time for the query as a nanosecond Unix epoch or another supported format. Defaults to now" @Param direction query string true "The order to all results" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/query [get] @Security JWT

func (*LokiHandler) QueryRange

func (h *LokiHandler) QueryRange(c *gin.Context)

@Tags Agent.V1 @Summary Loki QueryRange @Description Loki QueryRange @Accept json @Produce json @Param cluster path string true "cluster" @Param start query string true "The start time for the query as a nanosecond Unix epoch" @Param end query string true "The end time for the query as a nanosecond Unix epoch" @Param direction query string true "The order to all results" @Param limit query string false "The max number of entries to return" @Param query query string true "loki query language" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/queryrange [get] @Security JWT

func (*LokiHandler) Series

func (h *LokiHandler) Series(c *gin.Context)

@Tags Agent.V1 @Summary Loki Series @Description Loki Series @Accept json @Produce json @Param cluster path string true "cluster" @Param start query string true "The start time for the query as a nanosecond Unix epoch" @Param end query string true "The end time for the query as a nanosecond Unix epoch" @Param match query string true "match" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/series [get] @Security JWT

func (*LokiHandler) Tail

func (h *LokiHandler) Tail(c *gin.Context)

@Tags Agent.V1 @Summary Loki LabelValues @Description Loki LabelValues @Accept json @Produce json @Param cluster path string true "cluster" @Param start query string true "The start time for the query as a nanosecond Unix epoch" @Param limit query string false "The max number of entries to return" @Param query query string true "loki query language" @Param delay_for query string true "The number of seconds to delay retrieving logs to let slow loggers catch up. Defaults to 0 and cannot be larger than 5." @Param stream query string true "must be true" @Success 200 {object} handlers.ResponseStruct{Data=object} "" @Router /v1/proxy/cluster/{cluster}/custom/loki/v1/tail [get] @Security JWT

type NamespaceHandler

type NamespaceHandler struct {
	C client.Client
}

func (*NamespaceHandler) List

func (h *NamespaceHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取可以绑定的环境的namespace列表数据 @Description 获取可以绑定的环境的namespace列表数据 @Accept json @Produce json @Param order query string false "page" @Param search query string false "search" @Param page query int false "page" @Param size query int false "page" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=pagination.PageData{List=[]object}} "Namespace" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces [get] @Security JWT

type NodeHandler

type NodeHandler struct {
	C client.Client
}

func (*NodeHandler) Get

func (h *NodeHandler) Get(c *gin.Context)

@Tags Agent.V1 @Summary 自定义的NODE详情接口,(可以获取资源分配情况) @Description 自定义的NODE详情接口,(可以获取资源分配情况) @Accept json @Produce json @Param name path string true "name" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=CustomNode} "Node" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/nodes/{name} [get] @Security JWT

func (*NodeHandler) PatchNodeCordon

func (h *NodeHandler) PatchNodeCordon(c *gin.Context)

@Tags Agent.V1 @Summary 修改节点调度 @Description 修改节点调度 @Accept json @Produce json @Param param body cordonForm true "表单"` @Param name path string true "name" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=object} "Node" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/nodes/{name}/actions/cordon [patch] @Security JWT

func (*NodeHandler) PatchNodeLabelOrAnnotations

func (h *NodeHandler) PatchNodeLabelOrAnnotations(c *gin.Context)

@Tags Agent.V1 @Summary 修改node的元数据,label和annotations @Description 修改node的元数据,label和annotations @Accept json @Produce json @Param param body metaForm true "表单"` @Param name path string true "name" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=object} "Node" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/nodes/{name}/actions/metadata [patch] @Security JWT

func (*NodeHandler) PatchNodeTaint

func (h *NodeHandler) PatchNodeTaint(c *gin.Context)

@Tags Agent.V1 @Summary 修改节点污点 @Description 修改节点污点 @Accept json @Produce json @Param param body taintForm true "表单"` @Param name path string true "name" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=object} "Node" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/nodes/{name}/actions/taint [patch] @Security JWT

type Options

type Options struct {
	PrometheusServer   string `json:"prometheusServer,omitempty"`
	AlertmanagerServer string `json:"alertmanagerServer,omitempty"`
	LokiServer         string `json:"lokiServer,omitempty"`
	JaegerServer       string `json:"jaegerServer,omitempty"`
	EnableHTTPSigs     bool   `json:"enableHTTPSigs,omitempty" description:"check http sigs, default false"`
}

func NewDefaultOptions

func NewDefaultOptions() *Options

type PluginHandler

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

func (*PluginHandler) Disable

func (h *PluginHandler) Disable(c *gin.Context)

@Tags Agent.Plugin @Summary 禁用插件 @Description 禁用插件 @Accept json @Produce json @Param cluster path string true "cluster" @Param name path string true "name" @Param type query string true "type" @Success 200 {object} handlers.ResponseStruct{Data=string} "Plugins" @Router /v1/proxy/cluster/{cluster}/custom/plugins.kubegems.io/v1beta1/installers/{name}/actions/disable [put] @Security JWT

func (*PluginHandler) Enable

func (h *PluginHandler) Enable(c *gin.Context)

@Tags Agent.Plugin @Summary 启用插件 @Description 启用插件 @Accept json @Produce json @Param cluster path string true "cluster" @Param name path string true "name" @Param type query string true "type" @Success 200 {object} handlers.ResponseStruct{Data=string} "Plugins" @Router /v1/proxy/cluster/{cluster}/custom/plugins.kubegems.io/v1beta1/installers/{name}/actions/enable [put] @Security JWT

func (*PluginHandler) List

func (h *PluginHandler) List(c *gin.Context)

@Tags Agent.Plugin @Summary 获取Plugin列表数据 @Description 获取Plugin列表数据 @Accept json @Produce json @Param cluster path string true "cluster" @Param simple query bool true "simple" @Success 200 {object} handlers.ResponseStruct{Data=map[string]map[string]PluginStatus} "Plugins" @Router /v1/proxy/cluster/{cluster}/custom/plugins.kubegems.io/v1beta1/installers [get] @Security JWT

type PluginStatus

type PluginStatus struct {
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	Required    bool   `json:"required"`
	Icon        string `json:"icon"`
	Description string `json:"description"`
	Version     string `json:"version"`
	Enabled     bool   `json:"enabled"`
	Healthy     bool   `json:"healthy"`
	Message     string `json:"message"`
	// contains filtered or unexported fields
}

type PodHandler

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

func (*PodHandler) DebugPod

func (h *PodHandler) DebugPod(c *gin.Context)

ExecContainer 调试容器(websocket) @Tags Agent.V1 @Summary 调试容器(websocket) @Description 调试容器(websocket) @Param cluster path string true "cluster" @Param namespace path string true "namespace" @Param name path string true "pod name" @Param container query string true "container" @Param stream query string true "must be true" @Param agentiamge query string false "agentimage" @Param debugimage query string false "debugimage" @Param forkmode query string false "forkmode" @Success 200 {object} object "ws" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/{namespace}/pods/{name}/actions/debug [get] @Security JWT

func (*PodHandler) ExecPods

func (h *PodHandler) ExecPods(c *gin.Context)

ExecContainer 进入容器交互执行命令 @Tags Agent.V1 @Summary 进入容器交互执行命令(websocket) @Description 进入容器交互执行命令(websocket) @Param cluster path string true "cluster" @Param namespace path string true "namespace" @Param pod path string true "pod" @Param container query string true "container" @Param stream query string true "stream must be true" @Param token query string true "token" @Param shell query string false "default sh, choice(bash,ash,zsh)" @Success 200 {object} object "ws" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/pods/{name}/actions/shell [get] @Security JWT

func (*PodHandler) GetContainerLogs

func (h *PodHandler) GetContainerLogs(c *gin.Context)

GetContainerLogs 获取容器的stdout输出 @Tags Agent.V1 @Summary 实时获取日志STDOUT输出(websocket) @Description 实时获取日志STDOUT输出(websocket) @Param cluster path string true "cluster" @Param namespace path string true "namespace" @Param namespace path string true "namespace" @Param pod path string true "pod" @Param container query string true "container" @Param stream query string true "stream must be true" @Param follow query string true "follow" @Param tail query int false "tail line (default 1000)" @Success 200 {object} object "ws" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/pods/{name}/actions/logs [get] @Security JWT

func (*PodHandler) List

func (h *PodHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取Pod列表数据 @Description 获取Pod列表数据 @Accept json @Produce json @Param order query string false "page" @Param search query string false "search" @Param page query int false "page" @Param size query int false "page" @Param namespace path string true "namespace" @Param fieldSelector query string false "fieldSelector, 只支持podstatus={xxx}格式" @Param cluster path string true "cluster" @Param topkind query string false "topkind(Deployment,StatefulSet,DaemonSet,Job,Node)" @Param topname query string false "topname" @Success 200 {object} handlers.ResponseStruct{Data=handlers.PageData{List=[]object}} "Pod" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/pods [get] @Security JWT

type PvcHandler

type PvcHandler struct {
	C client.Client
}

func (*PvcHandler) Get

func (h *PvcHandler) Get(c *gin.Context)

@Tags Agent.V1 @Summary 获取PersistentVolumeClaim数据 @Description 获取PersistentVolumeClaim数据 @Accept json @Produce json @Param cluster path string true "cluster" @Param name path string true "name" @Param namespace path string true "namespace" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/pvcs/{name} [get] @Security JWT

func (*PvcHandler) List

func (h *PvcHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取PersistentVolumeClaim列表数据 @Description 获取PersistentVolumeClaim列表数据 @Accept json @Produce json @Param order query string false "page" @Param search query string false "search" @Param page query int false "page" @Param size query int false "page" @Param namespace path string true "namespace" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=pagination.PageData{List=[]object}} "PersistentVolumeClaim" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/pvcs [get] @Security JWT

type REST

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

func (*REST) Create

func (h *REST) Create(c *gin.Context)

@Tags Agent.V1 @Summary 创建 none namespaced scope workload @Description 创建 none namespaced scope workload @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Param data body object true "body" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [post] @Security JWT

func (*REST) Delete

func (h *REST) Delete(c *gin.Context)

@Tags Agent.V1 @Summary 创建namespaced scope workload @Description 创建namespaced scope workload @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [delete] @Security JWT

func (*REST) Get

func (h *REST) Get(c *gin.Context)

@Tags Agent.V1 @Summary 获取namespaced scope workload @Description 获取namespaced scope workload @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [get] @Security JWT

func (*REST) List

func (h *REST) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取namespaced scope workload list @Description 获取namespaced scope workload list @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param namespace path string true "namespace" @Param watch query bool true "watch" @Success 200 {object} handlers.ResponseStruct{Data=[]object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource} [get] @Security JWT

func (*REST) Patch

func (h *REST) Patch(c *gin.Context)

@Tags Agent.V1 @Summary 创建namespaced scope workload @Description 创建namespaced scope workload @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Param data body object true "body" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [patch] @Security JWT

func (*REST) Scale

func (h *REST) Scale(c *gin.Context)

@Tags Agent.V1 @Summary 扩缩容 @Description 扩缩容 @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Param data body scaleForm true "body" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name}/actions/scale [patch] @Security JWT

func (*REST) Update

func (h *REST) Update(c *gin.Context)

@Tags Agent.V1 @Summary 创建namespaced scope workload @Description 创建namespaced scope workload @Accept json @Produce json @Param cluster path string true "cluster" @Param group path string true "group" @Param version path string true "version" @Param resource path string true "resoruce" @Param name path string true "name" @Param namespace path string true "namespace" @Param data body object true "body" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/{group}/{version}/namespaces/{namespace}/{resource}/{name} [put] @Security JWT

type RevisionHistory

type RevisionHistory struct {
	Revision   int64       `json:"revision"`
	CreateTime metav1.Time `json:"createTime"`
	Namespace  string      `json:"namespace"`
	Name       string      `json:"name"`
	Kind       string      `json:"kind"`
	Images     []string    `json:"images"`
	Cause      string      `json:"cause"`
	Extra      string      `json:"extra"`
	Current    bool        `json:"current"`
}

type Revisions

type Revisions []*RevisionHistory

func (Revisions) Len

func (r Revisions) Len() int

func (Revisions) Less

func (r Revisions) Less(i, j int) bool

func (Revisions) Swap

func (r Revisions) Swap(i, j int)

type RolloutHandler

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

func (*RolloutHandler) DaemonSetHistory

func (h *RolloutHandler) DaemonSetHistory(c *gin.Context)

func (*RolloutHandler) DaemonsetRollback

func (h *RolloutHandler) DaemonsetRollback(c *gin.Context)

func (*RolloutHandler) DeploymentHistory

func (h *RolloutHandler) DeploymentHistory(c *gin.Context)

func (*RolloutHandler) DeploymentRollback

func (h *RolloutHandler) DeploymentRollback(c *gin.Context)

func (*RolloutHandler) StatefulSetHistory

func (h *RolloutHandler) StatefulSetHistory(c *gin.Context)

func (*RolloutHandler) StatefulSetRollback

func (h *RolloutHandler) StatefulSetRollback(c *gin.Context)

type SecretHandler

type SecretHandler struct {
	C client.Client
	// contains filtered or unexported fields
}

func (*SecretHandler) List

func (h *SecretHandler) List(c *gin.Context)

@Tags Agent.V1 @Summary 获取Secret列表数据 @Description 获取Secret列表数据,其中包含了对 tls 类型的secret证书详情 @Accept json @Produce json @Param order query string false "page" @Param search query string false "search" @Param page query int false "page" @Param size query int false "page" @Param namespace path string true "namespace" @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=pagination.PageData{List=[]SecretWithCertsInfo}} "Secrets" @Router /v1/proxy/cluster/{cluster}/custom/core/v1/namespaces/{namespace}/secrets [get] @Security JWT

type SecretWithCertsInfo

type SecretWithCertsInfo struct {
	Secret   *corev1.Secret                     `json:"secret,omitempty"`
	CertInfo map[string]certificate.Certificate `json:"certInfo,omitempty"`
}

func (SecretWithCertsInfo) GetCreationTimestamp

func (s SecretWithCertsInfo) GetCreationTimestamp() metav1.Time

func (SecretWithCertsInfo) GetName

func (s SecretWithCertsInfo) GetName() string

type ServiceProxyHandler

type ServiceProxyHandler struct{}

func (*ServiceProxyHandler) ServiceProxy

func (sp *ServiceProxyHandler) ServiceProxy(c *gin.Context)

type SortAndSearchAble

type SortAndSearchAble = pagination.SortAndSearchAble

type StatisticsHandler

type StatisticsHandler struct {
	C client.Client
}

func (*StatisticsHandler) ClusterResourceStatistics

func (sth *StatisticsHandler) ClusterResourceStatistics(c *gin.Context)

ClusterResourceStatistics 获取集群级别资源统计 @Tags Agent.V1 @Summary 获取集群级别资源统计 @Description 获取集群级别资源统计 @Accept json @Produce json @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/custom/statistics.system/v1/resources [get] @Security JWT

func (*StatisticsHandler) ClusterWorkloadStatistics

func (sth *StatisticsHandler) ClusterWorkloadStatistics(c *gin.Context)

@Tags Agent.V1 @Summary 获取集群内各种workload的统计 @Description 获取集群内各种workload的统计 @Accept json @Produce json @Param cluster path string true "cluster" @Success 200 {object} handlers.ResponseStruct{Data=object} "counter" @Router /v1/proxy/cluster/{cluster}/custom/statistics.system/v1/workloads [get] @Security JWT

type SyncConn

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

websocket conn 不支持并发,当前场景需要读写锁

type Watcher

type Watcher struct {
	Cache       cache.Cache
	Connections sync.Map
}

func NewWatcher

func NewWatcher(c cache.Cache) *Watcher

func (*Watcher) DispatchMessage

func (w *Watcher) DispatchMessage(obj interface{})

func (*Watcher) Notify

func (w *Watcher) Notify(obj interface{}, evt msgbus.EventKind)

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) StreamWatch

func (w *Watcher) StreamWatch(c *gin.Context)

StreamWatch watch集群的事件 [不暴露给客户端]

Jump to

Keyboard shortcuts

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