model

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTypeWutong = "wutong"
	AppTypeHelm   = "helm"
)

AppType

View Source
const (
	PluginTypeSys string = "sys"
)

Variables

View Source
var ExportHelmChart = "export_helm_chart"

ExportHelmChart -

View Source
var ExportK8sYaml = "export_k8s_yaml"

ExportK8sYaml -

View Source
var FromCodeBuildKing = "build_from_source_code"

FromCodeBuildKing build from code

View Source
var FromImageBuildKing = "build_from_image"

FromImageBuildKing build from image

View Source
var FromMarketImageBuildKing = "build_from_market_image"

FromMarketImageBuildKing build from market image

View Source
var FromMarketSlugBuildKing = "build_from_market_slug"

FromMarketSlugBuildKing build from market slug

Functions

func DecimalFromFloat32 added in v1.1.0

func DecimalFromFloat32(f float32) float32

func NewAppStatusFromExport

func NewAppStatusFromExport(app *ExportAppStruct) *dbmodel.AppStatus

NewAppStatusFromExport -

func NewAppStatusFromImport

func NewAppStatusFromImport(app *ImportAppStruct) *dbmodel.AppStatus

NewAppStatusFromImport -

Types

type AddDependencyStruct

type AddDependencyStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 被依赖的应用id
		// in: body
		// required: true
		DepServiceID string `json:"dep_service_id"`
		// 被依赖的应用类型,添加时需要传值, 删除时不需要传值
		// in: body
		// required: false
		DepServiceType string `json:"dep_service_type"`
		// 不明,默认传 1, 可以不传
		// in: body
		// required: false
		DepOrder string `json:"dep_order"`
	}
}

AddDependencyStruct AddDependencyStruct

type AddEndpiontsReq

type AddEndpiontsReq struct {
	Address string `json:"address" validate:"address|required"`
}

AddEndpiontsReq is one of the Endpoints in the request to add the endpints.

type AddEnvStruct

type AddEnvStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 端口
		// in: body
		// required: false
		ContainerPort int `json:"container_port"`
		// name
		// in: body
		// required: false
		Name string `json:"name"`
		// 变量名称
		// in: body
		// required: true
		AttrName string `json:"env_name"`
		// 变量值, 增加时需要传值, 删除时可以不传
		// in: body
		// required: false
		AttrValue string `json:"env_value"`
		// 是否可以修改
		// in: body
		// required: false
		IsChange bool `json:"is_change"`
		// 应用范围: inner or outer or both
		// in: body
		// required: false
		Scope string `json:"scope"`
	}
}

AddEnvStruct AddEnvStruct

type AddHTTPRuleStruct

type AddHTTPRuleStruct struct {
	HTTPRuleID     string                 `json:"http_rule_id" validate:"http_rule_id|required"`
	ServiceID      string                 `json:"service_id" validate:"service_id|required"`
	ContainerPort  int                    `json:"container_port" validate:"container_port|required"`
	Domain         string                 `json:"domain" validate:"domain|required"`
	Path           string                 `json:"path"`
	Header         string                 `json:"header"`
	Cookie         string                 `json:"cookie"`
	Weight         int                    `json:"weight"`
	IP             string                 `json:"ip"`
	CertificateID  string                 `json:"certificate_id"`
	Certificate    string                 `json:"certificate"`
	PrivateKey     string                 `json:"private_key"`
	RuleExtensions []*RuleExtensionStruct `json:"rule_extensions"`
	PathRewrite    bool                   `json:"path_rewrite"`
	Rewrites       []*Rewrite             `json:"rewrites"`
}

AddHTTPRuleStruct is used to add http rule, certificate and rule extensions

func (*AddHTTPRuleStruct) DbModel

func (h *AddHTTPRuleStruct) DbModel(serviceID string) *dbmodel.HTTPRule

DbModel return database model

type AddNodeLabelStruct

type AddNodeLabelStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 标签值,格式为"[v1, v2, v3]"
		// in: body
		// required: true
		LabelValues []string `json:"label_values" validate:"label_values|required"`
	}
}

AddNodeLabelStruct AddNodeLabelStruct

type AddOrUpdRuleConfigReq

type AddOrUpdRuleConfigReq struct {
	Configs []*AddRuleConfigReq `json:"configs"`
}

AddOrUpdRuleConfigReq -

type AddOrUpdateRegistryAuthSecretStruct added in v1.1.0

type AddOrUpdateRegistryAuthSecretStruct struct {
	TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id|required"`
	SecretID    string `json:"secret_id" validate:"secret_id|required"`
	Domain      string `json:"domain" validate:"domain|required"`
	Username    string `json:"username" validate:"username|required"`
	Password    string `json:"password" validate:"password|required"`
}

AddOrUpdateRegistryAuthSecretStruct is used to add or update registry auth secret

type AddProbeStruct

type AddProbeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 探针id
		// in: body
		// required: true
		ProbeID string `json:"probe_id"`
		// mode
		// in: body
		// required: false
		Mode string `json:"mode"`
		// mode
		// in: body
		// required: false
		Scheme string `json:"scheme"`
		// path
		// in: body
		// required: false
		Path string `json:"path"`
		// 端口, 默认为80
		// in: body
		// required: false
		Port int `json:"port"`
		// 运行命令
		// in: body
		// required: false
		Cmd string `json:"cmd"`
		// http请求头,key=value,key2=value2
		// in: body
		// required: false
		HTTPHeader string `json:"http_header"`
		// 初始化等候时间, 默认为1
		// in: body
		// required: false
		InitialDelaySecond int `json:"initial_delay_second"`
		// 检测间隔时间, 默认为3
		// in: body
		// required: false
		PeriodSecond int `json:"period_second"`
		// 检测超时时间, 默认为30
		// in: body
		// required: false
		TimeoutSecond int `json:"timeout_second"`
		// 是否启用
		// in: body
		// required: false
		IsUsed int `json:"is_used"`
		// 标志为失败的检测次数
		// in: body
		// required: false
		FailureThreshold int `json:"failure_threshold"`
		// 标志为成功的检测次数
		// in: body
		// required: false
		SuccessThreshold int `json:"success_threshold"`
	}
}

AddProbeStruct AddProbeStruct

type AddRuleConfigReq

type AddRuleConfigReq struct {
	ConfigID string `json:"config_id" validate:"config_id|required"`
	RuleID   string `json:"rule_id" validate:"rule_id|required"`
	Key      string `json:"key" validate:"key|required"`
	Value    string `json:"value" validate:"value|required"`
}

AddRuleConfigReq -

type AddServiceLabelStruct

type AddServiceLabelStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 标签值,格式为"v1"
		// in: bod
		// required: true
		LabelValues string `json:"label_values"`
	}
}

AddServiceLabelStruct AddServiceLabelStruct

type AddServiceMonitorRequestStruct

type AddServiceMonitorRequestStruct struct {
	// name
	// in: body
	// required: true
	Name string `json:"name" validate:"name|required"`
	// service_show_name
	// in: body
	// required: true
	ServiceShowName string `json:"service_show_name" validate:"service_show_name|required"`
	// port
	// in: body
	// required: true
	Port int `json:"port" validate:"port|required"`
	// path
	// in: body
	// required: true
	Path string `json:"path" validate:"path|required"`
	// interval
	// in: body
	// required: true
	Interval string `json:"interval" validate:"interval|required"`
}

AddServiceMonitorRequestStruct add service monitor request

func (*AddServiceMonitorRequestStruct) DbModel

func (a *AddServiceMonitorRequestStruct) DbModel(tenantEnvID, serviceID string) *dbmodel.TenantEnvServiceMonitor

DbModel return database model

type AddServicePort

type AddServicePort struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		//in: body
		ServicePorts
	}
}

AddServicePort service port swagger:parameters addPort updatePort

type AddServiceSchedulingLabelRequest added in v1.10.0

type AddServiceSchedulingLabelRequest struct {
	Key   string `json:"label_key"`
	Value string `json:"label_value"`
}

type AddServiceSchedulingTolerationRequest added in v1.10.0

type AddServiceSchedulingTolerationRequest struct {
	Key      string `json:"taint_key"`
	Value    string `json:"taint_value"`
	Operator string `json:"op"`
	Effect   string `json:"effect"`
}

type AddTCPRuleStruct

type AddTCPRuleStruct struct {
	TCPRuleID      string                 `json:"tcp_rule_id" validate:"tcp_rule_id|required"`
	ServiceID      string                 `json:"service_id" validate:"service_id|required"`
	ContainerPort  int                    `json:"container_port"`
	IP             string                 `json:"ip"`
	Port           int                    `json:"port" validate:"service_id|required"`
	RuleExtensions []*RuleExtensionStruct `json:"rule_extensions"`
}

AddTCPRuleStruct is used to add tcp rule and rule extensions

func (*AddTCPRuleStruct) DbModel

func (a *AddTCPRuleStruct) DbModel(serviceID string) *dbmodel.TCPRule

DbModel return database model

type AddTenantEnvServiceEnvVar added in v1.1.0

type AddTenantEnvServiceEnvVar struct {
	Model
	TenantEnvID   string `validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID     string `validate:"service_id|between:30,33" json:"service_id"`
	ContainerPort int    `validate:"container_port|numeric_between:1,65535" json:"container_port"`
	Name          string `validate:"name" json:"name"`
	AttrName      string `validate:"env_name|required" json:"env_name"`
	AttrValue     string `validate:"env_value" json:"env_value"`
	IsChange      bool   `validate:"is_change|bool" json:"is_change"`
	Scope         string `validate:"scope|in:outer,inner,both,build" json:"scope"`
}

AddTenantEnvServiceEnvVar 应用环境变量

func (*AddTenantEnvServiceEnvVar) DbModel added in v1.1.0

func (a *AddTenantEnvServiceEnvVar) DbModel(tenantEnvID, componentID string) *dbmodel.TenantEnvServiceEnvVar

DbModel return database model

type AddTenantEnvStruct added in v1.1.0

type AddTenantEnvStruct struct {
	//in: body
	Body struct {
		// the tenant env id
		// in: body
		// required: false
		TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`
		// the tenant env name
		// in: body
		// required: false
		TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
		// the tenant id
		// in: body
		// required: false
		TenantID string `json:"tenant_id" validate:"tenant_id"`
		// the tenant name
		// in: body
		// required: false
		TenantName  string `json:"tenant_name" validate:"tenant_name"`
		Token       string `json:"token" validate:"token"`
		LimitMemory int    `json:"limit_memory" validate:"limit_memory"`
		Namespace   string `json:"namespace" validate:"namespace"`
	}
}

AddTenantEnvStruct AddTenantEnvStruct swagger:parameters addTenantEnv

type AddVMPortRequest added in v1.7.0

type AddVMPortRequest struct {
	VMPort   int            `json:"vmPort" validate:"vmPort|required"`
	Protocol VMPortProtocol `json:"protocol" validate:"protocol|required"`
}

type AddVMPortResponse added in v1.7.0

type AddVMPortResponse struct {
	VMPort   int             `json:"vmPort"`
	Protocol VMPortProtocol  `json:"protocol"`
	Gateways []VMPortGateway `json:"gateways"`
}

type AddVMVolumeRequest added in v1.10.0

type AddVMVolumeRequest struct {
	VolumeName   string `json:"volumeName" validate:"volumeName|required"`
	StorageClass string `json:"storageClass" validate:"storageClass|required"`
	VolumeSize   int64  `json:"volumeSize" validate:"size|required"`
}

type AddVolumeDependencyStruct

type AddVolumeDependencyStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 依赖的服务id
		// in: body
		// required: true
		DependServiceID string `json:"depend_service_id"  validate:"depend_service_id|required"`
		// 容器挂载目录
		// in: body
		// required: true
		VolumePath string `json:"volume_path" validate:"volume_path|required|regex:^/"`
		// 依赖存储名称
		// in: body
		// required: true
		VolumeName string `json:"volume_name" validate:"volume_name|required|max:50"`

		VolumeType string `json:"volume_type" validate:"volume_type|required|in:share-file,config-file"`
	}
}

AddVolumeDependencyStruct AddVolumeDependencyStruct

type AddVolumeStruct

type AddVolumeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 类型 "application;app_publish"
		// in: body
		// required: true
		Category string `json:"category"`
		// 容器挂载目录
		// in: body
		// required: true
		VolumePath string `json:"volume_path" validate:"volume_path|required|regex:^/"`
		//存储类型(share,local,tmpfs)
		// in: body
		// required: true
		VolumeType string `json:"volume_type" validate:"volume_type|required"`
		// 存储名称(同一个应用唯一)
		// in: body
		// required: true
		VolumeName  string `json:"volume_name" validate:"volume_name|required|max:50"`
		FileContent string `json:"file_content"`
		// 存储驱动别名(StorageClass别名)
		VolumeProviderName string `json:"volume_provider_name"`
		IsReadOnly         bool   `json:"is_read_only"`
		// VolumeCapacity 存储大小
		VolumeCapacity int64 `json:"volume_capacity"` // 单位: Mi
		// AccessMode 读写模式(Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time. #https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
		AccessMode string `json:"access_mode"`
		// SharePolicy 共享模式
		SharePolicy string `json:"share_policy"`
		// BackupPolicy 备份策略
		BackupPolicy string `json:"backup_policy"`
		// ReclaimPolicy 回收策略
		ReclaimPolicy string `json:"reclaim_policy"`
		// AllowExpansion 是否支持扩展
		AllowExpansion bool   `json:"allow_expansion"`
		Mode           *int32 `json:"mode"`
	}
}

AddVolumeStruct AddVolumeStruct

type Addition

type Addition struct {
	Desc  string  `json:"desc" validate:"desc"`
	Items []*Item `json:"items" validate:"items"`
}

Addition 存储附加信息

type AllPluginBuildVersionStruct

type AllPluginBuildVersionStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	//in: path
	//required: true
	PluginID string `json:"plugin_id" validate:"plugin_id"`
}

AllPluginBuildVersionStruct AllPluginBuildVersionStruct

type Annotation added in v1.10.0

type Annotation struct {
	Key   string `json:"annotation_key" validate:"required"`
	Value string `json:"annotation_value"`
}

type AppConfigGroup

type AppConfigGroup struct {
	ConfigGroupName     string               `json:"config_group_name" validate:"required,alphanum,min=2,max=64"`
	DeployType          string               `json:"deploy_type" validate:"required,oneof=env configfile"`
	ConfigItems         []ConfigItem         `json:"config_items"`
	ConfigGroupServices []ConfigGroupService `json:"config_group_services"`
	Enable              bool                 `json:"enable"`
}

AppConfigGroup Interface for synchronizing application configuration groups

func (AppConfigGroup) DbModel

DbModel return database model

type AppConfigGroupRelations

type AppConfigGroupRelations struct {
	ConfigGroupName string `json:"config_group_name"`
}

AppConfigGroupRelations -

func (*AppConfigGroupRelations) DbModel

func (a *AppConfigGroupRelations) DbModel(appID, serviceID, serviceAlias string) *dbmodel.ConfigGroupService

DbModel return database model

type AppPod

type AppPod struct {
	PodName   string `json:"pod_name"`
	PodStatus string `json:"pod_status"`
}

AppPod -

type AppPort

type AppPort struct {
	ServiceID      string `json:"service_id" validate:"required"`
	ContainerPort  int    `json:"container_port" validate:"required"`
	PortAlias      string `json:"port_alias" validate:"required"`
	K8sServiceName string `json:"k8s_service_name" validate:"required"`
}

AppPort -

type AppService

type AppService struct {
	ServiceName string                `json:"service_name"`
	Address     string                `json:"address"`
	Ports       []*pb.AppService_Port `json:"ports"`
	OldPods     []*AppPod             `json:"oldPods"`
	Pods        []*AppPod             `json:"pods"`
}

AppService -

type AppStatus

type AppStatus struct {
	AppID             string                `json:"app_id"`
	AppName           string                `json:"app_name"`
	Status            string                `json:"status"`
	CPU               *int64                `json:"cpu"`
	GPUType           *string               `json:"gpu_type"`
	GPU               *int64                `json:"gpu"`
	Memory            *int64                `json:"memory"`
	Disk              int64                 `json:"disk"`
	Phase             string                `json:"phase"`
	Version           string                `json:"version"`
	Overrides         []string              `json:"overrides"`
	ServiceNum        int                   `json:"service_num"`
	ServiceRunningNum int                   `json:"service_running_num"`
	Conditions        []*AppStatusCondition `json:"conditions"`
	K8sApp            string                `json:"k8s_app"`
}

AppStatus -

type AppStatusCondition

