kubeapiproxy

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(c *gin.Context)

Download @Summary Download @description 从容器下载到本地 @Tags Kubernetes Api Proxy @Accept json @Param namespace query DownloadQuery true "namespace" default(default) @Param pod query DownloadQuery true "pod" default(nginx-test-76996486df) @Param container query DownloadQuery true "container" default(nginx-0) @Param dest_paths query DownloadQuery true "dest_paths" default(/root) @Param style query DownloadQuery true "style" default(rar) @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/download [get]

func Exec

func Exec(c *gin.Context)

Exec @Summary Exec @description 在pod的容器中执行 @Tags Kubernetes Api Proxy @Param namespace query ExecQuery true "namespace" @Param pods query ExecQuery true "Pod名称" @Param container query ExecQuery true "容器名称" @Param command query ExecQuery true "命令" @Param stdout query ExecQuery false "标准输出" @Param stderr query ExecQuery false "错误输出" @Param tty query ExecQuery false "终端" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/exec [get]

func MultiUpload

func MultiUpload(c *gin.Context)

MultiUpload @Summary MultiUpload @description 批量上传到容器 @Tags Kubernetes Api Proxy @Accept multipart/form-data @Param namespace query MultiUploadQuery true "namespace" default(default) @Param pods query MultiUploadQuery true "pods" default(nginx-test-76996486df) @Param dest_path query MultiUploadQuery false "dest_path" default(/root/) @Param files formData file true "files" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/multiupload [post]

func Namespace

func Namespace(c *gin.Context)

Namespace @Summary Namespace @description 命名空间列表 @Tags Kubernetes Api Proxy @Param namespace query NamespaceSQuery false "namespace" @Param field_selector query NamespaceSQuery false "field_selector" @Param label_selector query NamespaceSQuery false "label_selector" @Param limit query NamespaceSQuery false "limit" @Param continue query NamespaceSQuery false "continue" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/namespace [get]

func Pods

func Pods(c *gin.Context)

Pods @Summary Pods @description 命名空间下Pod资源列表 @Tags Kubernetes Api Proxy @Param namespace query PodsQuery false "namespace" default(test) @Param pods query PodsQuery false "pods" @Param field_selector query PodsQuery false "field_selector" @Param label_selector query PodsQuery false "label_selector" @Param limit query PodsQuery false "limit" default(10) @Param continue query PodsQuery false "continue" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/pods [get]

func Pvcs added in v1.0.6

func Pvcs(c *gin.Context)

Pvcs @Summary Pvcs @description 命名空间下Pvc资源列表 @Tags Kubernetes Api Proxy @Param namespace query PvcsQuery false "namespace" default(test) @Param pvcs query PvcsQuery false "pvcs" @Param field_selector query PvcsQuery false "field_selector" @Param label_selector query PvcsQuery false "label_selector" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/pvcs [get]

func Terminal

func Terminal(c *gin.Context)

Terminal @Summary Container terminal @description pod 中容器的终端 @Tags Kubernetes Api Proxy @Param namespace query TerminalQuery true "namespace" default(default) @Param pod query TerminalQuery true "Pod名称" @Param container query TerminalQuery true "容器名称" @Param shell query TerminalQuery false "shell" default(sh[bash/sh/cmd]) @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/terminal [get]

func UploadPVC added in v1.0.6

func UploadPVC(c *gin.Context)

UploadPVC @Summary Upload @description 上传到PVC @Tags Kubernetes Api Proxy @Accept multipart/form-data @Param namespace query UploadQuery true "namespace" default(default) @Param pvc query UploadQuery true "pvc" default(nginx-test-76996486df) @Param files formData file true "files" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/uploadpvc [post]

func UploadPods added in v1.0.6

func UploadPods(c *gin.Context)

UploadPods @Summary Upload @description 上传到容器 @Tags Kubernetes Api Proxy @Accept multipart/form-data @Param namespace query UploadQuery true "namespace" default(default) @Param pod query UploadQuery true "pod" default(nginx-test-76996486df) @Param containers query UploadQuery true "containers" default(nginx-0) @Param dest_path query UploadQuery false "dest_path" default(/root/) @Param files formData file true "files" @Success 200 {object} handlers.JSONResult @Failure 500 {object} handlers.JSONResult @Router /api/kubeapiproxy/upload [post]

Types

type DownloadQuery

type DownloadQuery struct {
	Namespace string   `json:"namespace" form:"namespace" binding:"required"`
	Pod       string   `json:"pod" form:"pod" binding:"required"`
	Container string   `json:"container" form:"container" binding:"required"`
	DestPaths []string `json:"dest_paths" form:"dest_paths" binding:"required"`
	Style     string   `json:"style" form:"style"`
}

type ExecQuery

type ExecQuery struct {
	Namespace string   `json:"namespace" form:"namespace" binding:"required"`
	Pod       string   `json:"pod" form:"pod" binding:"required"`
	Container string   `json:"container" form:"container" binding:"required"`
	Stdout    bool     `json:"stdout" form:"stdout"`
	Stderr    bool     `json:"stderr" form:"stderr"`
	Tty       bool     `json:"tty" form:"tty"`
	Commands  []string `json:"commands" form:"commands"`
}

type MultiUploadQuery

type MultiUploadQuery struct {
	Namespace string   `json:"namespace" form:"namespace" binding:"required"`
	Pods      []string `json:"pods" form:"pods" binding:"required"`
	DestPath  string   `json:"dest_path" form:"dest_path" binding:"required"`
}

type NamespaceSQuery

type NamespaceSQuery struct {
	Namespace     string `json:"namespace" form:"namespace"`
	FieldSelector string `json:"field_selector" form:"field_selector"`
	LabelSelector string `json:"label_selector" form:"label_selector"`
	Limit         int64  `json:"limit" form:"limit"`
	Continue      string `json:"continue" form:"continue"`
}

type PodsQuery

type PodsQuery struct {
	Namespace     string   `json:"namespace" form:"namespace"`
	Pods          []string `json:"pods" form:"pods"`
	FieldSelector string   `json:"field_selector" form:"field_selector"`
	LabelSelector string   `json:"label_selector" form:"label_selector"`
	Limit         int64    `json:"limit" form:"limit"`
	Continue      string   `json:"continue" form:"continue"`
}

type PvcsQuery added in v1.0.6

type PvcsQuery struct {
	Namespace     string   `json:"namespace" form:"namespace"`
	Pvcs          []string `json:"pvcs" form:"pvcs"`
	FieldSelector string   `json:"field_selector" form:"field_selector"`
	LabelSelector string   `json:"label_selector" form:"label_selector"`
	Limit         int64    `json:"limit" form:"limit"`
	Continue      string   `json:"continue" form:"continue"`
}

type TerminalQuery

type TerminalQuery struct {
	Namespace string `json:"namespace" form:"namespace" binding:"required"`
	Pod       string `json:"pod" form:"pod" binding:"required"`
	Container string `json:"container" form:"container" binding:"required"`
	Shell     string `json:"shell" form:"shell"`
}

type UploadPVCQuery added in v1.0.6

type UploadPVCQuery struct {
	Namespace string `json:"namespace" form:"namespace" binding:"required"`
	Pvc       string `json:"pvc" form:"pvc" binding:"required"`
}

type UploadQuery

type UploadQuery struct {
	Namespace  string   `json:"namespace" form:"namespace" binding:"required"`
	Pod        string   `json:"pod" form:"pod" binding:"required"`
	Containers []string `json:"containers" form:"containers"`
	DestPath   string   `json:"dest_path" form:"dest_path" binding:"required"`
}

Jump to

Keyboard shortcuts

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