serviceaccount

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNameSpace

func AddNameSpace(ctx *gin.Context)

@BasePath /api/v1 PingProject godoc @Summary AddNameSpace @Schemes @Description ADD ServiceAccount NameSpace @Tags AddNameSpace @Accept json @Produce json @Security ApiKeyAuth @Param ReqeustBody body AddSaNsRequestBody true "Add Sa NameSpace" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/addns [post] @ID AddNameSpace

func CreateSa

func CreateSa(ctx *gin.Context)

@BasePath /api/v1 PingProject godoc @Summary CreateSa @Schemes @Description Create ServiceAccount @Tags CreateSa @Accept json @Produce json @Security ApiKeyAuth @Param ReqeustBody body CreateSaRequestBody true "Create Sa" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/create [post] @ID CreateSa

func DeleteNs

func DeleteNs(ctx *gin.Context)

@BasePath /api/v1 PingProject godoc @Summary DeleteNs @Schemes @Description Delete ServiceAccount NameSpace @Tags DeleteNs @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project_Name" @Param cluster_name query string true "Cluster_Name" @Param sa_name query string true "Sa_Name" @Param namespace query string true "NameSpace" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/delns [delete] @ID DeleteNs

func DeleteSa

func DeleteSa(ctx *gin.Context)

@BasePath /api/v1 PingCluster godoc @Summary DeleteSa @Schemes @Description Delete ServiceAccount @Tags DeleteSa @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project_Name" @Param cluster_name query string true "Cluster_Name" @Param sa_name query string true "sa_name" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/delete [delete] @ID DeleteSa

func Gettoken

func Gettoken(ctx *gin.Context)

@BasePath /api/v1 PingCluster godoc @Summary Gettoken @Schemes @Description Get SaToken For NameSpace @Tags Gettoken @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project Name" @Param cluster_name query string true "Cluster Name" @Param ns_name query string true "Ns_Name" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/gettoken [get] @ID Gettoken

func ListNs

func ListNs(ctx *gin.Context)

@BasePath /api/v1 PingCluster godoc @Summary ListNs @Schemes @Description List All ServiceAccount's NameSpace @Tags ListNs @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project Name" @Param cluster_name query string true "Cluster Name" @Param sa_name query string true "Sa_Name" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/listns [get] @ID ListNs

func ListSa

func ListSa(ctx *gin.Context)

@BasePath /api/v1 PingCluster godoc @Summary ListSa @Schemes @Description List All ServiceAccount @Tags ListSa @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project Name" @Param cluster_name query string true "Cluster Name" @Param sa_name query string false "Sa Name" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/list [get] @ID ListSa

func SaRouter

func SaRouter(r *gin.RouterGroup)

func UpdateSa

func UpdateSa(ctx *gin.Context)

@BasePath /api/v1 PingCluster godoc @Summary UpdateSaToken @Schemes @Description Update ServiceAccount SaToken @Tags UpdateSaToken @Accept json @Produce json @Security ApiKeyAuth @Param project_name query string true "Project_Name" @Param cluster_name query string true "Cluster_Name" @Param sa_name query string true "Sa_Name" @Param ReqeustBody body UpdateSaRequestBody true "Update ServiceAccount Token" @Success 200 {object} util.Res {"code":200,"data":null,"msg":""} @Success 400 {object} util.Res {"code":400,"data":null,"msg":""} @Success 404 {object} util.Res {"code":404,"data":null,"msg":""} @Success 500 {object} util.Res {"code":500,"data":null,"msg":""} @Router /sa/update [put] @ID UpdateSa

Types

type AddSaNsRequestBody

type AddSaNsRequestBody struct {
	ProjectName string `json:"project_name" binding:"required"`
	ClusterName string `json:"cluster_name" binding:"required"`
	SaName      string `json:"sa_name" binding:"required"`
	Namespace   string `json:"namespace" binding:"required"`
}

type Cluster

type Cluster struct {
	Name      string `json:"name"`
	ClusterID int64  `json:"cluster_id"`
}

type CreateSaRequestBody

type CreateSaRequestBody struct {
	ProjectName string `json:"project_name" binding:"required"`
	ClusterName string `json:"cluster_name" binding:"required"`
	SaName      string `json:"sa_name" binding:"required"`
	SaToken     string `json:"sa_token" binding:"required"`
	Namespace   string `json:"namespace" binding:"required"`
}

type ErrorResp

type ErrorResp struct {
	Msg string `json:"msg"`
}

type NameSpace

type NameSpace struct {
	NsName string `json:"ns_name"`
}

type SaId

type SaId struct {
	SaId string `json:"sa_id"`
}

type SaRes

type SaRes struct {
	ID        int32     `json:"id"`
	SaID      string    `json:"sa_id"`
	SaName    string    `json:"sa_name"`
	SaToken   string    `json:"sa_token"`
	NameSpace string    `json:"namespace"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UpdateSaRequestBody

type UpdateSaRequestBody struct {
	SaToken string `json:"sa_token" binding:"required"`
}

Jump to

Keyboard shortcuts

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