type AppStatusCondition struct {
	Type    string `json:"type"`
	Status  bool   `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

AppStatusCondition is the conditon of app status.

type AppStatusesReq

type AppStatusesReq struct {
	AppIDs []string `json:"app_ids"`
}

AppStatusesReq -

type Application

type Application struct {
	AppName         string   `json:"app_name" validate:"required"`
	AppType         string   `json:"app_type" validate:"required,oneof=wutong helm"`
	ConsoleAppID    int64    `json:"console_app_id"`
	AppID           string   `json:"app_id"`
	TenantEnvID     string   `json:"tenant_env_id"`
	ServiceIDs      []string `json:"service_ids"`
	AppStoreName    string   `json:"app_store_name"`
	AppStoreURL     string   `json:"app_store_url"`
	AppTemplateName string   `json:"app_template_name"`
	Version         string   `json:"version"`
	K8sApp          string   `json:"k8s_app" validate:"required"`
}

Application -

type ApplicationConfigGroup

type ApplicationConfigGroup struct {
	AppID           string       `json:"app_id"`
	ConfigGroupName string       `json:"config_group_name" validate:"required,alphanum,min=2,max=64"`
	DeployType      string       `json:"deploy_type" validate:"required,oneof=env configfile"`
	ServiceIDs      []string     `json:"service_ids"`
	ConfigItems     []ConfigItem `json:"config_items"`
	Enable          bool         `json:"enable"`
}

ApplicationConfigGroup -

type ApplicationConfigGroupResp

type ApplicationConfigGroupResp struct {
	CreateTime      time.Time                     `json:"create_time"`
	AppID           string                        `json:"app_id"`
	ConfigGroupName string                        `json:"config_group_name"`
	DeployType      string                        `json:"deploy_type"`
	Services        []*dbmodel.ConfigGroupService `json:"services"`
	ConfigItems     []*dbmodel.ConfigGroupItem    `json:"config_items"`
	Enable          bool                          `json:"enable"`
}

ApplicationConfigGroupResp -

type Attr

type Attr struct {
	Action      string `json:"action"`
	TenantEnvID string `json:"tenant_env_id"`
	ServiceID   string `json:"service_id"`
	AttrName    string `json:"env_name"`
	AttrValue   string `json:"env_value"`
}

Attr attr

type AuthInfo added in v1.1.0

type AuthInfo struct {
	Token string `json:"token"`
}

type AuthInfoItem added in v1.1.0

type AuthInfoItem struct {
	Name     string    `json:"name"`
	AuthInfo *AuthInfo `json:"user"`
}

type AuthInfoList added in v1.1.0

type AuthInfoList []*AuthInfoItem

type AutoScalerRule

type AutoScalerRule struct {
	RuleID      string       `json:"rule_id"`
	Enable      bool         `json:"enable"`
	XPAType     string       `json:"xpa_type"`
	MinReplicas int          `json:"min_replicas"`
	MaxReplicas int          `json:"max_replicas"`
	RuleMetrics []RuleMetric `json:"metrics"`
}

AutoScalerRule -

func (AutoScalerRule) DbModel

DbModel return database model

type AutoscalerRuleReq

type AutoscalerRuleReq struct {
	RuleID      string `json:"rule_id" validate:"rule_id|required"`
	ServiceID   string
	Enable      bool   `json:"enable" validate:"enable|required"`
	XPAType     string `json:"xpa_type" validate:"xpa_type|required"`
	MinReplicas int    `json:"min_replicas" validate:"min_replicas|required"`
	MaxReplicas int    `json:"max_replicas" validate:"min_replicas|required"`
	Metrics     []struct {
		MetricsType       string `json:"metric_type"`
		MetricsName       string `json:"metric_name"`
		MetricTargetType  string `json:"metric_target_type"`
		MetricTargetValue int    `json:"metric_target_value"`
	} `json:"metrics"`
}

AutoscalerRuleReq -

type AutoscalerRuleResp

type AutoscalerRuleResp struct {
	RuleID      string `json:"rule_id"`
	ServiceID   string `json:"service_id"`
	Enable      bool   `json:"enable"`
	XPAType     string `json:"xpa_type"`
	MinReplicas int    `json:"min_replicas"`
	MaxReplicas int    `json:"max_replicas"`
	Metrics     []struct {
		MetricsType       string `json:"metric_type"`
		MetricsName       string `json:"metric_name"`
		MetricTargetType  string `json:"metric_target_type"`
		MetricTargetValue int    `json:"metric_target_value"`
	} `json:"metrics"`
}

AutoscalerRuleResp -

type BackupRecord added in v1.6.0

type BackupRecord struct {
	BackupID       string `json:"backup_id"`
	ServiceID      string `json:"service_id"`
	Desc           string `json:"desc"`
	TTL            string `json:"ttl"`
	Mode           string `json:"mode"`
	CreatedAt      string `json:"created_at"`
	CompletedAt    string `json:"completed_at"`
	ExpiredAt      string `json:"expired_at"`
	Size           string `json:"size"`
	ProgressRate   string `json:"progress_rate"`
	CompletedItems int    `json:"completed_items"`
	TotalItems     int    `json:"total_items"`
	Scheduled      bool   `json:"scheduled"`
	Status         string `json:"status"`
	FailureReason  string `json:"failure_reason"`
	Operator       string `json:"operator"`
	Restorable     bool   `json:"restorable"`
}

type BackupSchedule added in v1.6.0

type BackupSchedule struct {
	ScheduleID   string `json:"schedule_id"`
	ServiceID    string `json:"service_id"`
	Desc         string `json:"desc"`
	TTL          string `json:"ttl"`
	Cron         string `json:"cron"`
	Creator      string `json:"creator"`
	LastModifier string `json:"last_modifier"`
}

type BackupStatus added in v1.6.0

type BackupStatus string

type BaseEnv

type BaseEnv struct {
	Options map[string]interface{} `json:"options"`
}

BaseEnv 无平台定义类型,普通kv

type BasePort

type BasePort struct {
	ServiceAlias string `json:"service_alias"`
	ServiceID    string `json:"service_id"`
	//Port is the real app port
	Port int `json:"port"`
	//ListenPort is mesh listen port, proxy connetion to real app port
	ListenPort int                    `json:"listen_port"`
	Protocol   string                 `json:"protocol"`
	Options    map[string]interface{} `json:"options"`
}

BasePort base of current app ports

type BaseService

type BaseService struct {
	ServiceAlias       string                 `json:"service_alias"`
	ServiceID          string                 `json:"service_id"`
	DependServiceAlias string                 `json:"depend_service_alias"`
	DependServiceID    string                 `json:"depend_service_id"`
	Port               int                    `json:"port"`
	Protocol           string                 `json:"protocol"`
	Options            map[string]interface{} `json:"options"`
}

BaseService 基于依赖应用及端口结构

type BatchBuildPlugins

type BatchBuildPlugins struct {
	Plugins []*BuildPluginReq `json:"plugins"`
}

BatchBuildPlugins -

type BatchCreatePlugins

type BatchCreatePlugins struct {
	Plugins []*Plugin `json:"plugins"`
}

BatchCreatePlugins -

type BatchOpRequesters

type BatchOpRequesters []ComponentOpReq

BatchOpRequesters -

func (BatchOpRequesters) ComponentIDs

func (b BatchOpRequesters) ComponentIDs() []string

ComponentIDs returns a list of components ids.

type BatchOpResult

type BatchOpResult []*ComponentOpResult

BatchOpResult -

type BatchOpResultItemStatus

type BatchOpResultItemStatus string

BatchOpResultItemStatus is the status of ComponentOpResult.

var (
	BatchOpResultItemStatusFailure BatchOpResultItemStatus = "failure"
	BatchOpResultItemStatusSuccess BatchOpResultItemStatus = "success"
)

BatchOpResultItemStatus -

type BatchOperationReq

type BatchOperationReq struct {
	Operator      string `json:"operator"`
	TenantEnvName string `json:"tenant_env_name"`
	Body          struct {
		Operation string                 `json:"operation" validate:"operation|required|in:start,stop,build,upgrade"`
		Builds    []*ComponentBuildReq   `json:"build_infos,omitempty"`
		Starts    []*ComponentStartReq   `json:"start_infos,omitempty"`
		Stops     []*ComponentStopReq    `json:"stop_infos,omitempty"`
		Upgrades  []*ComponentUpgradeReq `json:"upgrade_infos,omitempty"`
	}
}

BatchOperationReq beatch operation request body

type BindServiceRequest

type BindServiceRequest struct {
	ServiceIDs []string `json:"service_ids"`
}

BindServiceRequest -

type Body

type Body struct {
	ProxyConnectTimeout int          `json:"proxy_connect_timeout,omitempty" validate:"proxy_connect_timeout|required"`
	ProxySendTimeout    int          `json:"proxy_send_timeout,omitempty" validate:"proxy_send_timeout|required"`
	ProxyReadTimeout    int          `json:"proxy_read_timeout,omitempty" validate:"proxy_read_timeout|required"`
	ProxyBodySize       int          `json:"proxy_body_size,omitempty" validate:"proxy_body_size|required"`
	SetHeaders          []*SetHeader `json:"set_headers,omitempty" `
	Rewrites            []*Rewrite   `json:"rewrite,omitempty"`
	ProxyBufferSize     int          `json:"proxy_buffer_size,omitempty" validate:"proxy_buffer_size|numeric_between:1,65535"`
	ProxyBufferNumbers  int          `json:"proxy_buffer_numbers,omitempty" validate:"proxy_buffer_size|numeric_between:1,65535"`
	ProxyBuffering      string       `json:"proxy_buffering,omitempty" validate:"proxy_buffering|required"`
	AccessLog           bool         `json:"access_log,omitempty" validate:"access_log|required"`
}

Body is a embedded sturct of RuleConfigReq.

type BuildCodeInfo

type BuildCodeInfo struct {
	// git地址
	// in: body
	// required: false
	RepoURL string `json:"repo_url" validate:"repo_url"`
	// branch 分支信息
	// in: body
	// required: false
	Branch string `json:"branch" validate:"branch"`
	// 操作人员
	// in: body
	// required: false
	Lang string `json:"lang" validate:"lang"`
	// 代码服务器类型
	// in: body
	// required: false
	ServerType string `json:"server_type" validate:"server_type"`
	Runtime    string `json:"runtime"`
	User       string `json:"user" validate:"user"`
	Password   string `json:"password" validate:"password"`
	//for .netcore source type, need cmd
	Cmd string `json:"cmd"`
}

BuildCodeInfo -

type BuildImageInfo

type BuildImageInfo struct {
	// 镜像地址
	// in: body
	// required: false
	ImageURL string `json:"image_url" validate:"image_url"`
	User     string `json:"user" validate:"user"`
	Password string `json:"password" validate:"password"`
	Cmd      string `json:"cmd"`
}

BuildImageInfo -

type BuildListRespVO

type BuildListRespVO struct {
	DeployVersion string      `json:"deploy_version"`
	List          interface{} `json:"list"`
}

BuildListRespVO is the response value object for build-list api.

type BuildPluginReq

type BuildPluginReq struct {
	PluginID      string `json:"plugin_id" validate:"plugin_id"`
	EventID       string `json:"event_id" validate:"event_id"`
	PluginCPU     int    `json:"plugin_cpu" validate:"plugin_cpu|required"`
	PluginMemory  int    `json:"plugin_memory" validate:"plugin_memory|required"`
	PluginCMD     string `json:"plugin_cmd" validate:"plugin_cmd"`
	BuildVersion  string `json:"build_version" validate:"build_version|required"`
	DeployVersion string `json:"deploy_version" validate:"deploy_version"`
	RepoURL       string `json:"repo_url" validate:"repo_url"`
	Username      string `json:"username"`
	Password      string `json:"password"`
	Info          string `json:"info" validate:"info"`
	Operator      string `json:"operator" validate:"operator"`
	TenantEnvID   string `json:"tenant_env_id" validate:"tenant_env_id"`
	BuildImage    string `json:"build_image" validate:"build_image"`
	ImageInfo     struct {
		HubURL      string `json:"hub_url"`
		HubUser     string `json:"hub_user"`
		HubPassword string `json:"hub_password"`
		Namespace   string `json:"namespace"`
		IsTrust     bool   `json:"is_trust,omitempty"`
	} `json:"ImageInfo" validate:"ImageInfo"`
}

BuildPluginReq -

func (BuildPluginReq) DbModel

DbModel return database model

type BuildPluginStruct

type BuildPluginStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	PluginID string `json:"plugin_id" validate:"plugin_id"`
	//in: body
	Body struct {
		// the event id
		// in: body
		// required: false
		EventID string `json:"event_id" validate:"event_id"`
		// 插件CPU权重, 默认125
		// in: body
		// required: true
		PluginCPU int `json:"plugin_cpu" validate:"plugin_cpu|required"`
		// 插件最大内存, 默认50
		// in: body
		// required: true
		PluginMemory int `json:"plugin_memory" validate:"plugin_memory|required"`
		// 插件cmd, 默认50
		// in: body
		// required: false
		PluginCMD string `json:"plugin_cmd" validate:"plugin_cmd"`
		// 插件的版本号
		// in: body
		// required: true
		BuildVersion string `json:"build_version" validate:"build_version|required"`
		// 插件构建版本号
		// in: body
		// required: true
		DeployVersion string `json:"deploy_version" validate:"deploy_version"`
		// git地址分支信息,默认为master
		// in: body
		// required: false
		RepoURL string `json:"repo_url" validate:"repo_url"`
		// git username
		// in: body
		// required: false
		Username string `json:"username"`
		// git password
		// in: body
		// required: false
		Password string `json:"password"`
		// 版本信息, 协助选择插件版本
		// in:body
		// required: true
		Info string `json:"info" validate:"info"`
		// 操作人
		// in: body
		// required: false
		Operator string `json:"operator" validate:"operator"`
		//租户id
		// in: body
		// required: true
		TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`
		// 镜像地址
		// in: body
		// required: false
		BuildImage string `json:"build_image" validate:"build_image"`
		//ImageInfo
		ImageInfo struct {
			HubURL      string `json:"hub_url"`
			HubUser     string `json:"hub_user"`
			HubPassword string `json:"hub_password"`
			Namespace   string `json:"namespace"`
			IsTrust     bool   `json:"is_trust,omitempty"`
		} `json:"ImageInfo" validate:"ImageInfo"`
	}
}

BuildPluginStruct BuildPluginStruct

type BuildServiceStruct

type BuildServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	//in: body
	Body struct {
		// the event id
		// in: body
		// required: false
		EventID string `json:"event_id" validate:"event_id"`
		// 变量
		// in: body
		// required: false
		ENVS map[string]string `json:"envs" validate:"envs"`
		// 应用构建类型
		// in: body
		// required: true
		Kind string `json:"kind" validate:"kind|required"`
		// 后续动作, 根据该值进行一键部署,如果不传值,则默认只进行构建
		// in: body
		// required: false
		Action string `json:"action" validate:"action"`
		// 镜像地址
		// in: body
		// required: false
		ImageURL string `json:"image_url" validate:"image_url"`
		// 部署的版本号
		// in: body
		// required: true
		DeployVersion string `json:"deploy_version" validate:"deploy_version|required"`
		// git地址
		// in: body
		// required: false
		RepoURL string `json:"repo_url" validate:"repo_url"`
		// branch 分支信息
		// in: body
		// required: false
		Branch string `json:"branch" validate:"branch"`
		// 操作人员
		// in: body
		// required: false
		Lang string `json:"lang" validate:"lang"`
		// 代码服务器类型
		// in: body
		// required: false
		ServerType    string `json:"server_type" validate:"server_type"`
		Runtime       string `json:"runtime" validate:"runtime"`
		ServiceType   string `json:"service_type" validate:"service_type"`
		User          string `json:"user" validate:"user"`
		Password      string `json:"password" validate:"password"`
		Operator      string `json:"operator" validate:"operator"`
		TenantEnvName string `json:"tenant_env_name"`
		ServiceAlias  string `json:"service_alias"`
		Cmd           string `json:"cmd"`
		//用于云市代码包创建
		SlugInfo struct {
			SlugPath    string `json:"slug_path"`
			FTPHost     string `json:"ftp_host"`
			FTPPort     string `json:"ftp_port"`
			FTPUser     string `json:"ftp_username"`
			FTPPassword string `json:"ftp_password"`
		} `json:"slug_info"`
	}
}

BuildServiceStruct BuildServiceStruct

type BuildSlugInfo

type BuildSlugInfo struct {
	SlugPath    string `json:"slug_path"`
	FTPHost     string `json:"ftp_host"`
	FTPPort     string `json:"ftp_port"`
	FTPUser     string `json:"ftp_username"`
	FTPPassword string `json:"ftp_password"`
}

BuildSlugInfo -

type BuildVersion

type BuildVersion struct {
	BuildVersion string `json:"build_version"` //唯一
	EventID      string `json:"event_id"`
	ServiceID    string `json:"service_id"`
	Kind         string `json:"kind"` //kind
	//DeliveredType app version delivered type
	//image: this is a docker image
	//slug: this is a source code tar file
	DeliveredType string `json:"delivered_type"` //kind
	DeliveredPath string `json:"delivered_path"` //交付物path
	Cmd           string `json:"cmd"`            //启动命令
	RepoURL       string `json:"repo_url"`       // source image name or source code url

	CodeBranch  string `json:"code_branch"`
	CodeVersion string `json:"code_version"`
	CommitMsg   string `json:"code_commit_msg"`
	Author      string `json:"code_commit_author"`

	ImageName   string `json:"image_name"` // runtime image name
	ImageRepo   string `json:"image_repo"`
	ImageDomain string `json:"image_domain"`
	ImageTag    string `json:"image_tag"`

	//FinalStatus app version status
	//success: version available
	//failure: build failure
	//lost: there is no delivered
	CreateTime  string    `json:"create_time"`
	FinalStatus string    `json:"final_status"`
	FinishTime  time.Time `json:"finish_time"`
	PlanVersion string    `json:"plan_version"`
}

BuildVersion -

type ByPodName

type ByPodName []*AppPod

ByPodName implements sort.Interface for []*AppPod based on the PodName field.

func (ByPodName) Len

func (a ByPodName) Len() int

func (ByPodName) Less

func (a ByPodName) Less(i, j int) bool

func (ByPodName) Swap

func (a ByPodName) Swap(i, j int)

type ByServiceName

type ByServiceName []*AppService

ByServiceName implements sort.Interface for []*AppService based on the ServiceName field.

func (ByServiceName) Len

func (a ByServiceName) Len() int

func (ByServiceName) Less

func (a ByServiceName) Less(i, j int) bool

func (ByServiceName) Swap

func (a ByServiceName) Swap(i, j int)

type CheckCodeStruct

type CheckCodeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: body
	Body struct {
		// git分支详情
		// in: body
		// required: true
		GitURL string `json:"git_url" validate:"git_url|required"`
		// git地址
		// in: body
		// required: true
		URLRepos string `json:"url_repos" validate:"url_repos|required"`
		// 检测类型, "first_check"
		// in: body
		// required: true
		CheckType string `json:"check_type" validate:"check_type|required"`
		// 代码分支
		// in: body
		// required: true
		CodeVersion string `json:"code_version" validate:"code_version|required"`
		// git project id, 0
		// in: body
		// required: true
		GitProjectID int `json:"git_project_id" validate:"git_project_id|required"`
		// git源, "gitlab_manual"
		// in: body
		// required: true
		CodeFrom string `json:"code_from" validate:"code_from|required"`
		// 租户id
		// in: body
		// required: false
		TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`
		Action      string `json:"action"`
		// 应用id
		// in: body
		// required: true
		ServiceID string `json:"service_id"`
	}
}

CheckCodeStruct CheckCodeStruct

type CheckResourceNameReq

type CheckResourceNameReq struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

CheckResourceNameReq -

type CheckResourceNameResp

type CheckResourceNameResp struct {
	Name string `json:"name"`
}

CheckResourceNameResp -

type Cluster added in v1.1.0

type Cluster struct {
	Server                   string `json:"server"`
	CertificateAuthorityData []byte `json:"certificate-authority-data"`
}

type ClusterEvent added in v1.1.0

type ClusterEvent struct {
	Level             ClusterEventLevel `json:"level"`
	Message           string            `json:"message"`
	CreatedAt         string            `json:"created_at"`
	CreationTimestamp time.Time         `json:"created_at_time_stamps"`
}

ClusterEvent

func ClusterEventFrom added in v1.1.0

func ClusterEventFrom(event *corev1.Event, clientset kubernetes.Interface) *ClusterEvent

type ClusterEventLevel added in v1.1.0

type ClusterEventLevel string
const (
	ClusterEventLevelNormal  ClusterEventLevel = "Normal"
	ClusterEventLevelGeneral ClusterEventLevel = "General"
	ClusterEventLevelWarning ClusterEventLevel = "Warning"
	ClusterEventLevelFatal   ClusterEventLevel = "Urgent"
)

func (ClusterEventLevel) String added in v1.1.0

func (l ClusterEventLevel) String() string

type ClusterItem added in v1.1.0

type ClusterItem struct {
	Name    string   `json:"name"`
	Cluster *Cluster `json:"cluster"`
}

type ClusterList added in v1.1.0

type ClusterList []*ClusterItem

type ClusterResource

type ClusterResource struct {
	AllNode              int             `json:"all_node"`
	NotReadyNode         int             `json:"notready_node"`
	ComputeNode          int             `json:"compute_node"`
	CapCPU               float32         `json:"cap_cpu"`
	CapMem               float32         `json:"cap_mem"`
	ReqCPU               float32         `json:"req_cpu"`
	ReqMem               float32         `json:"req_mem"`
	WutongReqMem         float32         `json:"wt_req_mem"` // Resources to embody wutong scheduling
	WutongReqCPU         float32         `json:"wt_req_cpu"`
	TotalCapacityPods    int64           `json:"total_capacity_pods"`
	TotalUsedPods        int64           `json:"total_used_pods"`
	TotalCapacityStorage float32         `json:"total_capacity_storage"`
	TotalUsedStorage     float32         `json:"total_used_storage"`
	NodeResources        []*NodeResource `json:"node_resources"`
	TenantEnvPods        map[string]int  `json:"tenant_env_pods"`
}

ClusterResource -

type CommandResponse

type CommandResponse struct {
	// in: body
	Body struct {
		//参数验证错误信息
		ValidationError url.Values `json:"validation_error,omitempty"`
		//API错误信息
		Msg string `json:"msg,omitempty"`
		//单资源实体
		Bean interface{} `json:"bean,omitempty"`
		//资源列表
		List interface{} `json:"list,omitempty"`
		//数据集总数
		ListAllNumber int `json:"number,omitempty"`
		//当前页码数
		Page int `json:"page,omitempty"`
	}
}

CommandResponse api统一返回结构 swagger:response commandResponse

type Component

type Component struct {
	ComponentBase      ComponentBase                    `json:"component_base"`
	HTTPRules          []AddHTTPRuleStruct              `json:"http_rules"`
	TCPRules           []AddTCPRuleStruct               `json:"tcp_rules"`
	HTTPRuleConfigs    []HTTPRuleConfig                 `json:"http_rule_configs"`
	Monitors           []AddServiceMonitorRequestStruct `json:"monitors"`
	Ports              []TenantEnvServicesPort          `json:"ports"`
	Relations          []TenantEnvComponentRelation     `json:"relations"`
	Envs               []ComponentEnv                   `json:"envs"`
	Probes             []ServiceProbe                   `json:"probes"`
	AppConfigGroupRels []AppConfigGroupRelations        `json:"app_config_groups"`
	Labels             []ComponentLabel                 `json:"labels"`
	Plugins            []ComponentPlugin                `json:"plugins"`
	AutoScaleRule      AutoScalerRule                   `json:"auto_scale_rule"`
	ConfigFiles        []ComponentConfigFile            `json:"config_files"`
	VolumeRelations    []VolumeRelation                 `json:"volume_relations"`
	Volumes            []ComponentVolume                `json:"volumes"`
	Endpoint           *Endpoints                       `json:"endpoint"`
}

Component All attributes related to the component

type ComponentBase

type ComponentBase struct {
	// in: body
	// required: true
	ComponentID string `json:"component_id" validate:"required"`
	// 服务名称,用于有状态服务DNS
	// in: body
	// required: false
	ComponentName string `json:"component_name" validate:"component_name"`
	// 服务别名
	// in: body
	// required: true
	ComponentAlias string `json:"component_alias" validate:"required"`
	// 服务描述
	// in: body
	// required: false
	Comment string `json:"comment" validate:"comment"`
	// 镜像名称
	// in: body
	// required: false
	ImageName string `json:"image_name" validate:"image_name"`
	// 容器最小CPU
	// in: body
	// required: false
	ContainerRequestCPU int `json:"container_request_cpu" validate:"container_request_cpu"`
	// 容器CPU权重
	// in: body
	// required: false
	ContainerCPU int `json:"container_cpu" validate:"container_cpu"`
	// 容器最小内存
	// in: body
	// required: false
	ContainerRequestMemory int `json:"container_request_memory" validate:"container_request_memory"`
	// 容器最大内存
	// in: body
	// required: false
	ContainerMemory int `json:"container_memory" validate:"container_memory"`
	// GPU 类型
	// in: body
	// required: false
	ContainerGPUType string `json:"container_gpu_type" validate:"container_gpu_type"`
	// 容器GPU
	// in: body
	// required: false
	ContainerGPU int `json:"container_gpu" validate:"container_gpu"`
	// 扩容方式;0:无状态;1:有状态;2:分区(v5.2用于接收组件的类型)
	// in: body
	// required: false
	ExtendMethod string `json:"extend_method" validate:"extend_method"`
	// 节点数
	// in: body
	// required: false
	Replicas int `json:"replicas" validate:"replicas"`
	// 部署版本
	// in: body
	// required: false
	DeployVersion string `json:"deploy_version" validate:"deploy_version"`
	// 服务分类:application,cache,store
	// in: body
	// required: false
	Category string `json:"category" validate:"category"`
	// 最新操作ID
	// in: body
	// required: false
	EventID string `json:"event_id" validate:"event_id"`
	// 镜像来源
	// in: body
	// required: false
	Namespace string `json:"namespace" validate:"namespace"`
	// 服务创建类型cloud云市服务,assistant云帮服务
	// in: body
	// required: false
	ServiceOrigin    string `json:"service_origin" validate:"service_origin"`
	Kind             string `json:"kind" validate:"kind|in:internal,third_party"`
	K8sComponentName string `json:"k8s_component_name" validate:"k8s_component_name"`
}

ComponentBase -

func (*ComponentBase) DbModel

func (c *ComponentBase) DbModel(tenantEnvID, appID, deployVersion string) *dbmodel.TenantEnvServices

DbModel return database model

type ComponentBuildReq

type ComponentBuildReq struct {
	ComponentOpGeneralReq
	// 变量
	// in: body
	// required: false
	BuildENVs map[string]string `json:"envs" validate:"envs"`
	// 应用构建类型
	// in: body
	// required: true
	Kind string `json:"kind" validate:"kind|required"`
	// 后续动作, 根据该值进行一键部署,如果不传值,则默认只进行构建
	// in: body
	// required: false
	Action string `json:"action" validate:"action"`
	// Plan Version
	PlanVersion string `json:"plan_version"`
	// Deployed version number, The version is generated by the API
	// in: body
	DeployVersion string `json:"deploy_version" validate:"deploy_version"`
	// Build task initiator
	//in: body
	Operator string `json:"operator" validate:"operator"`
	//build form image
	ImageInfo BuildImageInfo `json:"image_info,omitempty"`
	//build from code
	CodeInfo BuildCodeInfo `json:"code_info,omitempty"`
	//用于云市代码包创建
	SlugInfo BuildSlugInfo `json:"slug_info,omitempty"`
	//tenantEnvName
	TenantEnvName string `json:"-"`
}

ComponentBuildReq -

func (*ComponentBuildReq) BatchOpFailureItem

func (b *ComponentBuildReq) BatchOpFailureItem() *ComponentOpResult

BatchOpFailureItem -

func (*ComponentBuildReq) GetComponentID

func (b *ComponentBuildReq) GetComponentID() string

GetComponentID -

func (*ComponentBuildReq) GetEventID

func (b *ComponentBuildReq) GetEventID() string

GetEventID -

func (*ComponentBuildReq) GetVersion

func (b *ComponentBuildReq) GetVersion() string

GetVersion -

func (*ComponentBuildReq) OpType

func (b *ComponentBuildReq) OpType() string

OpType -

func (*ComponentBuildReq) SetVersion

func (b *ComponentBuildReq) SetVersion(string)

SetVersion -

func (*ComponentBuildReq) TaskBody

func (b *ComponentBuildReq) TaskBody(cpt *dbmodel.TenantEnvServices) interface{}

TaskBody returns a task body.

type ComponentConfigFile

type ComponentConfigFile struct {
	VolumeName  string `json:"volume_name"`
	FileContent string `json:"file_content"`
}

ComponentConfigFile -

func (*ComponentConfigFile) DbModel

DbModel return database model

type ComponentEnv

type ComponentEnv struct {
	ContainerPort int    `validate:"container_port|numeric_between:1,65535" json:"container_port"`
	Name          string `validate:"name" json:"name"`
	AttrName      string `validate:"attr_name|required" json:"attr_name"`
	AttrValue     string `validate:"attr_value" json:"attr_value"`
	IsChange      bool   `validate:"is_change|bool" json:"is_change"`
	Scope         string `validate:"scope|in:outer,inner,both,build" json:"scope"`
}

ComponentEnv -

func (*ComponentEnv) DbModel

func (e *ComponentEnv) DbModel(tenantEnvID, componentID string) *dbmodel.TenantEnvServiceEnvVar

DbModel return database model

type ComponentLabel

type ComponentLabel struct {
	LabelKey   string `json:"label_key"`
	LabelValue string `json:"label_value"`
}

ComponentLabel -

func (*ComponentLabel) DbModel

func (l *ComponentLabel) DbModel(componentID string) *dbmodel.TenantEnvServiceLabel

DbModel return database model

type ComponentOpGeneralReq

type ComponentOpGeneralReq struct {
	EventID   string            `json:"event_id"`
	ServiceID string            `json:"service_id"`
	Configs   map[string]string `json:"configs"`
	// When determining the startup sequence of services, you need to know the services they depend on
	DepServiceIDInBootSeq []string `json:"dep_service_ids_in_boot_seq"`
}

ComponentOpGeneralReq -

func (*ComponentOpGeneralReq) UpdateConfig

func (b *ComponentOpGeneralReq) UpdateConfig(key, value string)

UpdateConfig -

type ComponentOpReq

type ComponentOpReq interface {
	GetComponentID() string
	GetEventID() string
	TaskBody(component *dbmodel.TenantEnvServices) interface{}
	BatchOpFailureItem() *ComponentOpResult
	UpdateConfig(key, value string)
	OpType() string
	SetVersion(version string)
	GetVersion() string
}

ComponentOpReq -

type ComponentOpResult

type ComponentOpResult struct {
	ServiceID     string                  `json:"service_id"`
	Operation     string                  `json:"operation"`
	EventID       string                  `json:"event_id"`
	Status        BatchOpResultItemStatus `json:"status"`
	ErrMsg        string                  `json:"err_message"`
	DeployVersion string                  `json:"deploy_version"`
}

ComponentOpResult -

func (*ComponentOpResult) Success

func (b *ComponentOpResult) Success()

Success sets the status to success.

type ComponentPlugin

type ComponentPlugin struct {
	PluginID        string     `json:"plugin_id"`
	VersionID       string     `json:"version_id"`
	PluginModel     string     `json:"plugin_model"`
	ContainerCPU    int        `json:"container_cpu"`
	ContainerMemory int        `json:"container_memory"`
	Switch          bool       `json:"switch"`
	ConfigEnvs      ConfigEnvs `json:"config_envs" validate:"config_envs"`
}

ComponentPlugin -

func (*ComponentPlugin) DbModel

DbModel return database model

type ComponentStartReq

type ComponentStartReq struct {
	ComponentOpGeneralReq
}

ComponentStartReq -

func (*ComponentStartReq) BatchOpFailureItem

func (s *ComponentStartReq) BatchOpFailureItem() *ComponentOpResult

BatchOpFailureItem -

func (*ComponentStartReq) GetComponentID

func (s *ComponentStartReq) GetComponentID() string

GetComponentID -

func (*ComponentStartReq) GetEventID

func (s *ComponentStartReq) GetEventID() string

GetEventID -

func (*ComponentStartReq) GetVersion

func (s *ComponentStartReq) GetVersion() string

GetVersion -

func (*ComponentStartReq) OpType

func (s *ComponentStartReq) OpType() string

OpType -

func (*ComponentStartReq) SetVersion

func (s *ComponentStartReq) SetVersion(string)

SetVersion -

func (*ComponentStartReq) TaskBody

func (s *ComponentStartReq) TaskBody(cpt *dbmodel.TenantEnvServices) interface{}

TaskBody -

type ComponentStopReq

type ComponentStopReq struct {
	ComponentStartReq
}

ComponentStopReq -

func (*ComponentStopReq) BatchOpFailureItem

func (s *ComponentStopReq) BatchOpFailureItem() *ComponentOpResult

BatchOpFailureItem -

func (*ComponentStopReq) OpType

func (s *ComponentStopReq) OpType() string

OpType -

type ComponentUpgradeReq

type ComponentUpgradeReq struct {
	ComponentOpGeneralReq
	//UpgradeVersion The target version of the upgrade
	//If empty, the same version is upgraded
	UpgradeVersion string `json:"upgrade_version"`
}

ComponentUpgradeReq -

func (*ComponentUpgradeReq) BatchOpFailureItem

func (u *ComponentUpgradeReq) BatchOpFailureItem() *ComponentOpResult

BatchOpFailureItem -

func (*ComponentUpgradeReq) GetComponentID

func (u *ComponentUpgradeReq) GetComponentID() string

GetComponentID -

func (*ComponentUpgradeReq) GetEventID

func (u *ComponentUpgradeReq) GetEventID() string

GetEventID -

func (*ComponentUpgradeReq) GetVersion

func (u *ComponentUpgradeReq) GetVersion() string

GetVersion -

func (*ComponentUpgradeReq) OpType

func (u *ComponentUpgradeReq) OpType() string

OpType -

func (*ComponentUpgradeReq) SetVersion

func (u *ComponentUpgradeReq) SetVersion(version string)

SetVersion -

func (*ComponentUpgradeReq) TaskBody

func (u *ComponentUpgradeReq) TaskBody(cpt *dbmodel.TenantEnvServices) interface{}

TaskBody returns the task body.

type ComponentVolume

type ComponentVolume struct {
	Category           string `json:"category"`
	VolumeType         string `json:"volume_type"`
	VolumeName         string `json:"volume_name"`
	HostPath           string `json:"host_path"`
	VolumePath         string `json:"volume_path"`
	IsReadOnly         bool   `json:"is_read_only"`
	VolumeCapacity     int64  `json:"volume_capacity"`
	AccessMode         string `json:"access_mode"`
	SharePolicy        string `json:"share_policy"`
	BackupPolicy       string `json:"backup_policy"`
	ReclaimPolicy      string `json:"reclaim_policy"`
	AllowExpansion     bool   `json:"allow_expansion"`
	VolumeProviderName string `json:"volume_provider_name"`
	Mode               *int32 `json:"mode"`
}

ComponentVolume -

func (*ComponentVolume) DbModel

func (v *ComponentVolume) DbModel(componentID string) *dbmodel.TenantEnvServiceVolume

DbModel return database model

func (*ComponentVolume) Key

func (v *ComponentVolume) Key(componentID string) string

Key returns the key of ComponentVolume.

type ComposerStruct

type ComposerStruct struct {
	// in : body
	Body struct {
		Lang string `json:"default_runtime" validate:"default_runtime"`
		Data struct {
			JSON struct {
				PlatForm struct {
					PHP string `json:"php" validate:"php"`
				}
			}
			Packages []string `json:"packages" validate:"packages"`
			Lock     struct {
				PlatForm struct {
					PHP string `json:"php" validate:"php"`
				}
			}
		}
	}
}

ComposerStruct ComposerStruct swagger:parameters resolve

type Config added in v1.1.0

type Config struct {
	APIVersion     string       `json:"apiVersion"`
	Kind           string       `json:"kind"`
	CurrentContext string       `json:"current-context"`
	Contexts       ContextList  `json:"contexts"`
	Clusters       ClusterList  `json:"clusters"`
	AuthInfos      AuthInfoList `json:"users"`
}

type ConfigEnvs

type ConfigEnvs struct {
	NormalEnvs  []*VersionEnv `json:"normal_envs" validate:"normal_envs"`
	ComplexEnvs *ResourceSpec `json:"complex_envs" validate:"complex_envs"`
}

ConfigEnvs Config

type ConfigGroupService

type ConfigGroupService struct {
	ServiceID    string `json:"service_id"`
	ServiceAlias string `json:"service_alias"`
}

ConfigGroupService -

func (ConfigGroupService) DbModel

func (c ConfigGroupService) DbModel(appID, configGroupName string) *dbmodel.ConfigGroupService

DbModel return database model

type ConfigItem

type ConfigItem struct {
	AppID           string `json:"-"`
	ConfigGroupName string `json:"-"`
	ItemKey         string `json:"item_key" validate:"required,max=255"`
	ItemValue       string `json:"item_value" validate:"required,max=65535"`
}

ConfigItem -

func (ConfigItem) DbModel

func (c ConfigItem) DbModel(appID, configGroupName string) *dbmodel.ConfigGroupItem

DbModel return database model

type Context added in v1.1.0

type Context struct {
	Cluster   string `json:"cluster"`
	AuthInfo  string `json:"user"`
	Namespace string `json:"namespace"`
}

type ContextItem added in v1.1.0

type ContextItem struct {
	Name    string   `json:"name"`
	Context *Context `json:"context"`
}

type ContextList added in v1.1.0

type ContextList []*ContextItem

type CordonNodeRequest added in v1.10.0

type CordonNodeRequest struct {
	EvictPods bool `json:"evict_pods"`
}

type CreateAppRequest

type CreateAppRequest struct {
	AppsInfo []Application `json:"apps_info"`
}

CreateAppRequest -

type CreateAppResponse

type CreateAppResponse struct {
	AppID       int64  `json:"app_id"`
	RegionAppID string `json:"region_app_id"`
}

CreateAppResponse -

type CreateBackupRequest added in v1.7.0

type CreateBackupRequest struct {
	Desc     string `json:"desc"`
	TTL      string `json:"ttl"`
	Operator string `json:"operator"`
}

CreateBackupRequest

type CreateBackupScheduleRequest added in v1.6.0

type CreateBackupScheduleRequest struct {
	Desc     string `json:"desc"`
	Cron     string `json:"cron"`
	TTL      string `json:"ttl"`
	Operator string `json:"operator"`
}

CreateBackupScheduleRequest

type CreatePluginStruct

type CreatePluginStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: body
	Body struct {
		//插件id
		//in: body
		//required: true
		PluginID string `json:"plugin_id" validate:"plugin_id|required"`
		//in: body
		//required: true
		PluginName string `json:"plugin_name" validate:"plugin_name|required"`
		//插件用途描述
		//in: body
		//required: false
		PluginInfo string `json:"plugin_info" validate:"plugin_info"`
		// 插件docker地址
		// in:body
		// required: false
		ImageURL string `json:"image_url" validate:"image_url"`
		//git地址
		//in: body
		//required: false
		GitURL string `json:"git_url" validate:"git_url"`
		//构建模式
		//in: body
		//required: false
		BuildModel string `json:"build_model" validate:"build_model"`
		//插件模式
		//in: body
		//required: false
		PluginModel string `json:"plugin_model" validate:"plugin_model"`
		//租户id
		//in: body
		//required: false
		TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`

		//插件类型
		PluginType string `json:"origin" validate:"origin"`
	}
}

CreatePluginStruct CreatePluginStruct

type CreateRestoreRequest added in v1.6.0

type CreateRestoreRequest struct {
	BackupID string `json:"backup_id"`
	Operator string `json:"operator"`
}

CreateRestoreRequest

type CreateServiceStruct

type CreateServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `gorm:"column:tenant_env_name;size:32" json:"tenant_env_name" validate:"tenant_env_name"`
	// in:body
	Body struct {
		// 租户id
		// in: body
		// required: false
		TenantEnvID string `gorm:"column:tenant_env_id;size:32" json:"tenant_env_id" validate:"tenant_env_id"`
		// 应用id
		// in: body
		// required: false
		ServiceID string `gorm:"column:service_id;size:32" json:"service_id" validate:"service_id"`
		// 操作人
		// in: body
		// required: false
		Operator string `json:"operator" validate:"operator"`
		// 应用标签,value
		// in: body
		// required: false
		ServiceLabel string `json:"service_label" validate:"service_label"`
		// 节点标签,格式: v1,v2
		// in: body
		// required: false
		NodeLabel string `json:"node_label" validate:"node_label"`
		// 依赖id, 格式: []struct TenantEnvServiceRelation
		// in: body
		// required: false
		DependIDs []dbmodel.TenantEnvServiceRelation `json:"depend_ids" validate:"depend_ids"`
		// 持久化目录信息, 格式: []struct TenantEnvServiceVolume
		// in: body
		// required: false
		VolumesInfo []dbmodel.TenantEnvServiceVolume `json:"volumes_info" validate:"volumes_info"`
		// 环境变量信息, 格式: []struct TenantEnvServiceEnvVar
		// in: body
		// required: false
		EnvsInfo []dbmodel.TenantEnvServiceEnvVar `json:"envs_info" validate:"envs_info"`
		// 端口信息, 格式: []struct TenantEnvServicesPort
		// in: body
		// required: false
		PortsInfo []dbmodel.TenantEnvServicesPort `json:"ports_info" validate:"ports_info"`
		// 服务key
		// in: body
		// required: false
		ServiceKey string `gorm:"column:service_key;size:32" json:"service_key" validate:"service_key"`
		// 服务别名
		// in: body
		// required: true
		ServiceAlias string `gorm:"column:service_alias;size:30" json:"service_alias" validate:"service_alias"`
		// 服务描述
		// in: body
		// required: false
		Comment string `gorm:"column:comment" json:"comment" validate:"comment"`
		// 服务版本
		// in: body
		// required: false
		ServiceVersion string `gorm:"column:service_version;size:32" json:"service_version" validate:"service_version"`
		// 镜像名称
		// in: body
		// required: false
		ImageName string `gorm:"column:image_name;size:100" json:"image_name" validate:"image_name"`
		// 容器CPU申请
		// in: body
		// required: false
		ContainerRequestCPU int `gorm:"column:container_request_cpu" json:"container_request_cpu" validate:"container_request_cpu"`
		// 容器CPU权重
		// in: body
		// required: false
		ContainerCPU int `gorm:"column:container_cpu;default:2000" json:"container_cpu" validate:"container_cpu"`
		// 容器内存申请
		// in: body
		// required: false
		ContainerRequestMemory int `gorm:"column:container_request_memory" json:"container_request_memory" validate:"container_request_memory"`
		// 容器最大内存
		// in: body
		// required: false
		ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory" validate:"container_memory"`
		// 容器启动命令
		// in: body
		// required: false
		ContainerCMD string `gorm:"column:container_cmd;size:2048" json:"container_cmd" validate:"container_cmd"`
		// 容器环境变量
		// in: body
		// required: false
		ContainerEnv string `gorm:"column:container_env;size:255" json:"container_env" validate:"container_env"`
		// 卷名字
		// in: body
		// required: false
		VolumePath string `gorm:"column:volume_path" json:"volume_path" validate:"volume_path"`
		// 容器挂载目录
		// in: body
		// required: false
		VolumeMountPath string `gorm:"column:volume_mount_path" json:"volume_mount_path" validate:"volume_mount_path"`
		// 宿主机目录
		// in: body
		// required: false
		HostPath string `gorm:"column:host_path" json:"host_path" validate:"host_path"`
		// 扩容方式;0:无状态;1:有状态;2:分区
		// in: body
		// required: false
		ExtendMethod string `gorm:"column:extend_method;default:stateless;" json:"extend_method" validate:"extend_method"`
		// 节点数
		// in: body
		// required: false
		Replicas int `gorm:"column:replicas;default:1" json:"replicas" validate:"replicas"`
		// 部署版本
		// in: body
		// required: false
		DeployVersion string `gorm:"column:deploy_version" json:"deploy_version" validate:"deploy_version"`
		// 服务分类:application,cache,store
		// in: body
		// required: false
		Category string `gorm:"column:category" json:"category" validate:"category"`
		// 最新操作ID
		// in: body
		// required: false
		EventID string `gorm:"column:event_id" json:"event_id" validate:"event_id"`
		// 服务类型
		// in: body
		// required: false
		ServiceType string `gorm:"column:service_type" json:"service_type" validate:"service_type"`
		// 镜像来源
		// in: body
		// required: false
		Namespace string `gorm:"column:namespace" json:"namespace" validate:"namespace"`
		// 共享类型shared、exclusive
		// in: body
		// required: false
		VolumeType string `gorm:"column:volume_type;default:shared" json:"volume_type" validate:"volume_type"`
		// 端口类型,one_outer;dif_protocol;multi_outer
		// in: body
		// required: false
		PortType string `gorm:"column:port_type;default:multi_outer" json:"port_type" validate:"port_type"`
		// 更新时间
		// in: body
		// required: false
		UpdateTime time.Time `gorm:"column:update_time" json:"update_time" validate:"update_time"`
		// 服务创建类型cloud云市服务,assistant云帮服务
		// in: body
		// required: false
		ServiceOrigin string `gorm:"column:service_origin;default:assistant" json:"service_origin" validate:"service_origin"`
		// 代码来源:gitlab,github
		// in: body
		// required: false
		CodeFrom string `gorm:"column:code_from" json:"code_from" validate:"code_from"`
	}
}

CreateServiceStruct serviceCreate struct swagger:parameters createService

type CreateVMPortGatewayRequest added in v1.7.0

type CreateVMPortGatewayRequest struct {
	VMPort        int            `json:"vmPort" validate:"vmPort|required"`
	Protocol      VMPortProtocol `json:"protocol" validate:"protocol|required"`
	VMPortGateway `json:",inline"`
}

type CreateVMRequest added in v1.7.0

type CreateVMRequest struct {
	Name          string       `json:"name" validate:"name|required"`
	DisplayName   string       `json:"displayName" validate:"displayName|required"`
	Desc          string       `json:"desc"`
	OSName        string       `json:"osName"`
	OSVersion     string       `json:"osVersion"`
	OSSourceFrom  OSSourceFrom `json:"osSourceFrom" validate:"osSourceFrom|required"`
	OSSourceURL   string       `json:"osSourceURL" validate:"osSourceURL|required"`
	OSDiskSize    int64        `json:"osDiskSize" validate:"osDiskSize|required"`
	RequestCPU    int64        `json:"requestCPU" validate:"requestCPU|required"`       // m
	RequestMemory int64        `json:"requestMemory" validate:"requestMemory|required"` // GiB
	Running       bool         `json:"running"`
	// Size        VMSize            `json:"size"`
	// HostNodeName string `json:"hostNodeName"`
	User     string `json:"user"`
	Password string `json:"password"`
	// Labels   map[string]string `json:"labels"`
	Operator           string   `json:"operator"`
	NodeSelectorLabels []string `json:"nodeSelectorLabels"`
}

CreateVMRequest

type CreateVMResponse added in v1.7.0

type CreateVMResponse struct {
	VMProfile
}

CreateVMResponse

type DataLog

type DataLog struct {
	Status string
	Data   eventdb.MessageDataList
}

DataLog 获取指定操作的操作日志

type DelEndpiontsReq

type DelEndpiontsReq struct {
	EpID string `json:"ep_id" validate:"required|len:32"`
}

DelEndpiontsReq is one of the Endpoints in the request to update the endpints.

type DelRuleConfigReq

type DelRuleConfigReq struct {
	ConfigID string `json:"config_id" validate:"config_id|required"`
}

DelRuleConfigReq -

type DelTenantEnvServiceEnvVar added in v1.1.0

type DelTenantEnvServiceEnvVar struct {
	Model
	TenantEnvID   string `validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID     string `validate:"service_id|between:30,33" json:"service_id"`
	ContainerPort int    `validate:"container_port|numeric_between:1,65535" json:"container_port"`
	Name          string `validate:"name" json:"name"`
	AttrName      string `validate:"env_name|required" json:"env_name"`
	AttrValue     string `validate:"env_value" json:"env_value"`
	IsChange      bool   `validate:"is_change|bool" json:"is_change"`
	Scope         string `validate:"scope|in:outer,inner,both,build" json:"scope"`
}

DelTenantEnvServiceEnvVar 应用环境变量

type DeleteDefineSourcesStruct

type DeleteDefineSourcesStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	SourceAlias string `json:"source_alias" validate:"source_alias"`
	// in: path
	// required: true
	EnvName string `json:"env_name" validate:"env_name"`
}

DeleteDefineSourcesStruct DeleteDefineSourcesStruct

type DeleteENVstruct

type DeleteENVstruct struct {
	// 租户名称
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name|required"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id" validate:"plugin_id|required"`
	// 构建版本
	// in: path
	// required; true
	VersionID string `json:"version_id" validate:"version_id|required"`
	//配置项名称
	//in: path
	//required: true
	ENVName string `json:"env_name" validate:"env_name|required"`
}

DeleteENVstruct DeleteENVstruct

type DeleteHTTPRuleStruct

type DeleteHTTPRuleStruct struct {
	HTTPRuleID string `json:"http_rule_id" validate:"http_rule_id|required"`
}

DeleteHTTPRuleStruct contains the id of http rule that will be deleted

type DeleteNodeAnnotationRequest added in v1.10.0

type DeleteNodeAnnotationRequest struct {
	Key string `json:"annotation_key" validate:"required"`
}

type DeleteNodeLabelRequest added in v1.10.0

type DeleteNodeLabelRequest struct {
	Key string `json:"label_key" validate:"required"`
}

type DeletePluginSetStruct

type DeletePluginSetStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name"`
	//in: path
	//required: true
	ServiceAlias string `json:"service_alias"`
	//插件id
	//in: path
	//required: true
	PluginID string `json:"plugin_id"`
}

DeletePluginSetStruct DeletePluginSetStruct

type DeletePluginStruct

type DeletePluginStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name|required"`
	// in: path
	// required: true
	PluginID string `json:"plugin_id" validate:"plugin_id|required"`
}

DeletePluginStruct deletePluginStruct

type DeleteProbeStruct

type DeleteProbeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 探针id
		// in: body
		// required: true
		ProbeID string `json:"probe_id"`
	}
}

DeleteProbeStruct DeleteProbeStruct

type DeleteRegistryAuthSecretStruct added in v1.1.0

type DeleteRegistryAuthSecretStruct struct {
	TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id|required"`
	SecretID    string `json:"secret_id" validate:"secret_id|required"`
}

DeleteRegistryAuthSecretStruct is used to delete registry auth secret

type DeleteServicePort

type DeleteServicePort struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// 容器端口
	// in: path
	// required: true
	Port int `json:"port"`
}

DeleteServicePort service port swagger:parameters deletePort

type DeleteServiceSchedulingLabelRequest added in v1.10.0

type DeleteServiceSchedulingLabelRequest struct {
	Key string `json:"label_key"`
}

type DeleteServiceSchedulingTolerationRequest added in v1.10.0

type DeleteServiceSchedulingTolerationRequest struct {
	Key string `json:"taint_key"`
}

type DeleteTCPRuleStruct

type DeleteTCPRuleStruct struct {
	TCPRuleID string `json:"tcp_rule_id" validate:"tcp_rule_id|required"`
}

DeleteTCPRuleStruct is used to delete tcp rule and rule extensions

type DeleteTaintNodeRequest added in v1.10.0

type DeleteTaintNodeRequest struct {
	Key string `json:"taint_key" validate:"required"`
}

type DeleteVMPortRequest added in v1.7.0

type DeleteVMPortRequest struct {
	VMPort   int            `json:"vmPort" validate:"vmPort|required"`
	Protocol VMPortProtocol `json:"protocol" validate:"protocol|required"`
}

type DeleteVMSchedulingLabelRequest added in v1.10.0

type DeleteVMSchedulingLabelRequest struct {
	Key string `json:"label_key" validate:"required"`
}

type DeleteVolumeDependencyStruct

type DeleteVolumeDependencyStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 依赖的服务id
		// in: body
		// required: true
		DependServiceID string `json:"depend_service_id" validate:"depend_service_id|required|max:32"`
		// 依赖存储名称
		// in: body
		// required: true
		VolumeName string `json:"volume_name" validate:"volume_name|required|max:50"`
	}
}

DeleteVolumeDependencyStruct DeleteVolumeDependencyStruct

type DeleteVolumeStruct

type DeleteVolumeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// 存储名称
	// in: path
	// required: true
	VolumeName string `json:"volume_name"`
}

DeleteVolumeStruct DeleteVolumeStruct

type DependService

type DependService struct {
	TenantEnvID    string `json:"tenant_env_id"`
	ServiceID      string `json:"service_id"`
	DepServiceID   string `json:"dep_service_id"`
	DepServiceType string `json:"dep_service_type"`
	Action         string `json:"action"`
}

DependService struct for depend service

type DisableVMPortRequest added in v1.9.0

type DisableVMPortRequest struct {
	VMPort   int            `json:"vmPort" validate:"vmPort|required"`
	Protocol VMPortProtocol `json:"protocol" validate:"protocol|required"`
}

type ENVStruct

type ENVStruct struct {
	// 租户名称
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id" validate:"plugin_id"`
	// 构建版本
	// in: path
	// required; true
	VersionID string `json:"version_id" validate:"version_id"`
	//in : body
	Body struct {
		//in: body
		//required: true
		EVNInfo []*PluginDefaultENV
	}
}

ENVStruct ENVStruct

type EnableVMPortRequest added in v1.9.0

type EnableVMPortRequest struct {
	VMPort   int            `json:"vmPort" validate:"vmPort|required"`
	Protocol VMPortProtocol `json:"protocol" validate:"protocol|required"`
}

type EndpointKubernetes

type EndpointKubernetes struct {
	Namespace   string `json:"namespace"`
	ServiceName string `json:"serviceName"`
}

EndpointKubernetes -

type Endpoints

type Endpoints struct {
	Static     []string            `json:"static" validate:"static"`
	Kubernetes *EndpointKubernetes `json:"kubernetes" validate:"kubernetes"`
}

Endpoints holds third-party service endpoints or configuraion to get endpoints.

func (*Endpoints) DbModel

func (e *Endpoints) DbModel(componentID string) *dbmodel.ThirdPartySvcDiscoveryCfg

DbModel -

type EtcdCleanReq

type EtcdCleanReq struct {
	Keys []string `json:"etcd_keys"`
}

EtcdCleanReq etcd clean request struct

type ExportAppInfo added in v1.1.0

type ExportAppInfo struct {
	AppName    string `json:"app_name"`
	AppVersion string `json:"app_version"`
}

ExportAppInfo -

type ExportAppStruct

type ExportAppStruct struct {
	SourceDir string `json:"source_dir"`
	Body      struct {
		EventID       string `json:"event_id"`
		GroupKey      string `json:"group_key"` // TODO 考虑去掉
		Version       string `json:"version"`   // TODO 考虑去掉
		Format        string `json:"format"`    // only wutong-app/docker-compose/slug/helm_chart/yaml
		GroupMetadata string `json:"group_metadata"`
		WithImageData bool   `json:"with_image_data"`
	}
}

ExportAppStruct -

type GetNetDownStreamRuleStruct

type GetNetDownStreamRuleStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// in: path
	// required: true
	DestServiceAlias string `json:"dest_service_alias" validate:"dest_service_alias"`
	// in: path
	// required: true
	Port int `json:"port" validate:"port|numeric_between:1,65535"`
}

GetNetDownStreamRuleStruct GetNetDownStreamRuleStruct

type GetNodeResponse added in v1.10.0

type GetNodeResponse struct {
	NodeProfile `json:",inline"`
}

type GetPluginEnvStruct

type GetPluginEnvStruct struct {
	//租户名称
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id"`
	// 构建版本id
	// in: path
	// required: true
	VersionID string `json:"version_id"`
}

GetPluginEnvStruct GetPluginEnvStruct

type GetPluginSetStruct

type GetPluginSetStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name"`
	//in: path
	//required: true
	ServiceAlias string `json:"service_alias"`
}

GetPluginSetStruct GetPluginSetStruct

type GetPluginsStruct

type GetPluginsStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name"`
}

GetPluginsStruct GetPluginsStruct

type GetServiceCheckInfoStruct

type GetServiceCheckInfoStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	UUID string `json:"uuid"`
}

GetServiceCheckInfoStruct 获取应用检测信息

type GetServiceSchedulingDetailsResponse added in v1.10.0

type GetServiceSchedulingDetailsResponse struct {
	Current    SchedulingConfig     `json:"current"`
	Selections SchedulingSelections `json:"selections"`
}

type GetSingleServiceInfoStruct

type GetSingleServiceInfoStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
}

GetSingleServiceInfoStruct GetSingleServiceInfoStruct

type GetSupportProtocols

type GetSupportProtocols struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
}

GetSupportProtocols GetSupportProtocols swagger:parameters getSupportProtocols

type GetVMConditionsResponse added in v1.11.0

type GetVMConditionsResponse struct {
	Conditions []VMCondition `json:"conditions"`
}

type GetVMPortsResponse added in v1.7.0

type GetVMPortsResponse struct {
	Total int      `json:"total"`
	Ports []VMPort `json:"ports"`
}

type GetVMResponse added in v1.7.0

type GetVMResponse struct {
	VMProfile
}

GetVMResponse

type GetVersionEnvStruct

type GetVersionEnvStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id"`
}

GetVersionEnvStruct GetVersionEnvStruct

type HTTPRuleConfig

type HTTPRuleConfig struct {
	RuleID              string `json:"rule_id,omitempty" validate:"rule_id|required"`
	ProxyConnectTimeout int    `json:"proxy_connect_timeout,omitempty" validate:"proxy_connect_timeout|required"`
	ProxySendTimeout    int    `json:"proxy_send_timeout,omitempty" validate:"proxy_send_timeout|required"`
	ProxyReadTimeout    int    `json:"proxy_read_timeout,omitempty" validate:"proxy_read_timeout|required"`
	ProxyBodySize       int    `json:"proxy_body_size,omitempty" validate:"proxy_body_size|required"`
	// SetHeaders          []*SetHeader `json:"set_headers,omitempty" `
	SetHeaders         map[string]string `json:"set_headers,omitempty" `
	Rewrites           []*Rewrite        `json:"rewrite,omitempty"`
	ProxyBufferSize    int               `json:"proxy_buffer_size,omitempty" validate:"proxy_buffer_size|numeric_between:1,65535"`
	ProxyBufferNumbers int               `json:"proxy_buffer_numbers,omitempty" validate:"proxy_buffer_size|numeric_between:1,65535"`
	ProxyBuffering     string            `json:"proxy_buffering,omitempty" validate:"proxy_buffering|required"`
	AccessLog          bool              `json:"access_log,omitempty" validate:"access_log|required"`
}

HTTPRuleConfig -

func (*HTTPRuleConfig) DbModel

func (h *HTTPRuleConfig) DbModel() []*dbmodel.GwRuleConfig

DbModel return database model

type HeaderRules

type HeaderRules struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

HeaderRules HeaderRules

type HelmAppRelease

type HelmAppRelease struct {
	Revision    int    `json:"revision"`
	Updated     string `json:"updated"`
	Status      string `json:"status"`
	Chart       string `json:"chart"`
	AppVersion  string `json:"app_version"`
	Description string `json:"description"`
}

HelmAppRelease -

type HistoryLogFile

type HistoryLogFile struct {
	Filename     string `json:"filename"`
	RelativePath string `json:"relative_path"`
}

HistoryLogFile represents a history log file for service

type HorizontalServiceStruct

type HorizontalServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// the event id
		// in: body
		// required: false
		EventID string `json:"event_id"`
		// 伸缩数量
		// in: body
		// required: false
		NodeNUM int `json:"node_num"`
	}
}

HorizontalServiceStruct HorizontalServiceStruct

type ImageShare

type ImageShare struct {
	PublicShare
	Image string `json:"image" validate:"image"`
}

ImageShare image 类型

type ImportAppStruct

type ImportAppStruct struct {
	EventID      string       `json:"event_id"`
	SourceDir    string       `json:"source_dir"`
	Apps         []string     `json:"apps"`
	Format       string       `json:"format"`
	ServiceImage ServiceImage `json:"service_image"`
	ServiceSlug  ServiceSlug  `json:"service_slug"`
}

ImportAppStruct -

type InstallAppReq

type InstallAppReq struct {
	Overrides []string `json:"overrides"`
}

InstallAppReq -

type Item

type Item struct {
	Key   string      `json:"key" validate:"key"`
	Value interface{} `json:"value" validate:"value"`
}

Item source值,键值对形式

type KubeResourceCustomSetting added in v1.1.0

type KubeResourceCustomSetting struct {
	Namespace string `json:"namespace"`
}

type Label added in v1.10.0

type Label struct {
	Key                 string `json:"label_key"`
	Value               string `json:"label_value"`
	IsVMSchedulingLabel bool   `json:"is_vm_scheduling_label"`
}

type LabelStruct

type LabelStruct struct {
	LabelKey   string `json:"label_key" validate:"label_key|required"`
	LabelValue string `json:"label_value" validate:"label_value|required"`
}

LabelStruct holds info for adding, updating or deleting label

type Labels

type Labels struct {
	// in: path
	// required: true
	NodeID string `json:"node"`
	// in: body
	Body struct {
		// label值列表
		// in: body
		// required: true
		Labels []string `json:"labels"`
	}
}

Labels LabelsStruct

type LabelsStruct

type LabelsStruct struct {
	Labels []LabelStruct `json:"labels"`
}

LabelsStruct blabla

type LanguageSet

type LanguageSet struct {
	ServiceID string `json:"service_id"`
	Language  string `json:"language"`
}

LanguageSet set language

type LastLinesStruct

type LastLinesStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// in: body
	Body struct {
		// 行数
		// in: body
		// required: true
		Lines int `json:"lines" validate:"lines"`
	}
}

LastLinesStruct LastLinesStruct

type LicenseInfo

type LicenseInfo struct {
	Code       string   `json:"code"`
	Company    string   `json:"company"`
	Node       int      `json:"node"`
	CPU        int      `json:"cpu"`
	MEM        int      `json:"memory"`
	TenantEnv  int      `json:"tenant_env"`
	EndTime    string   `json:"end_time"`
	StartTime  string   `json:"start_time"`
	DataCenter int      `json:"data_center"`
	ModuleList []string `json:"module_list"`
}

LicenseInfo license info

type ListAppResponse

type ListAppResponse struct {
	Page     int                    `json:"page"`
	PageSize int                    `json:"pageSize"`
	Total    int64                  `json:"total"`
	Apps     []*dbmodel.Application `json:"apps"`
}

ListAppResponse -

type ListApplicationConfigGroupResp

type ListApplicationConfigGroupResp struct {
	ConfigGroup []ApplicationConfigGroupResp `json:"config_group"`
	Total       int64                        `json:"total"`
	Page        int                          `json:"page"`
	PageSize    int                          `json:"pageSize"`
}

ListApplicationConfigGroupResp -

type ListNodeRequest added in v1.11.0

type ListNodeRequest struct {
	Query string `json:"query"`
}

type ListNodeResponse added in v1.10.0

type ListNodeResponse struct {
	Nodes []NodeInfo `json:"nodes"`
	Total int        `json:"total"`
}

type ListSchedulingLabelsResponse added in v1.10.0

type ListSchedulingLabelsResponse struct {
	Labels []Label `json:"labels"`
}

type ListSchedulingNodesResponse added in v1.10.0

type ListSchedulingNodesResponse struct {
	Nodes []NodeBaseInfo `json:"nodes"`
	Total int            `json:"total"`
}

type ListSchedulingTaintsResponse added in v1.10.0

type ListSchedulingTaintsResponse struct {
	Taints TaintForSelectList `json:"taints"`
}

type ListServiceResponse

type ListServiceResponse struct {
	Page     int                          `json:"page"`
	PageSize int                          `json:"pageSize"`
	Total    int64                        `json:"total"`
	Services []*dbmodel.TenantEnvServices `json:"services"`
}

ListServiceResponse -

type ListVMVolumesResponse added in v1.10.0

type ListVMVolumesResponse struct {
	VMVolumes []VMVolume `json:"volumes"`
	Total     int        `json:"total"`
}

type ListVMsResponse added in v1.7.0

type ListVMsResponse struct {
	VMs   []VMProfile `json:"vms"`
	Total int         `json:"total"`
}

type LogByLevelStruct

type LogByLevelStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// in: body
	Body struct {
		// 日志级别info/debug/error
		// in: body
		// required: true
		Level string `json:"level" validate:"level|required"`
		// eventID
		// in: body
		// required: true
		EventID string `json:"event_id" validate:"event_id|required"`
	}
}

LogByLevelStruct GetLogByLevelStruct

type LogData

type LogData struct {
}

LogData log data

type LogFileStruct

type LogFileStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// in: path
	// required: true
	FileName string `json:"file_name" validate:"file_name"`
}

LogFileStruct LogFileStruct

type LogSocketStruct

type LogSocketStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
}

LogSocketStruct LogSocketStruct

type Login

type Login struct {
	// in: body
	Body struct {
		// ip:端口
		// in: body
		// required: true
		HostPort string `json:"hostport"`
		// 登录类型
		// in: body
		// required: true
		LoginType bool `json:"type"`
		// 节点类型
		// in: body
		// required: true
		HostType string `json:"hosttype"`
		// root密码
		// in: body
		// required: false
		RootPwd string `json:"pwd,omitempty"`
	}
}

Login SSHLoginStruct

type MQBody

type MQBody struct {
	EventID       string `json:"event_id"`
	GroupKey      string `json:"group_key"`
	Version       string `json:"version"`
	Format        string `json:"format"` // only wutong-app/docker-compose
	SourceDir     string `json:"source_dir"`
	WithImageData bool   `json:"with_image_data"`
}

MQBody -

func BuildMQBodyFrom

func BuildMQBodyFrom(app *ExportAppStruct) *MQBody

BuildMQBodyFrom -

type MessageData

type MessageData struct {
	Message  string `json:"message"`
	Time     string `json:"time"`
	Unixtime int64  `json:"utime"`
}

MessageData message data 获取指定操作的操作日志

type Model

type Model struct {
	ID uint
}

Model 默认字段

type MontiorData

type MontiorData struct {
	//in: body
	Body struct {
		// in: body
		// required: true
		Start string `json:"start" validate:"start"`
		// in: body
		// required: true
		Queries string `json:"queries" validate:"queries"`
	}
}

MontiorData opentsdb data swagger:parameters oentsdbquery

type MsgStruct

type MsgStruct struct {
	EventID string `json:"event_id"`
	Step    string `json:"step"`
	Message string `json:"message"`
	Level   string `json:"level"`
	Time    string `json:"time"`
}

MsgStruct msg struct in eventlog_message

type NetDownStreamRules

type NetDownStreamRules struct {
	//限流值 max_connections
	Limit              int `json:"limit" validate:"limit|numeric_between:0,1024"`
	MaxPendingRequests int `json:"max_pending_requests"`
	MaxRequests        int `json:"max_requests"`
	MaxRetries         int `json:"max_retries"`
	//请求头
	//in: body
	//required: false
	Header []HeaderRules `json:"header" validate:"header"`
	//域名转发
	//in: body
	//required: false
	Domain []string `json:"domain" validate:"domain"`
	//path规则
	//in: body
	//required: false
	Prefix       string `json:"prefix" validate:"prefix"`
	ServiceAlias string `json:"service_alias"`
	ServiceID    string `json:"service_id" validate:"service_id"`
}

NetDownStreamRules NetDownStreamRules

type NetRulesDownStreamBody

type NetRulesDownStreamBody struct {
	DestService      string              `json:"dest_service"`
	DestServiceAlias string              `json:"dest_service_alias"`
	Port             int                 `json:"port"`
	Protocol         string              `json:"protocol"`
	Rules            *NetDownStreamRules `json:"rules"`
}

NetRulesDownStreamBody NetRulesDownStreamBody

type NetUpStreamRules

type NetUpStreamRules struct {
	NetDownStreamRules
	SourcePort int32 `json:"source_port"`
	MapPort    int32 `json:"map_port"`
}

NetUpStreamRules NetUpStreamRules

type NodeBaseInfo added in v1.10.0

type NodeBaseInfo struct {
	Name       string   `json:"name"`
	ExternalIP string   `json:"external_ip"`
	InternalIP string   `json:"internal_ip"`
	Roles      []string `json:"roles"`
	OS         string   `json:"os"`
	Arch       string   `json:"arch"`
}

type NodeInfo added in v1.10.0

type NodeInfo struct {
	NodeBaseInfo            `json:",inline"`
	KubeVersion             string  `json:"kube_version"`
	ContainerRuntime        string  `json:"container_runtime"`
	ContainerRuntimeVersion string  `json:"container_runtime_version"`
	OSVersion               string  `json:"os_version"`
	KernelVersion           string  `json:"kernel_version"`
	CreatedAt               string  `json:"created_at"`
	Status                  string  `json:"status"`                  // 节点状态:Ready, NotReady, Unknown
	PodCIDR                 string  `json:"pod_cidr"`                // Pod 网络 CIDR
	CPUCap                  float64 `json:"cpu_cap"`                 // CPU 容量
	CPUUsed                 float64 `json:"cpu_used"`                // CPU 使用量
	CPUtilizationRate       float64 `json:"cpu_utilization_rate"`    // CPU 使用率
	MemoryCap               float64 `json:"memory_cap"`              // 内存容量
	MemoryUsed              float64 `json:"memory_used"`             // 内存使用量
	MemoryUtilizationRate   float64 `json:"memory_utilization_rate"` // 内存使用率
	DiskCap                 float64 `json:"disk_cap"`                // 磁盘容量
	DiskUsed                float64 `json:"disk_used"`               // 磁盘使用量
	DiskUtilizationRate     float64 `json:"disk_utilization_rate"`   // 磁盘使用率
	PodCap                  int64   `json:"pod_cap"`                 // Pod 容量
	PodUsed                 int64   `json:"pod_used"`                // Pod 使用量
	PodUtilizationRate      float64 `json:"pod_utilization_rate"`    // Pod 使用率
	Schedulable             bool    `json:"schedulable"`             // 是否可调度
}

type NodeProfile added in v1.10.0

type NodeProfile struct {
	NodeInfo    `json:",inline"`
	Labels      []Label      `json:"labels"`
	Annotations []Annotation `json:"annotations"`
	Taints      []Taint      `json:"taints"`
}

type NodeResource

type NodeResource struct {
	Name            string  `json:"node_name"`
	RawUsedCPU      float32 `json:"-"`
	RawUsedMem      float32 `json:"-"`
	CapacityCPU     float32 `json:"capacity_cpu"`
	CapacityMem     float32 `json:"capacity_mem"`
	CapacityStorage float32 `json:"capacity_storage"`
	CapacityPods    int64   `json:"capacity_pod"`
	UsedCPU         float32 `json:"used_cpu"`
	UsedMem         float32 `json:"used_mem"`
	UsedStorage     float32 `json:"used_storage"`
	UsedPods        int64   `json:"used_pod"`
	DiskPressure    bool    `json:"disk_pressure"`
	MemoryPressure  bool    `json:"memory_pressure"`
	PIDPressure     bool    `json:"pid_pressure"`
	Ready           bool    `json:"ready"`
}

NodeResource is a collection of compute resource.

func NewNodeResource added in v1.1.0

func NewNodeResource(name string, rl corev1.NodeStatus) *NodeResource

type OSSourceFrom added in v1.7.0

type OSSourceFrom string
const (
	OSSourceFromHTTP     OSSourceFrom = "http"
	OSSourceFromRegistry OSSourceFrom = "registry"
)

type PagedTenantEnvResList added in v1.1.0

type PagedTenantEnvResList struct {
	List   []*TenantEnvResource `json:"list"`
	Length int                  `json:"length"`
}

PagedTenantEnvResList PagedTenantEnvResList

type ParseAppServicesReq

type ParseAppServicesReq struct {
	Values string `json:"values"`
}

ParseAppServicesReq -

type Plugin

type Plugin struct {
	PluginID    string `json:"plugin_id" validate:"plugin_id|required"`
	PluginName  string `json:"plugin_name" validate:"plugin_name|required"`
	PluginInfo  string `json:"plugin_info" validate:"plugin_info"`
	ImageURL    string `json:"image_url" validate:"image_url"`
	GitURL      string `json:"git_url" validate:"git_url"`
	BuildModel  string `json:"build_model" validate:"build_model"`
	PluginModel string `json:"plugin_model" validate:"plugin_model"`
	TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`
	PluginType  string `json:"origin" validate:"origin"`
}

Plugin -

func (*Plugin) DbModel

func (p *Plugin) DbModel(tenantEnvID string) *dbmodel.TenantEnvPlugin

DbModel return database model

type PluginBuildVersionStruct

type PluginBuildVersionStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	//in: path
	//required: true
	PluginID string `json:"plugin_id" validate:"plugin_id"`
	//in: path
	//required: true
	VersionID string `json:"version_id" validate:"version_id"`
}

PluginBuildVersionStruct PluginBuildVersionStruct

type PluginDefaultENV

type PluginDefaultENV struct {
	//对应插件id
	//in: body
	//required: true
	PluginID string `json:"plugin_id" validate:"plugin_id"`
	//构建版本id
	//in: body
	//required: true
	VersionID string `json:"version_id" validate:"version_id"`
	//配置项名称
	//in: body
	//required: true
	ENVName string `json:"env_name" validate:"env_name"`
	//配置项值
	//in: body
	//required: true
	ENVValue string `json:"env_value" validate:"env_value"`
	//是否可以被使用者修改
	//in :body
	//required: false
	IsChange bool `json:"is_change" validate:"is_change|bool"`
}

PluginDefaultENV 插件默认环境变量

type PluginSetStruct

type PluginSetStruct struct {
	//in: path
	//required: true
	TenantEnvName string `json:"tenant_env_name"`
	//in: path
	//required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		//plugin id
		//in: body
		//required: true
		PluginID string `json:"plugin_id" validate:"plugin_id"`
		// plugin version
		//in: body
		//required: true
		VersionID string `json:"version_id" validate:"version_id"`
		// plugin is uesd
		//in: body
		//required: false
		Switch bool `json:"switch" validate:"switch|bool"`
		// plugin cpu size default 125
		// in: body
		// required: false
		PluginCPU int `json:"plugin_cpu" validate:"plugin_cpu"`
		// plugin memory size default 64
		// in: body
		// required: false
		PluginMemory int `json:"plugin_memory" validate:"plugin_memory"`
		// app plugin config
		// in: body
		// required: true
		ConfigEnvs ConfigEnvs `json:"config_envs" validate:"config_envs"`
	}
}

PluginSetStruct PluginSetStruct

type PluginVersionEnv

type PluginVersionEnv struct {
	EnvName  string `json:"env_name" validate:"env_name"`
	EnvValue string `json:"env_value" validate:"env_value"`
}

PluginVersionEnv -

func (*PluginVersionEnv) DbModel

func (p *PluginVersionEnv) DbModel(componentID, pluginID string) *dbmodel.TenantEnvPluginVersionEnv

DbModel return database model

type PodContainer

type PodContainer struct {
	Image       string `json:"image,omitempty"`
	State       string `json:"state,omitempty"`
	Reason      string `json:"reason,omitempty"`
	Started     string `json:"started,omitempty"`
	LimitMemory string `json:"limit_memory,omitempty"`
	LimitCPU    string `json:"limit_cpu,omitempty"`
}

PodContainer -

type PodDetail

type PodDetail struct {
	Name           string          `json:"name,omitempty"`
	Node           string          `json:"node,omitempty"`
	StartTime      string          `json:"start_time,omitempty"`
	Status         *PodStatus      `json:"status,omitempty"`
	IP             string          `json:"ip,omitempty"`
	InitContainers []*PodContainer `json:"init_containers,omitempty"`
	Containers     []*PodContainer `json:"containers,omitempty"`
	Events         []*PodEvent     `json:"events,omitempty"`
}

PodDetail -

type PodEvent

type PodEvent struct {
	Type    string `json:"type,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Age     string `json:"age,omitempty"`
	Message string `json:"message,omitempty"`
}

PodEvent -

type PodStatus

type PodStatus struct {
	Type    int    `json:"type,omitempty"`
	TypeStr string `json:"type_str,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
	Advice  string `json:"advice,omitempty"`
}

PodStatus -

type PodsList

type PodsList struct {
	PodIP    string `json:"pod_ip"`
	Phase    string `json:"phase"`
	PodName  string `json:"pod_name"`
	NodeName string `json:"node_name"`
}

PodsList pod list

type PodsStructStruct

type PodsStructStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
}

PodsStructStruct PodsStructStruct

type PublicShare

type PublicShare struct {
	ServiceKey string         `json:"service_key" validate:"service_key"`
	APPVersion string         `json:"app_version" validate:"app_version"`
	IsOuter    bool           `json:"is_outer" validate:"is_outer"`
	Action     string         `json:"action" validate:"action"`
	ShareID    string         `json:"share_id" validate:"share_id"`
	EventID    string         `json:"event_id" validate:"event_id"`
	Dest       string         `json:"dest" validate:"dest|in:yb,ys"`
	ServiceID  string         `json:"service_id" validate:"service_id"`
	ShareConf  ShareConfItems `json:"share_conf" validate:"share_conf"`
}

PublicShare share共用结构

type ResourceSpec

type ResourceSpec struct {
	BasePorts    []*BasePort    `json:"base_ports"`
	BaseServices []*BaseService `json:"base_services"`
	BaseNormal   BaseEnv        `json:"base_normal"`
}

ResourceSpec 资源结构体

type RestartVMResponse added in v1.7.0

type RestartVMResponse struct {
	VMProfile
}

type RestoreDep

type RestoreDep struct {
	DepServiceID   string `validata:"dep_service_id|required" json:"dep_service_id"`
	DepServiceType string `validata:"dep_service_type|required" json:"dep_service_type"`
}

RestoreDep holds infomations of service dependency.

type RestoreDepVol

type RestoreDepVol struct {
	DepServiceID string `json:"dep_service_id"  validate:"dep_service_id|required"`
	VolumePath   string `json:"volume_path" validate:"volume_path|required|regex:^/"`
	VolumeName   string `json:"volume_name" validate:"volume_name|required|max:50"`
}

RestoreDepVol holds information of service dependent volume.

type RestoreDepVolsReq

type RestoreDepVolsReq struct {
	DepVols []*RestoreDepVol `validate:"dep_vols|required" json:"dep_vols"`
}

RestoreDepVolsReq defines a struct to receive the request body to restore service dependent volumes.

type RestoreDepsReq

type RestoreDepsReq struct {
	Deps []*RestoreDep `validate:"deps|required" json:"deps"`
}

RestoreDepsReq defines a struct to receive the request body to restore service dependencies.

type RestoreEnv

type RestoreEnv struct {
	ContainerPort int    `validate:"container_port|numeric_between:1,65535" json:"container_port"`
	Name          string `validate:"name" json:"name"`
	AttrName      string `validate:"env_name|required" json:"env_name"`
	AttrValue     string `validate:"env_value|required" json:"env_value"`
	IsChange      bool   `validate:"is_change|bool" json:"is_change"`
	Scope         string `validate:"scope|in:outer,inner,both,build" json:"scope"`
}

RestoreEnv holds infomations of every enviroment variables.

type RestoreEnvsReq

type RestoreEnvsReq struct {
	Scope string        `validate:"scope|required|in:outer,inner,both,build"`
	Envs  []*RestoreEnv `validate:"envs|required" json:"envs"`
}

RestoreEnvsReq defines a struct to receive the request body to restore enviroment variables

type RestorePlugin

type RestorePlugin struct {
	PluginID  string `json:"plugin_id" validate:"plugin_id"`
	VersionID string `json:"version_id" validate:"version_id"`
	Switch    bool   `json:"switch" validate:"switch|bool"`
}

RestorePlugin holds infomations of service dependenct volume.

type RestorePluginsReq

type RestorePluginsReq struct {
	Plugins []*RestorePlugin `validate:"plugins|required" json:"plugins"`
}

RestorePluginsReq defines a struct to receive the request body to restore service dependent volumes.

type RestorePort

type RestorePort struct {
	ContainerPort  int    `gorm:"column:container_port" validate:"container_port|required|numeric_between:1,65535" json:"container_port"`
	MappingPort    int    `gorm:"column:mapping_port" validate:"mapping_port|required|numeric_between:1,65535" json:"mapping_port"`
	Protocol       string `gorm:"column:protocol" validate:"protocol|required|in:http,https,stream,grpc" json:"protocol"`
	PortAlias      string `gorm:"column:port_alias" validate:"port_alias|required|alpha_dash" json:"port_alias"`
	IsInnerService bool   `gorm:"column:is_inner_service" validate:"is_inner_service|bool" json:"is_inner_service"`
	IsOuterService bool   `gorm:"column:is_outer_service" validate:"is_outer_service|bool" json:"is_outer_service"`
}

RestorePort holds information of port.

type RestorePortsReq

type RestorePortsReq struct {
	Ports []*RestorePort `validate:"ports|required" json:"ports"`
}

RestorePortsReq defines a struct to receive the request body to restore service ports

type RestoreRecord added in v1.6.0

type RestoreRecord struct {
	RestoreID      string `json:"restore_id"`
	BackupID       string `json:"backup_id"`
	ServiceID      string `json:"service_id"`
	CreatedAt      string `json:"created_at"`
	CompletedAt    string `json:"completed_at"`
	Size           string `json:"size"`
	ProgressRate   string `json:"progress_rate"`
	CompletedItems int    `json:"completed_items"`
	TotalItems     int    `json:"total_items"`
	Status         string `json:"status"`
	FailureReason  string `json:"failure_reason"`
	Operator       string `json:"operator"`
}

type RestoreVolume

type RestoreVolume struct {
	Category    string `json:"category"`
	VolumeName  string `json:"volume_name" validate:"volume_name|required|max:50"`
	VolumePath  string `json:"volume_path" validate:"volume_path|required|regex:^/"`
	VolumeType  string `json:"volume_type" validate:"volume_type|required|in:share-file,config-file"`
	FileContent string `json:"file_content"`
	HostPath    string `json:"host_path"`
	IsReadOnly  bool   `json:"is_read_only"`
}

RestoreVolume holds infomations of port.

type RestoreVolumesReq

type RestoreVolumesReq struct {
	Volumes []*RestoreVolume `validate:"volumes|required" json:"volumes"`
}

RestoreVolumesReq defines a struct to receive the request body to restore service volumes

type Rewrite

type Rewrite struct {
	Regex       string `json:"regex" validate:"regex|required"`
	Replacement string `json:"replacement" validate:"replacement|required"`
	Flag        string `json:"flag" validate:"flag|in:last,break,redirect,permanent|required"`
}

Rewrite is a embeded sturct of Body.

type RollBackStruct

type RollBackStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// event_id
		// in: body
		// required: false
		EventID string `json:"event_id"`
		// 回滚到的版本号
		// in: body
		// required: true
		DeployVersion string `json:"deploy_version"`
		// 操作人
		// in: body
		// required: false
		Operator string `json:"operator"`
	}
}

RollBackStruct RollBackStruct

type RollbackInfoRequestStruct

type RollbackInfoRequestStruct struct {
	//RollBackVersion The target version of the rollback
	RollBackVersion string `json:"upgrade_version"`
	//Event trace ID
	EventID   string            `json:"event_id"`
	ServiceID string            `json:"service_id"`
	Configs   map[string]string `json:"configs"`
}

RollbackInfoRequestStruct -

type RollbackStruct

type RollbackStruct struct {
	TenantEnvID   string `json:"tenant_env_id"`
	ServiceID     string `json:"service_id"`
	EventID       string `json:"event_id" default:"system"`
	Operator      string `json:"operator"`
	DeployVersion string `json:"deploy_version"`
}

RollbackStruct struct

type RuleConfigReq

type RuleConfigReq struct {
	RuleID    string `json:"rule_id,omitempty" validate:"rule_id|required"`
	ServiceID string
	EventID   string
	Body      Body `json:"body" validate:"body|required"`
}

RuleConfigReq -

type RuleExtensionStruct

type RuleExtensionStruct struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

RuleExtensionStruct represents rule extensions for http rule or tcp rule

type RuleMetric

type RuleMetric struct {
	MetricsType       string `json:"metric_type"`
	MetricsName       string `json:"metric_name"`
	MetricTargetType  string `json:"metric_target_type"`
	MetricTargetValue int    `json:"metric_target_value"`
}

RuleMetric -

func (RuleMetric) DbModel

DbModel return database model

type SchdulingNode added in v1.10.0

type SchdulingNode struct {
	NodeName string `json:"node_name"`
}

type SchedulingConfig added in v1.11.0

type SchedulingConfig struct {
	Labels      []SchedulingLabel      `json:"labels"`
	Nodes       []string               `json:"nodes"`
	Tolerations []SchedulingToleration `json:"tolerations"`
}

type SchedulingLabel added in v1.10.0

type SchedulingLabel struct {
	Key   string `json:"label_key"`
	Value string `json:"label_value"`
}

type SchedulingSelections added in v1.11.0

type SchedulingSelections struct {
	Labels []SchedulingLabel  `json:"labels"`
	Nodes  []NodeBaseInfo     `json:"nodes"`
	Taints TaintForSelectList `json:"taints"`
}

type SchedulingToleration added in v1.10.0

type SchedulingToleration struct {
	Key      string `json:"taint_key"`
	Value    string `json:"taint_value"`
	Operator string `json:"op"`
	Effect   string `json:"effect"`
}

type ServiceCheckStruct

type ServiceCheckStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: body
	Body struct {
		//uuid
		// in: body
		CheckUUID string `json:"uuid"`
		//检测来源类型
		// in: body
		// required: true
		SourceType string `json:"source_type" validate:"source_type|required|in:docker-run,docker-compose,sourcecode,third-party-service"`

		CheckOS string `json:"check_os"`
		// 检测来源定义,
		// 代码: https://github.com/wutong-paas/wutong.git master
		// docker-run: docker run --name xxx nginx:latest nginx
		// docker-compose: compose全文
		// in: body
		// required: true
		SourceBody  string `json:"source_body"`
		TenantEnvID string
		Username    string `json:"username"`
		Password    string `json:"password"`
		EventID     string `json:"event_id"`
	}
}

ServiceCheckStruct 应用检测,支持源码检测,镜像检测,dockerrun检测

type ServiceGetCommon

type ServiceGetCommon struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
}

ServiceGetCommon path参数

type ServiceImage

type ServiceImage struct {
	HubURL      string `json:"hub_url"`
	HubUser     string `json:"hub_user"`
	HubPassword string `json:"hub_password"`
	NameSpace   string `json:"namespace"`
}

ServiceImage -

type ServiceLBPortChange

type ServiceLBPortChange struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: path
	// required: true
	Port int `json:"port"`
	//in: body
	Body struct {
		// in: body
		// required: true
		ChangePort int `json:"change_port"  validate:"change_port|required"`
	}
}

ServiceLBPortChange change lb port swagger:parameters changelbport

type ServicePortInnerOrOuter

type ServicePortInnerOrOuter struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: path
	// required: true
	Port int `json:"port"`
	//in: body
	Body struct {
		// 操作值 `close` or `open`
		// in: body
		// required: true
		Operation      string `json:"operation"  validate:"operation|required|in:open,close"`
		IfCreateExPort bool   `json:"if_create_ex_port"`
	}
}

ServicePortInnerOrOuter service port swagger:parameters PortInnerController PortOuterController

type ServicePorts

type ServicePorts struct {
	Port []*TenantEnvServicesPort
}

ServicePorts service ports

type ServiceProbe

type ServiceProbe struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id" validate:"service_id|between:30,33"`
	ProbeID   string `gorm:"column:probe_id;size:32" json:"probe_id" validate:"probe_id|required|between:30,33"`
	Mode      string `gorm:"column:mode;default:liveness" json:"mode" validate:"mode"`
	Scheme    string `gorm:"column:scheme;default:scheme" json:"scheme" validate:"scheme"`
	Path      string `gorm:"column:path" json:"path" validate:"path"`
	Port      int    `gorm:"column:port;size:5;default:80" json:"port" validate:"port|numeric_between:1,65535"`
	Cmd       string `gorm:"column:cmd;size:150" json:"cmd" validate:"cmd"`
	//http请求头,key=value,key2=value2
	HTTPHeader string `gorm:"column:http_header;size:300" json:"http_header" validate:"http_header"`
	//初始化等候时间
	InitialDelaySecond int `gorm:"column:initial_delay_second;size:2;default:1" json:"initial_delay_second" validate:"initial_delay_second"`
	//检测间隔时间
	PeriodSecond int `gorm:"column:period_second;size:2;default:3" json:"period_second" validate:"period_second"`
	//检测超时时间
	TimeoutSecond int `gorm:"column:timeout_second;size:3;default:30" json:"timeout_second" validate:"timeout_second"`
	//是否启用
	IsUsed int `gorm:"column:is_used;size:1;default:0" json:"is_used" validate:"is_used|in:0,1"`
	//标志为失败的检测次数
	FailureThreshold int `gorm:"column:failure_threshold;size:2;default:3" json:"failure_threshold" validate:"failure_threshold"`
	//标志为成功的检测次数
	SuccessThreshold int    `gorm:"column:success_threshold;size:2;default:1" json:"success_threshold" validate:"success_threshold"`
	FailureAction    string `json:"failure_action" validate:"failure_action"`
}

ServiceProbe 应用探针信息

func (*ServiceProbe) DbModel

func (p *ServiceProbe) DbModel(componentID string) *dbmodel.TenantEnvServiceProbe

DbModel return database model

type ServiceShare

type ServiceShare struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		//in: body
		//应用分享Key
		ServiceKey string `json:"service_key" validate:"service_key|required"`
		AppVersion string `json:"app_version" validate:"app_version|required"`
		EventID    string `json:"event_id"`
		ShareUser  string `json:"share_user"`
		ShareScope string `json:"share_scope"`
		ImageInfo  struct {
			HubURL      string `json:"hub_url"`
			HubUser     string `json:"hub_user"`
			HubPassword string `json:"hub_password"`
			Namespace   string `json:"namespace"`
			IsTrust     bool   `json:"is_trust,omitempty" validate:"is_trust"`
		} `json:"image_info,omitempty"`
		SlugInfo struct {
			Namespace   string `json:"namespace"`
			FTPHost     string `json:"ftp_host"`
			FTPPort     string `json:"ftp_port"`
			FTPUser     string `json:"ftp_username"`
			FTPPassword string `json:"ftp_password"`
		} `json:"slug_info,omitempty"`
	}
}

ServiceShare service share swagger:parameters shareService

type ServiceSlug

type ServiceSlug struct {
	FtpHost     string `json:"ftp_host"`
	FtpPort     string `json:"ftp_port"`
	FtpUsername string `json:"ftp_username"`
	FtpPassword string `json:"ftp_password"`
	NameSpace   string `json:"namespace"`
}

ServiceSlug -

type ServiceStruct

type ServiceStruct struct {
	TenantEnvID string `json:"tenant_env_id" validate:"tenant_env_id"`
	// in: path
	// required: true
	ServiceID string `json:"service_id" validate:"service_id"`
	// 服务名称,用于有状态服务DNS
	// in: body
	// required: false
	ServiceName string `json:"service_name" validate:"service_name"`
	// 服务别名
	// in: body
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// 组件类型
	// in: body
	// required: true
	ServiceType string `json:"service_type" validate:"service_type"`
	// 服务描述
	// in: body
	// required: false
	Comment string `json:"comment" validate:"comment"`
	// 服务版本
	// in: body
	// required: false
	ServiceVersion string `json:"service_version" validate:"service_version"`
	// 镜像名称
	// in: body
	// required: false
	ImageName string `json:"image_name" validate:"image_name"`
	// 容器CPU申请
	// in: body
	// required: false
	ContainerRequestCPU int `json:"container_request_cpu" validate:"container_request_cpu"`
	// 容器CPU权重
	// in: body
	// required: false
	ContainerCPU int `json:"container_cpu" validate:"container_cpu"`
	// 容器内存申请
	// in: body
	// required: false
	ContainerRequestMemory int `json:"container_request_memory" validate:"container_request_memory"`
	// 容器最大内存
	// in: body
	// required: false
	ContainerMemory int `json:"container_memory" validate:"container_memory"`
	// GPU 类型
	// in: body
	// required: false
	ContainerGPUType string `json:"container_gpu_type" validate:"container_gpu_type"`
	// component gpu video memory
	// in: body
	// required: false
	ContainerGPU int `json:"container_gpu" validate:"container_gpu"`
	// 容器启动命令
	// in: body
	// required: false
	ContainerCMD string `json:"container_cmd" validate:"container_cmd"`
	// 容器环境变量
	// in: body
	// required: false
	ContainerEnv string `json:"container_env" validate:"container_env"`
	// 扩容方式;0:无状态;1:有状态;2:分区(v5.2用于接收组件的类型)
	// in: body
	// required: false
	ExtendMethod string `json:"extend_method" validate:"extend_method"`
	// 节点数
	// in: body
	// required: false
	Replicas int `json:"replicas" validate:"replicas"`
	// 部署版本
	// in: body
	// required: false
	DeployVersion string `json:"deploy_version" validate:"deploy_version"`
	// 服务分类:application,cache,store
	// in: body
	// required: false
	Category string `json:"category" validate:"category"`
	// 服务当前状态:undeploy,running,closed,unusual,starting,checking,stoping
	// in: body
	// required: false
	CurStatus string `json:"cur_status" validate:"cur_status"`
	// 最新操作ID
	// in: body
	// required: false
	EventID string `json:"event_id" validate:"event_id"`
	// 镜像来源
	// in: body
	// required: false
	Namespace string `json:"namespace" validate:"namespace"`
	// 更新时间
	// in: body
	// required: false
	UpdateTime time.Time `json:"update_time" validate:"update_time"`
	// 服务创建类型cloud云市服务,assistant云帮服务
	// in: body
	// required: false
	ServiceOrigin string `json:"service_origin" validate:"service_origin"`
	Kind          string `json:"kind" validate:"kind|in:internal,third_party"`
	EtcdKey       string `json:"etcd_key" validate:"etcd_key"`
	//OSType runtime os type
	// in: body
	// required: false
	OSType            string                                  `json:"os_type" validate:"os_type|in:windows,linux"`
	ServiceLabel      string                                  `json:"service_label"  validate:"service_label|in:StatelessServiceType,StatefulServiceType"`
	NodeLabel         string                                  `json:"node_label"  validate:"node_label"`
	Operator          string                                  `json:"operator"  validate:"operator"`
	RepoURL           string                                  `json:"repo_url" validate:"repo_url"`
	DependIDs         []dbmodel.TenantEnvServiceRelation      `json:"depend_ids" validate:"depend_ids"`
	VolumesInfo       []TenantEnvServiceVolumeStruct          `json:"volumes_info" validate:"volumes_info"`
	DepVolumesInfo    []dbmodel.TenantEnvServiceMountRelation `json:"dep_volumes_info" validate:"dep_volumes_info"`
	EnvsInfo          []dbmodel.TenantEnvServiceEnvVar        `json:"envs_info" validate:"envs_info"`
	PortsInfo         []dbmodel.TenantEnvServicesPort         `json:"ports_info" validate:"ports_info"`
	Endpoints         *Endpoints                              `json:"endpoints" validate:"endpoints"`
	AppID             string                                  `json:"app_id" validate:"required"`
	ComponentProbes   []ServiceProbe                          `json:"component_probes" validate:"component_probes"`
	ComponentMonitors []AddServiceMonitorRequestStruct        `json:"component_monitors" validate:"component_monitors"`
	HTTPRules         []AddHTTPRuleStruct                     `json:"http_rules" validate:"http_rules"`
	TCPRules          []AddTCPRuleStruct                      `json:"tcp_rules" validate:"tcp_rules"`
	K8sComponentName  string                                  `json:"k8s_component_name" validate:"k8s_component_name"`
}

ServiceStruct service struct

type ServicesInfoStruct

type ServicesInfoStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
}

ServicesInfoStruct ServicesInfoStruct swagger:parameters getServiceInfo

type ServicesResources

type ServicesResources struct {
	// in: body
	Body struct {
		// in: body
		// required: true
		ServiceIDs []string `json:"service_ids" validate:"service_ids"`
	}
}

ServicesResources ServicesResources swagger:parameters serviceResources

type SetDefineSourcesStruct

type SetDefineSourcesStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	SourceAlias string `json:"source_alias" validate:"source_alias"`
	// in: body
	Body struct {
		//in: body
		//required: true
		SourceSpec *SourceSpec `json:"source_spec" validate:"source_spec"`
	}
}

SetDefineSourcesStruct SetDefineSourcesStruct

type SetHeader

type SetHeader struct {
	Key   string `json:"item_key"`
	Value string `json:"item_value"`
}

SetHeader set header

type SetLanguageStruct

type SetLanguageStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// the tenant env id
		// in: body
		// required: true
		EventID string `json:"event_id"`
		// the language
		// in: body
		// required: true
		Language string `json:"language"`
	}
}

SetLanguageStruct SetLanguageStruct swagger:parameters setLanguage

type SetNetDownStreamRuleStruct

type SetNetDownStreamRuleStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		//in: body
		//required: true
		DestService string `json:"dest_service" validate:"dest_service"`
		//下游服务别名
		//in: body
		//required: true
		DestServiceAlias string `json:"dest_service_alias" validate:"dest_service_alias"`
		//端口
		//in: body
		//required: true
		Port int `json:"port" validate:"port"`
		//协议
		//in: body
		//required: true
		Protocol string `json:"protocol" validate:"protocol|between:tcp,http"`
		//规则体
		//in: body
		//required: true
		Rules *NetDownStreamRules `json:"rules" validate:"rules"`
	}
}

SetNetDownStreamRuleStruct SetNetDownStreamRuleStruct

type SetNodeAnnotationRequest added in v1.10.0

type SetNodeAnnotationRequest struct {
	Key   string `json:"annotation_key" validate:"required"`
	Value string `json:"annotation_value"`
}

type SetNodeLabelRequest added in v1.10.0

type SetNodeLabelRequest struct {
	Key   string `json:"label_key" validate:"required"`
	Value string `json:"label_value"`
}

type SetServiceSchedulingNodeRequest added in v1.10.0

type SetServiceSchedulingNodeRequest struct {
	Nodes []string `json:"nodes"`
}

type SetVMSchedulingLabelRequest added in v1.10.0

type SetVMSchedulingLabelRequest struct {
	Key   string `json:"label_key" validate:"required"`
	Value string `json:"label_value"`
}

type SetVersionEnv

type SetVersionEnv struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id"`
	//in: body
	Body struct {
		TenantEnvID string `json:"tenant_env_id"`
		ServiceID   string `json:"service_id"`
		// 环境变量
		// in: body
		// required: true
		ConfigEnvs ConfigEnvs `json:"config_envs" validate:"config_envs"`
	}
}

SetVersionEnv SetVersionEnv

type ShareConfItems

type ShareConfItems struct {
	FTPHost       string `json:"ftp_host" validate:"ftp_host"`
	FTPPort       int    `json:"ftp_port" validate:"ftp_port"`
	FTPUserName   string `json:"ftp_username" valiate:"ftp_username"`
	FTPPassWord   string `json:"ftp_password" validate:"ftp_password"`
	FTPNamespace  string `json:"ftp_namespace" validate:"ftp_namespace"`
	OuterRegistry string `json:"outer_registry" validate:"outer_registry"`
}

ShareConfItems 分享相关配置

type SlugShare

type SlugShare struct {
	PublicShare
	ServiceKey    string `json:"service_key" validate:"service_key"`
	APPVersion    string `json:"app_version" validate:"app_version"`
	DeployVersion string `json:"deploy_version" validate:"deploy_version"`
	TenantEnvID   string `json:"tenant_env_id" validate:"tenant_env_id"`
	Dest          string `json:"dest" validate:"dest|in:yb,ys"`
}

SlugShare Slug 类型

type SourceSpec

type SourceSpec struct {
	Alias      string               `json:"source_alias" validate:"source_alias"`
	Info       string               `json:"source_info" validate:"source_info"`
	CreateTime string               `json:"create_time" validate:"create_time"`
	Operator   string               `json:"operator" validate:"operator"`
	SourceBody *SoureBody           `json:"source_body" validate:"source_body"`
	Additions  map[string]*Addition `json:"additons" validate:"additions"`
}

SourceSpec SourceSpec

type SoureBody

type SoureBody struct {
	EnvName string      `json:"env_name" validate:"env_name"`
	EnvVal  interface{} `json:"env_value" validate:"env_value"`
}

SoureBody SoureBody

type StartServiceStruct

type StartServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// the tenant env id
		// in: body
		// required: false
		EventID string `json:"event_id"`
	}
}

StartServiceStruct StartServiceStruct

type StartStopStruct

type StartStopStruct struct {
	ServiceID     string
	TenantEnvID   string
	DeployVersion string
	EventID       string
	TaskType      string
}

StartStopStruct start struct

type StartVMResponse added in v1.7.0

type StartVMResponse struct {
	VMProfile
}

type StatsInfo

type StatsInfo struct {
	UUID string `json:"uuid"`
	CPU  int    `json:"cpu"`
	MEM  int    `json:"memory"`
}

StatsInfo stats info

type StatusList

type StatusList struct {
	TenantEnvID   string     `json:"tenant_env_id"`
	ServiceID     string     `json:"service_id"`
	ServiceAlias  string     `json:"service_alias"`
	DeployVersion string     `json:"deploy_version"`
	Replicas      int        `json:"replicas"`
	ContainerMem  int        `json:"container_memory"`
	CurStatus     string     `json:"cur_status"`
	ContainerCPU  int        `json:"container_cpu"`
	StatusCN      string     `json:"status_cn"`
	StartTime     string     `json:"start_time"`
	PodList       []PodsList `json:"pod_list"`
}

StatusList status list

type StatusServiceListStruct

type StatusServiceListStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: body
	// required: true
	Body struct {
		// 需要获取状态的服务ID列表,若不指定,返回租户所有应用的状态
		// in: body
		// required: true
		ServiceIDs []string `json:"service_ids" validate:"service_ids|required"`
	}
}

StatusServiceListStruct StatusServiceListStruct

type StatusServiceStruct

type StatusServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
}

StatusServiceStruct StatusServiceStruct

type StopVMResponse added in v1.7.0

type StopVMResponse struct {
	VMProfile
}

type StorageClass added in v1.11.0

type StorageClass struct {
	Name      string `json:"name"`
	IsDefault bool   `json:"is_default"`
}

type SyncAppConfigGroup

type SyncAppConfigGroup struct {
	AppConfigGroups []AppConfigGroup `json:"app_config_groups"`
}

SyncAppConfigGroup -

type SyncComponentReq

type SyncComponentReq struct {
	Components         []*Component `json:"components"`
	DeleteComponentIDs []string     `json:"delete_component_ids"`
}

SyncComponentReq -

type TCPBody added in v1.1.0

type TCPBody struct {
	KeepaliveEnabled               bool `json:"keepalive_enabled,omitempty"`
	KeepaliveIdle                  int  `json:"keepalive_idle,omitempty"`
	KeepaliveIntvl                 int  `json:"keepalive_intvl,omitempty"`
	KeepaliveCnt                   int  `json:"keepalive_cnt,omitempty"`
	ProxyStreamTimeout             int  `json:"proxy_stream_timeout,omitempty"`
	ProxyStreamNextUpstreamTimeout int  `json:"proxy_stream_next_upstream_timeout,omitempty"`
}

TCPBody is a embedded sturct of TCPRuleConfigReq.

type TCPRuleConfig added in v1.1.0

type TCPRuleConfig struct {
	RuleID                         string `json:"rule_id,omitempty" validate:"rule_id|required"`
	KeepaliveEnabled               bool   `json:"keepalive_enabled,omitempty"`
	KeepaliveIdle                  int    `json:"keepalive_idle,omitempty"`
	KeepaliveIntvl                 int    `json:"keepalive_intvl,omitempty"`
	KeepaliveCnt                   int    `json:"keepalive_cnt,omitempty"`
	ProxyStreamTimeout             int    `json:"proxy_stream_timeout,omitempty"`
	ProxyStreamNextUpstreamTimeout int    `json:"proxy_stream_next_upstream_timeout,omitempty"`
}

TCPRuleConfig -

func (*TCPRuleConfig) DbModel added in v1.1.0

func (t *TCPRuleConfig) DbModel() []*dbmodel.GwRuleConfig

DbModel return database model

type TCPRuleConfigReq added in v1.1.0

type TCPRuleConfigReq struct {
	RuleID    string `json:"rule_id,omitempty" validate:"rule_id|required"`
	ServiceID string
	EventID   string
	Body      TCPBody `json:"body" validate:"body|required"`
}

TCPRuleConfigReq -

type Taint added in v1.10.0

type Taint struct {
	Key    string `json:"taint_key"`
	Value  string `json:"taint_value"`
	Effect string `json:"effect"`
}

type TaintForSelect added in v1.10.0

type TaintForSelect struct {
	Key    string   `json:"taint_key"`
	Values []string `json:"values"`
}

type TaintForSelectList added in v1.10.0

type TaintForSelectList []*TaintForSelect

func (TaintForSelectList) Contains added in v1.10.0

func (l TaintForSelectList) Contains(t corev1.Taint) bool

func (TaintForSelectList) ContainsKey added in v1.10.0

func (l TaintForSelectList) ContainsKey(key string) bool

func (TaintForSelectList) TryAppend added in v1.10.0

type TaintForSelectValue added in v1.10.0

type TaintForSelectValue struct {
	Value  string `json:"taint_value"`
	Effect string `json:"effect"`
}

type TaintNodeRequest added in v1.10.0

type TaintNodeRequest struct {
	Key    string `json:"taint_key" validate:"required"`
	Value  string `json:"taint_value"`
	Effect string `json:"effect" validate:"required"`
}

type TenantEnvAndResource added in v1.1.0

type TenantEnvAndResource struct {
	dbmodel.TenantEnvs
	CPURequest            int64 `json:"cpu_request"`
	CPULimit              int64 `json:"cpu_limit"`
	MemoryRequest         int64 `json:"memory_request"`
	MemoryLimit           int64 `json:"memory_limit"`
	RunningAppNum         int64 `json:"running_app_num"`
	RunningAppInternalNum int64 `json:"running_app_internal_num"`
	RunningAppThirdNum    int64 `json:"running_app_third_num"`
}

TenantEnvAndResource tenant env and resource strcut

type TenantEnvComponentRelation added in v1.1.0

type TenantEnvComponentRelation struct {
	DependServiceID   string `json:"dep_service_id"`
	DependServiceType string `json:"dep_service_type"`
	DependOrder       int    `json:"dep_order"`
}

TenantEnvComponentRelation -

func (*TenantEnvComponentRelation) DbModel added in v1.1.0

func (t *TenantEnvComponentRelation) DbModel(tenantEnvID, componentID string) *dbmodel.TenantEnvServiceRelation

DbModel return database model

type TenantEnvList added in v1.1.0

type TenantEnvList []*TenantEnvAndResource

TenantEnvList TenantEnv list struct

func (*TenantEnvList) Add added in v1.1.0

func (list *TenantEnvList) Add(tr *TenantEnvAndResource)

Add add

func (TenantEnvList) Len added in v1.1.0

func (list TenantEnvList) Len() int

func (TenantEnvList) Less added in v1.1.0

func (list TenantEnvList) Less(i, j int) bool

func (TenantEnvList) Paging added in v1.1.0

func (list TenantEnvList) Paging(page, pageSize int) map[string]interface{}

Paging paging

func (TenantEnvList) Swap added in v1.1.0

func (list TenantEnvList) Swap(i, j int)

type TenantEnvLogByLevelStruct added in v1.1.0

type TenantEnvLogByLevelStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: body
	Body struct {
		// 日志级别info/debug/error
		// in: body
		// required: true
		Level string `json:"level" validate:"level|required"`
		// eventID
		// in: body
		// required: true
		EventID string `json:"event_id" validate:"event_id|required"`
	}
}

TenantEnvLogByLevelStruct GetTenantEnvLogByLevelStruct

type TenantEnvPluginVersionConfig added in v1.1.0

type TenantEnvPluginVersionConfig struct {
	ConfigStr string `json:"config_str" validate:"config_str"`
}

TenantEnvPluginVersionConfig -

func (*TenantEnvPluginVersionConfig) DbModel added in v1.1.0

DbModel return database model

type TenantEnvResList added in v1.1.0

type TenantEnvResList []*TenantEnvResource

TenantEnvResList TenantEnvResList

func (TenantEnvResList) Len added in v1.1.0

func (list TenantEnvResList) Len() int

func (TenantEnvResList) Less added in v1.1.0

func (list TenantEnvResList) Less(i, j int) bool

func (TenantEnvResList) Swap added in v1.1.0

func (list TenantEnvResList) Swap(i, j int)

type TenantEnvResource added in v1.1.0

type TenantEnvResource struct {
	//without plugin
	AllocatedCPU int `json:"alloc_cpu"`
	//without plugin
	AllocatedMEM int `json:"alloc_memory"`
	//with plugin
	UsedCPU int `json:"used_cpu"`
	//with plugin
	UsedMEM  int     `json:"used_memory"`
	UsedDisk float64 `json:"used_disk"`
	Name     string  `json:"name"`
	UUID     string  `json:"uuid"`
}

TenantEnvResource abandoned

type TenantEnvResources added in v1.1.0

type TenantEnvResources struct {
	// in: body
	Body struct {
		// in: body
		// required: true
		TenantName string `json:"tenant_name" validate:"tenant_name"`
		// in: body
		// required: true
		TenantEnvNames []string `json:"tenant_env_names" validate:"tenant_env_names"`
	}
}

TenantEnvResources TenantEnvResources swagger:parameters tenantEnvResources

type TenantEnvServiceVolume added in v1.1.0

type TenantEnvServiceVolume struct {
	Model
	ServiceID string `gorm:"column:service_id;size:32" json:"service_id" validate:"service_id"`
	//服务类型
	Category   string `gorm:"column:category;size:50" json:"category" validate:"category|required"`
	HostPath   string `gorm:"column:host_path" json:"host_path" validate:"host_path|required"`
	VolumePath string `gorm:"column:volume_path" json:"volume_path" validate:"volume_path|required"`
	IsReadOnly bool   `gorm:"column:is_read_only;default:false" json:"is_read_only" validate:"is_read_only|bool"`
}

TenantEnvServiceVolume 应用持久化记录

type TenantEnvServiceVolumeStruct added in v1.1.0

type TenantEnvServiceVolumeStruct struct {
	ServiceID string ` json:"service_id"`
	//服务类型
	Category string `json:"category"`
	//存储类型(share,local,tmpfs)
	VolumeType string `json:"volume_type"`
	//存储名称
	VolumeName string `json:"volume_name"`
	//主机地址
	HostPath string `json:"host_path"`
	//挂载地址
	VolumePath string `json:"volume_path"`
	//是否只读
	IsReadOnly bool `json:"is_read_only"`

	FileContent string `json:"file_content"`
	// VolumeCapacity 存储大小
	VolumeCapacity int64 `json:"volume_capacity"`
	// AccessMode 读写模式(Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time. #https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
	AccessMode string `json:"access_mode"`
	// SharePolicy 共享模式
	SharePolicy string `json:"share_policy"`
	// BackupPolicy 备份策略
	BackupPolicy string `json:"backup_policy"`
	// ReclaimPolicy 回收策略
	ReclaimPolicy string `json:"reclaim_policy"`
	// AllowExpansion 是否支持扩展
	AllowExpansion bool `json:"allow_expansion"`
	// VolumeProviderName 使用的存储驱动别名
	VolumeProviderName string `json:"volume_provider_name"`
}

TenantEnvServiceVolumeStruct -

type TenantEnvServicesPort added in v1.1.0

type TenantEnvServicesPort struct {
	Model
	TenantEnvID    string `gorm:"column:tenant_env_id;size:32" validate:"tenant_env_id|between:30,33" json:"tenant_env_id"`
	ServiceID      string `gorm:"column:service_id;size:32" validate:"service_id|between:30,33" json:"service_id"`
	ContainerPort  int    `gorm:"column:container_port" validate:"container_port|required|numeric_between:1,65535" json:"container_port"`
	MappingPort    int    `gorm:"column:mapping_port" validate:"mapping_port|required|numeric_between:1,65535" json:"mapping_port"`
	Protocol       string `gorm:"column:protocol" validate:"protocol|required|in:http,https,stream,grpc" json:"protocol"`
	PortAlias      string `gorm:"column:port_alias" validate:"port_alias|required|alpha_dash" json:"port_alias"`
	K8sServiceName string `gorm:"column:k8s_service_name" json:"k8s_service_name"`
	IsInnerService bool   `gorm:"column:is_inner_service" validate:"is_inner_service|bool" json:"is_inner_service"`
	IsOuterService bool   `gorm:"column:is_outer_service" validate:"is_outer_service|bool" json:"is_outer_service"`
}

TenantEnvServicesPort 应用端口信息

func (*TenantEnvServicesPort) DbModel added in v1.1.0

func (p *TenantEnvServicesPort) DbModel(tenantEnvID, componentID string) *dbmodel.TenantEnvServicesPort

DbModel return database model

type ThirdEndpoint

type ThirdEndpoint struct {
	EpID     string `json:"ep_id"`
	Address  string `json:"address"`
	Status   string `json:"status"`
	IsStatic bool   `json:"is_static"`
}

ThirdEndpoint is one of the Endpoints list in the response to list, add, update or delete the endpints.

type ThirdEndpoints

type ThirdEndpoints []*ThirdEndpoint

ThirdEndpoints -

func (ThirdEndpoints) Len

func (e ThirdEndpoints) Len() int

Len is part of sort.Interface.

func (ThirdEndpoints) Less

func (e ThirdEndpoints) Less(i, j int) bool

Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.

func (ThirdEndpoints) Swap

func (e ThirdEndpoints) Swap(i, j int)

Swap is part of sort.Interface.

type ThridPartyServiceProbe

type ThridPartyServiceProbe struct {
	Scheme       string `json:"scheme"`
	Path         string `json:"path"`
	Port         int    `json:"port"`
	TimeInterval int    `json:"time_interval"`
	MaxErrorNum  int    `json:"max_error_num"`
	Action       string `json:"action"`
}

ThridPartyServiceProbe is the json obejct in the request to update or fetch the ThridPartyServiceProbe.

type TotalStatsInfo

type TotalStatsInfo struct {
	Data []*StatsInfo `json:"data"`
}

TotalStatsInfo total stats info

type TransPlugins

type TransPlugins struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	//in: body
	Body struct {
		// 从该租户安装
		// in: body
		// required: true
		FromTenantEnvName string `json:"from_tenant_env_name" validate:"from_tenant_env_name"`
		// 插件id
		// in: body
		// required: true
		PluginsID []string `json:"plugins_id" validate:"plugins_id"`
	}
}

TransPlugins TransPlugins

type UpdCertificateReq

type UpdCertificateReq struct {
	CertificateID   string `json:"certificate_id"`
	CertificateName string `json:"certificate_name"`
	Certificate     string `json:"certificate"`
	PrivateKey      string `json:"private_key"`
}

UpdCertificateReq -

type UpdEndpiontsReq

type UpdEndpiontsReq struct {
	EpID    string `json:"ep_id" validate:"required|len:32"`
	Address string `json:"address"`
}

UpdEndpiontsReq is one of the Endpoints in the request to update the endpints.

type UpdRuleConfigReq

type UpdRuleConfigReq struct {
	ConfigID string `json:"config_id" validate:"config_id|required"`
	Key      string `json:"key"`
	Value    string `json:"value"`
}

UpdRuleConfigReq -

type UpdVolumeReq

type UpdVolumeReq struct {
	VolumeName  string `json:"volume_name" validate:"required"`
	VolumeType  string `json:"volume_type" validate:"volume_type|required"`
	FileContent string `json:"file_content"`
	VolumePath  string `json:"volume_path" validate:"volume_path|required"`
	Mode        *int32 `json:"mode"`
}

UpdVolumeReq is a value struct holding request for updating volume.

type UpdateAppConfigGroupReq

type UpdateAppConfigGroupReq struct {
	ServiceIDs  []string     `json:"service_ids"`
	ConfigItems []ConfigItem `json:"config_items" validate:"required"`
	Enable      bool         `json:"enable"`
}

UpdateAppConfigGroupReq -

type UpdateAppRequest

type UpdateAppRequest struct {
	AppName        string   `json:"app_name"`
	GovernanceMode string   `json:"governance_mode"`
	Overrides      []string `json:"overrides"`
	Version        string   `json:"version"`
	Revision       int      `json:"revision"`
	K8sApp         string   `json:"k8s_app"`
}

UpdateAppRequest -

func (*UpdateAppRequest) NeedUpdateHelmApp

func (u *UpdateAppRequest) NeedUpdateHelmApp() bool

NeedUpdateHelmApp check if necessary to update the helm app.

type UpdateBackupScheduleRequest added in v1.7.0

type UpdateBackupScheduleRequest struct {
	Desc     string `json:"desc"`
	Cron     string `json:"cron"`
	TTL      string `json:"ttl"`
	Operator string `json:"operator"`
}

type UpdateBuildVersionReq

type UpdateBuildVersionReq struct {
	PlanVersion string `json:"plan_version" validate:"required"`
}

UpdateBuildVersionReq -

type UpdateDefineSourcesStruct

type UpdateDefineSourcesStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	SourceAlias string `json:"source_alias" validate:"source_alias"`
	// in: path
	// required: true
	EnvName string `json:"env_name" validate:"env_name"`
	// in: body
	Body struct {
		//in: body
		//required: true
		SourceSpec *SourceSpec `json:"source_spec" validate:"source_spec"`
	}
}

UpdateDefineSourcesStruct UpdateDefineSourcesStruct

type UpdateHTTPRuleStruct

type UpdateHTTPRuleStruct struct {
	HTTPRuleID     string                 `json:"http_rule_id" validate:"http_rule_id|required"`
	ServiceID      string                 `json:"service_id"`
	ContainerPort  int                    `json:"container_port"`
	Domain         string                 `json:"domain"`
	Path           string                 `json:"path"`
	Header         string                 `json:"header"`
	Cookie         string                 `json:"cookie"`
	Weight         int                    `json:"weight"`
	IP             string                 `json:"ip"`
	CertificateID  string                 `json:"certificate_id"`
	Certificate    string                 `json:"certificate"`
	PrivateKey     string                 `json:"private_key"`
	RuleExtensions []*RuleExtensionStruct `json:"rule_extensions"`
	PathRewrite    bool                   `json:"path_rewrite"`
	Rewrites       []*Rewrite             `json:"rewrites"`
}

UpdateHTTPRuleStruct is used to update http rule, certificate and rule extensions

type UpdateNetDownStreamRuleStruct

type UpdateNetDownStreamRuleStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias" validate:"service_alias"`
	// in: path
	// required: true
	DestServiceAlias string `json:"dest_service_alias" validate:"dest_service_alias"`
	// in: path
	// required: true
	Port int `json:"port" validate:"port|numeric_between:1,65535"`
	// in: body
	Body struct {
		//in: body
		//required: true
		DestService string `json:"dest_service" validate:"dest_service"`
		//协议
		//in: body
		//required: true
		Protocol string `json:"protocol" validate:"protocol|between:tcp,http"`
		//规则体
		//in: body
		//required: true
		Rules *NetDownStreamRules `json:"rules" validate:"rules"`
	}
}

UpdateNetDownStreamRuleStruct UpdateNetDownStreamRuleStruct

type UpdatePluginStruct

type UpdatePluginStruct struct {
	// 租户名称
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name" validate:"tenant_env_name|required"`
	// 插件id
	// in: path
	// required: true
	PluginID string `json:"plugin_id" validate:"tenant_env_name|required"`
	// in: body
	Body struct {
		//插件名称
		//in: body
		//required: false
		PluginName string `json:"plugin_name" validate:"plugin_name"`
		//插件用途描述
		//in: body
		//required: false
		PluginInfo string `json:"plugin_info" validate:"plugin_info"`
		//插件docker地址
		//in: body
		//required: false
		ImageURL string `json:"image_url" validate:"image_url"`
		//git地址
		//in: body
		//required: false
		GitURL string `json:"git_url" validate:"git_url"`
		//构建模式
		//in: body
		//required: false
		BuildModel string `json:"build_model" validate:"build_model"`
		//插件模式
		//in: body
		//required: false
		PluginModel string `json:"plugin_model" validate:"plugin_model"`
	}
}

UpdatePluginStruct UpdatePluginStruct

type UpdateServiceMonitorRequestStruct

type UpdateServiceMonitorRequestStruct struct {
	// service_show_name
	// in: body
	// required: true
	ServiceShowName string `json:"service_show_name" validate:"service_show_name|required"`
	// port
	// in: body
	// required: true
	Port int `json:"port" validate:"port|required"`
	// path
	// in: body
	// required: true
	Path string `json:"path" validate:"path|required"`
	// interval
	// in: body
	// required: true
	Interval string `json:"interval" validate:"interval|required"`
}

UpdateServiceMonitorRequestStruct update service monitor request

type UpdateServiceSchedulingLabelRequest added in v1.10.0

type UpdateServiceSchedulingLabelRequest struct {
	Key   string `json:"label_key"`
	Value string `json:"label_value"`
}

type UpdateServiceSchedulingTolerationRequest added in v1.10.0

type UpdateServiceSchedulingTolerationRequest struct {
	Key      string `json:"taint_key"`
	Value    string `json:"taint_value"`
	Operator string `json:"op"`
	Effect   string `json:"effect"`
}

type UpdateServiceStruct

type UpdateServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// 容器启动命令
		// in: body
		// required: false
		ContainerCMD string `gorm:"column:container_cmd;size:2048" json:"container_cmd" validate:"container_cmd"`
		// 镜像名称
		// in: body
		// required: false
		ImageName string `gorm:"column:image_name;size:100" json:"image_name" validate:"image_name"`
		// 容器最大内存
		// in: body
		// required: false
		ContainerMemory int `gorm:"column:container_memory;default:128" json:"container_memory" validate:"container_memory"`
	}
}

UpdateServiceStruct service update swagger:parameters updateService

type UpdateTCPRuleStruct

type UpdateTCPRuleStruct struct {
	TCPRuleID      string                 `json:"tcp_rule_id" validate:"tcp_rule_id|required"`
	ServiceID      string                 `json:"service_id"`
	ContainerPort  int                    `json:"container_port"`
	IP             string                 `json:"ip"`
	Port           int                    `json:"port"`
	RuleExtensions []*RuleExtensionStruct `json:"rule_extensions"`
}

UpdateTCPRuleStruct is used to update tcp rule and rule extensions

type UpdateTenantEnvStruct added in v1.1.0

type UpdateTenantEnvStruct struct {
	//in: body
	Body struct {
		// the limit memory
		// in : body
		// required: false
		LimitMemory int `json:"limit_memory" validate:"limit_memory"`
	}
}

UpdateTenantEnvStruct UpdateTenantEnvStruct swagger:parameters updateTenantEnv

type UpdateVMPortGatewayRequest added in v1.7.0

type UpdateVMPortGatewayRequest struct {
	VMPortGateway `json:",inline"`
}

type UpdateVMRequest added in v1.7.0

type UpdateVMRequest struct {
	DisplayName        string   `json:"displayName"`
	Desc               string   `json:"desc"`
	RequestCPU         int64    `json:"requestCPU"`    // m
	RequestMemory      int64    `json:"requestMemory"` // GiB
	DefaultLoginUser   string   `json:"defaultLoginUser"`
	Operator           string   `json:"operator"`
	NodeSelectorLabels []string `json:"nodeSelectorLabels"`
}

UpdateVMRequest

type UpdateVMResponse added in v1.7.0

type UpdateVMResponse struct {
	VMProfile
}

UpdateVMResponse

type UpgradeServiceStruct

type UpgradeServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// the event id
		// in: body
		// required: false
		EventID string `json:"event_id"`
		// 版本号
		// in: body
		// required: true
		DeployVersion int `json:"deploy_version"`
		// 操作人员
		// in: body
		// required: false
		Operator int `json:"operator"`
	}
}

UpgradeServiceStruct UpgradeServiceStruct

type V1BuildServiceStruct

type V1BuildServiceStruct struct {
	// in: path
	// required: true
	ServiceID string `json:"service_id" validate:"service_id"`
	Body      struct {
		ServiceID     string `json:"service_id" validate:"service_id"`
		EventID       string `json:"event_id" validate:"event_id"`
		ENVS          string `json:"envs" validate:"envs"`
		Kind          string `json:"kind" validate:"kind"`
		Action        string `json:"action" validate:"action"`
		ImageURL      string `json:"image_url" validate:"image_url"`
		DeployVersion string `json:"deploy_version" validate:"deploy_version|required"`
		RepoURL       string `json:"repo_url" validate:"repo_url"`
		GitURL        string `json:"gitUrl" validate:"gitUrl"`
		Operator      string `json:"operator" validate:"operator"`
	}
}

V1BuildServiceStruct V1BuildServiceStruct

type V2AddVolumeDependencyStruct

type V2AddVolumeDependencyStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 依赖的服务id
		// in: body
		// required: true
		DependServiceID string `json:"depend_service_id"  validate:"depend_service_id|required"`
		// 挂载目录
		// in: body
		// required: true
		MntDir string `json:"mnt_dir" validate:"mnt_dir|required"`
		// 挂载容器内目录名称
		// in: body
		// required: true
		MntName string `json:"mnt_name" validate:"mnt_name|required"`
	}
}

V2AddVolumeDependencyStruct AddVolumeDependencyStruct

type V2AddVolumeStruct

type V2AddVolumeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 类型 "application;app_publish"
		// in: body
		// required: true
		Category string `json:"category"`
		// 容器挂载目录
		// in: body
		// required: true
		VolumePath string `json:"volume_path" validate:"volume_path|required|regex:^/"`
		// 宿主机挂载目录
		// in: body
		// required: true
		HostPath string `json:"host_path" validate:"volume_path|required|regex:^/"`
		//存储驱动名称
		VolumeProviderName string `json:"volume_provider_name"`
		// 存储大小
		VolumeCapacity int64 `json:"volume_capacity" validate:"volume_capacity|required|min:1"` // 单位Mi
		// AccessMode 读写模式(Important! A volume can only be mounted using one access mode at a
		AccessMode string `gorm:"column:access_mode" json:"access_mode"`
		// SharePolicy 共享模式
		SharePolicy string `gorm:"column:share_policy" json:"share_policy"`
		// BackupPolicy 备份策略
		BackupPolicy string `gorm:"column:backup_policy" json:"backup_policy"`
		// ReclaimPolicy 回收策略
		ReclaimPolicy string `json:"reclaim_policy"`
		// AllowExpansion 是否支持扩展
		AllowExpansion bool `gorm:"column:allow_expansion" json:"allow_expansion"`
	}
}

V2AddVolumeStruct AddVolumeStruct

type V2DelVolumeDependencyStruct

type V2DelVolumeDependencyStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 依赖的服务id
		// in: body
		// required: true
		DependServiceID string `json:"depend_service_id"  validate:"depend_service_id|required"`
	}
}

V2DelVolumeDependencyStruct V2DelVolumeDependencyStruct

type V2DelVolumeStruct

type V2DelVolumeStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	// in: body
	Body struct {
		// 类型 "application;app_publish"
		// in: body
		// required: true
		Category string `json:"category"`
		// 容器挂载目录
		// in: body
		// required: true
		VolumePath string `json:"volume_path" validate:"volume_path|required|regex:^/"`
	}
}

V2DelVolumeStruct AddVolumeStruct

type VMCondition added in v1.11.0

type VMCondition struct {
	Type           string `json:"type"`
	Reason         string `json:"reason"`
	Message        string `json:"message"`
	Status         bool   `json:"status"`
	LastReportedAt string `json:"lastReportedAt"`
}

type VMOSInfo added in v1.7.0

type VMOSInfo struct {
	Name          string `json:"name"`
	Version       string `json:"version"`
	Arch          string `json:"arch"`
	KernelRelease string `json:"kernelRelease"`
	KernelVersion string `json:"kernelVersion"`
}

type VMPort added in v1.7.0

type VMPort struct {
	VMPort         int             `json:"vmPort"`
	Protocol       VMPortProtocol  `json:"protocol"`
	InnerService   string          `json:"innerService"`
	GatewayEnabled bool            `json:"gatewayEnabled"`
	Gateways       []VMPortGateway `json:"gateways"`
}

type VMPortGateway added in v1.7.0

type VMPortGateway struct {
	GatewayID   string `json:"gatewayID"`
	GatewayIP   string `json:"gatewayIP"`
	GatewayPort int    `json:"gatewayPort"`
	GatewayHost string `json:"gatewayHost"`
	GatewayPath string `json:"gatewayPath"`
}

type VMPortProtocol added in v1.7.0

type VMPortProtocol string
const (
	VMPortProtocolHTTP  VMPortProtocol = "http"
	VMPortProtocolTCP   VMPortProtocol = "tcp"
	VMPortProtocolUDP   VMPortProtocol = "udp"
	VMPortProtocolSCTP  VMPortProtocol = "sctp"
	VMPortProtocolSSH   VMPortProtocol = "ssh"
	VMPortProtocolRDP   VMPortProtocol = "rdp"
	VMPortProtocolGrpc  VMPortProtocol = "grpc"
	VMPortProtocolMysql VMPortProtocol = "mysql"
)

type VMProfile added in v1.7.0

type VMProfile struct {
	Name               string        `json:"name"`
	DisplayName        string        `json:"displayName"`
	Desc               string        `json:"desc"`
	OSSourceFrom       OSSourceFrom  `json:"osSourceFrom"`
	OSSourceURL        string        `json:"osSourceURL"`
	OSDiskSize         int64         `json:"osDiskSize"`
	RequestCPU         int64         `json:"requestCPU"`    // m
	RequestMemory      int64         `json:"requestMemory"` // GiB
	Namespace          string        `json:"namespace"`
	DefaultLoginUser   string        `json:"defaultLoginUser"`
	Status             string        `json:"status"`
	StatusMessage      string        `json:"statusMessage"`
	Conditions         []VMCondition `json:"conditions"`
	IP                 string        `json:"ip"`
	OSInfo             VMOSInfo      `json:"osInfo"`
	ScheduleNode       string        `json:"scheduleNode"`
	CreatedAt          string        `json:"createdAt"`
	LastModifiedAt     string        `json:"lastModifiedAt"`
	CreatedBy          string        `json:"createdBy"`
	LastModifiedBy     string        `json:"lastModifiedBy"`
	NodeSelectorLabels []string      `json:"nodeSelectorLabels"`
}

type VMVolume added in v1.10.0

type VMVolume struct {
	VolumeName   string `json:"volumeName"`
	StorageClass string `json:"storageClass"`
	VolumeSize   int64  `json:"volumeSize"`
	Status       string `json:"status"`
}

type VersionEnv

type VersionEnv struct {
	//变量名
	//in:body
	//required: true
	EnvName string `json:"env_name" validate:"env_name"`
	//变量值
	//in:body
	//required: true
	EnvValue string `json:"env_value" validate:"env_value"`
}

VersionEnv VersionEnv

func (*VersionEnv) DbModel

func (v *VersionEnv) DbModel(componentID, pluginID string) *dbmodel.TenantEnvPluginVersionEnv

DbModel return database model

type VerticalServiceStruct

type VerticalServiceStruct struct {
	// in: path
	// required: true
	TenantEnvName string `json:"tenant_env_name"`
	// in: path
	// required: true
	ServiceAlias string `json:"service_alias"`
	//in: body
	Body struct {
		// the event id
		// in: body
		// required: false
		EventID string `json:"event_id"`
		// cpu申请
		// in: body
		// required: false
		ContainerRequestCPU int `json:"container_request_cpu"`
		// cpu数量
		// in: body
		// required: false
		ContainerCPU int `json:"container_cpu"`
		// 内存申请
		// in: body
		// required: false
		ContainerRequestMemory int `json:"container_request_memory"`
		// 内存大小
		// in: body
		// required: false
		ContainerMemory int `json:"container_memory"`
	}
}

VerticalServiceStruct VerticalServiceStruct

type VolumeRelation

type VolumeRelation struct {
	MountPath        string `json:"mount_path"`
	DependServiceID  string `json:"dep_service_id"`
	DependVolumeName string `json:"dep_volume_name"`
}

VolumeRelation -

func (*VolumeRelation) DbModel

func (v *VolumeRelation) DbModel(tenantEnvID, componentID, hostPath, volumeType string) *dbmodel.TenantEnvServiceMountRelation

DbModel return database model

func (*VolumeRelation) Key

func (v *VolumeRelation) Key() string

Key returns the key of VolumeRelation.

type VolumeTypePageStruct

type VolumeTypePageStruct struct {
}

VolumeTypePageStruct volume option struct with page

type VolumeTypeStruct

type VolumeTypeStruct struct {
	VolumeType         string                 `json:"volume_type" validate:"volume_type|required"`
	NameShow           string                 `json:"name_show"`
	CapacityValidation map[string]interface{} `json:"capacity_validation"`
	Description        string                 `json:"description"`
	AccessMode         []string               `json:"access_mode"`    // 读写模式(Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time. #https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
	SharePolicy        []string               `json:"share_policy"`   //共享模式
	BackupPolicy       []string               `json:"backup_policy"`  // 备份策略
	ReclaimPolicy      string                 `json:"reclaim_policy"` // 回收策略,delete, retain, recyle
	Provisioner        string                 `json:"provisioner"`    //存储提供方
	StorageClassDetail map[string]interface{} `json:"storage_class_detail" validate:"storage_class_detail|required"`
	Sort               int                    `json:"sort"`   // 排序
	Enable             bool                   `json:"enable"` // 是否生效
}

VolumeTypeStruct volume option struct

type VolumeWithStatusResp

type VolumeWithStatusResp struct {
	ServiceID string `json:"service_id"`
	//存储名称
	Status map[string]string `json:"status"`
}

VolumeWithStatusResp volume status

type VolumeWithStatusStruct

type VolumeWithStatusStruct struct {
	ServiceID string `json:"service_id"`
	//服务类型
	Category string `json:"category"`
	//存储类型(share,local,tmpfs)
	VolumeType string `json:"volume_type"`
	//存储名称
	VolumeName string `json:"volume_name"`
	//主机地址
	HostPath string `json:"host_path"`
	//挂载地址
	VolumePath string `json:"volume_path"`
	//是否只读
	IsReadOnly bool `json:"is_read_only"`
	// VolumeCapacity 存储大小
	VolumeCapacity int64 `json:"volume_capacity"`
	// AccessMode 读写模式(Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time. #https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
	AccessMode string `json:"access_mode"`
	// SharePolicy 共享模式
	SharePolicy string `json:"share_policy"`
	// BackupPolicy 备份策略
	BackupPolicy string `json:"backup_policy"`
	// ReclaimPolicy 回收策略
	ReclaimPolicy string `json:"reclaim_policy"`
	// AllowExpansion 是否支持扩展
	AllowExpansion bool `json:"allow_expansion"`
	// VolumeProviderName 使用的存储驱动别名
	VolumeProviderName string `json:"volume_provider_name"`
	Status             string `json:"status"`
}

VolumeWithStatusStruct volume with status struct

Jump to

Keyboard shortcuts

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