Documentation
¶
Index ¶
- func NewAppStatusFromExport(app *ExportAppStruct) *dbmodel.AppStatus
- func NewAppStatusFromImport(app *ImportAppStruct) *dbmodel.AppStatus
- type APIManager
- type AddDependencyStruct
- type AddEnvStruct
- type AddNodeLabelStruct
- type AddProbeStruct
- type AddServiceLabelStruct
- type AddServicePort
- type AddTenantServiceEnvVar
- type AddTenantStruct
- type AddVolumeDependencyStruct
- type AddVolumeStruct
- type Addition
- type AllPluginBuildVersionStruct
- type Attr
- type BaseEnv
- type BasePort
- type BaseService
- type BuildPluginStruct
- type BuildServiceStruct
- type CheckCodeStruct
- type CloudShareStruct
- type CommandResponse
- type ComposerStruct
- type ConfigEnvs
- type CreatePluginStruct
- type CreateServiceStruct
- type DataLog
- type DelTenantServiceEnvVar
- type DeleteDefineSourcesStruct
- type DeleteENVstruct
- type DeletePluginSetStruct
- type DeletePluginStruct
- type DeleteProbeStruct
- type DeleteServicePort
- type DeleteVolumeDependencyStruct
- type DeleteVolumeStruct
- type DependService
- type ENVStruct
- type ExportAppStruct
- type GetNetDownStreamRuleStruct
- type GetPluginEnvStruct
- type GetPluginSetStruct
- type GetPluginsStruct
- type GetServiceCheckInfoStruct
- type GetSingleServiceInfoStruct
- type GetSupportProtocols
- type GetTokenInfo
- type GetUserToken
- type GetVersionEnvStruct
- type HeaderRules
- type HorizontalServiceStruct
- type ImageShare
- type ImportAppStruct
- type Item
- type Labels
- type LanguageSet
- type LastLinesStruct
- type LicenseInfo
- type LogByLevelStruct
- type LogData
- type LogFileStruct
- type LogSocketStruct
- type Login
- type MQBody
- type MessageData
- type Model
- type MontiorData
- type MsgStruct
- type NetDownStreamRules
- type NetRulesDownStreamBody
- type NetUpStreamRules
- type PagedTenantResList
- type PluginBuildVersionStruct
- type PluginDefaultENV
- type PluginSetStruct
- type PodsList
- type PodsStructStruct
- type PublicShare
- type ResourceSpec
- type RollBackStruct
- type RollbackStruct
- type ServiceCheckStruct
- type ServiceGetCommon
- type ServiceImage
- type ServiceLBPortChange
- type ServicePortInnerOrOuter
- type ServicePorts
- type ServiceProbe
- type ServiceShare
- type ServiceSlug
- type ServiceStruct
- type ServicesInfoStruct
- type ServicesResources
- type SetDefineSourcesStruct
- type SetLanguageStruct
- type SetNetDownStreamRuleStruct
- type SetVersionEnv
- type ShareConfItems
- type SlugShare
- type SourceSpec
- type SoureBody
- type StartServiceStruct
- type StartStopStruct
- type StatsInfo
- type StatusList
- type StatusServiceListStruct
- type StatusServiceStruct
- type TenantLogByLevelStruct
- type TenantResList
- type TenantResource
- type TenantResources
- type TenantServiceVolume
- type TenantServicesPort
- type TokenInfo
- type TotalStatsInfo
- type TransPlugins
- type UpdateDefineSourcesStruct
- type UpdateNetDownStreamRuleStruct
- type UpdatePluginStruct
- type UpdateServiceStruct
- type UpdateToken
- type UpgradeServiceStruct
- type V1BuildServiceStruct
- type V2AddVolumeDependencyStruct
- type V2AddVolumeStruct
- type V2DelVolumeDependencyStruct
- type V2DelVolumeStruct
- type VersionEnv
- type VerticalServiceStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAppStatusFromExport ¶
func NewAppStatusFromExport(app *ExportAppStruct) *dbmodel.AppStatus
func NewAppStatusFromImport ¶
func NewAppStatusFromImport(app *ImportAppStruct) *dbmodel.AppStatus
Types ¶
type APIManager ¶
type APIManager struct {
//in: body
Body struct {
//api级别
//in: body
//required: true
ClassLevel string `json:"class_level" validate:"class_level|reqired"`
//uri前部
//in: body
//required: true
Prefix string `json:"prefix" validate:"prefix|required"`
//完整uri
//in: body
//required: false
URI string `json:"uri" validate:"uri"`
//别称
//in: body
//required: false
Alias string `json:"alias" validate:"alias"`
//补充信息
//in:body
//required: false
Remark string `json:"remark" validate:"remark"`
}
}
APIManager APIManager
type AddDependencyStruct ¶
type AddDependencyStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddEnvStruct ¶
type AddEnvStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddNodeLabelStruct ¶
type AddNodeLabelStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddProbeStruct ¶
type AddProbeStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddServiceLabelStruct ¶
type AddServiceLabelStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddServicePort ¶
type AddServicePort struct {
// in: path
// required: true
TenantName string `json:"tenant_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 AddTenantServiceEnvVar ¶
type AddTenantServiceEnvVar struct {
Model
TenantID string `validate:"tenant_id|between:30,33" json:"tenant_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|required" json:"env_value"`
IsChange bool `validate:"is_change|bool" json:"is_change"`
Scope string `validate:"scope|in:outer,inner,both" json:"scope"`
}
AddTenantServiceEnvVar 应用环境变量
type AddTenantStruct ¶
type AddTenantStruct struct {
//in: body
Body struct {
// 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"`
// the eid
// in : body
// required: false
Eid string `json:"eid" validata:"eid"`
Token string `json:"token" validate:"token"`
}
}
AddTenantStruct AddTenantStruct swagger:parameters addTenant
type AddVolumeDependencyStruct ¶
type AddVolumeDependencyStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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"`
}
}
AddVolumeDependencyStruct AddVolumeDependencyStruct
type AddVolumeStruct ¶
type AddVolumeStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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:share-file,local,memoryfs"`
// 存储名称(同一个应用唯一)
// in: body
// required: true
VolumeName string `json:"volume_name" validate:"volume_name|required|max:50"`
}
}
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
TenantName string `json:"tenant_name" validate:"tenant_name"`
//in: path
//required: true
PluginID string `json:"plugin_id" validate:"plugin_id"`
}
AllPluginBuildVersionStruct AllPluginBuildVersionStruct
type Attr ¶
type Attr struct {
Action string `json:"action"`
TenantID string `json:"tenant_id"`
ServiceID string `json:"service_id"`
AttrName string `json:"env_name"`
AttrValue string `json:"env_value"`
}
Attr attr
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 BuildPluginStruct ¶
type BuildPluginStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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"`
// 版本信息, 协助选择插件版本
// 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
TenantID string `json:"tenant_id" validate:"tenant_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"`
}
}
}
BuildPluginStruct BuildPluginStruct
type BuildServiceStruct ¶
type BuildServiceStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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"`
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"`
TenantName string `json:"tenant_name"`
ServiceAlias string `json:"service_alias"`
//用于云市代码包创建
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 CheckCodeStruct ¶
type CheckCodeStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantID string `json:"tenant_id" validate:"tenant_id"`
Action string `json:"action"`
// 应用id
// in: body
// required: true
ServiceID string `json:"service_id"`
}
}
CheckCodeStruct CheckCodeStruct
type CloudShareStruct ¶
type CloudShareStruct struct {
// required: true
TenantName string `json:"tenant_name"`
Body struct {
// 分享类型,app_slug/app_image
// in: body
// required: true
Kind string `json:"kind" validate:"kind|required|in:app_slug,app_image"`
Slug SlugShare
Image ImageShare
}
}
CloudShareStruct CloudShareStruct
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 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 ConfigEnvs ¶
type ConfigEnvs struct {
NormalEnvs []*VersionEnv `json:"normal_envs" validate:"normal_envs"`
ComplexEnvs *ResourceSpec `json:"complex_envs" validate:"complex_envs"`
}
ConfigEnvs Config
type CreatePluginStruct ¶
type CreatePluginStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantID string `json:"tenant_id" validate:"tenant_id"`
}
}
CreatePluginStruct CreatePluginStruct
type CreateServiceStruct ¶
type CreateServiceStruct struct {
// in: path
// required: true
TenantName string `gorm:"column:tenant_name;size:32" json:"tenant_name" validate:"tenant_name"`
// in:body
Body struct {
// 租户id
// in: body
// required: false
TenantID string `gorm:"column:tenant_id;size:32" json:"tenant_id" validate:"tenant_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 TenantServiceRelation
// in: body
// required: false
DependIDs []dbmodel.TenantServiceRelation `json:"depend_ids" validate:"depend_ids"`
// 持久化目录信息, 格式: []struct TenantServiceVolume
// in: body
// required: false
VolumesInfo []dbmodel.TenantServiceVolume `json:"volumes_info" validate:"volumes_info"`
// 环境变量信息, 格式: []struct TenantServiceEnvVar
// in: body
// required: false
EnvsInfo []dbmodel.TenantServiceEnvVar `json:"envs_info" validate:"envs_info"`
// 端口信息, 格式: []struct TenantServicesPort
// in: body
// required: false
PortsInfo []dbmodel.TenantServicesPort `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
ContainerCPU int `gorm:"column:container_cpu;default:500" json:"container_cpu" validate:"container_cpu"`
// 容器最大内存
// 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 DelTenantServiceEnvVar ¶
type DelTenantServiceEnvVar struct {
Model
TenantID string `validate:"tenant_id|between:30,33" json:"tenant_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" json:"scope"`
}
DelTenantServiceEnvVar 应用环境变量
type DeleteDefineSourcesStruct ¶
type DeleteDefineSourcesStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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
TenantName string `json:"tenant_name" validate:"tenant_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 DeletePluginSetStruct ¶
type DeletePluginSetStruct struct {
//in: path
//required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_name" validate:"tenant_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
TenantName string `json:"tenant_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 DeleteServicePort ¶
type DeleteServicePort struct {
// in: path
// required: true
TenantName string `json:"tenant_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 DeleteVolumeDependencyStruct ¶
type DeleteVolumeDependencyStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_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 {
TenantID string `json:"tenant_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 ENVStruct ¶
type ENVStruct struct {
// 租户名称
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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 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 rainbond-app/docker-compose
GroupMetadata string `json:"group_metadata"`
}
}
type GetNetDownStreamRuleStruct ¶
type GetNetDownStreamRuleStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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 GetPluginEnvStruct ¶
type GetPluginEnvStruct struct {
//租户名称
//in: path
//required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_name"`
//in: path
//required: true
ServiceAlias string `json:"service_alias"`
}
GetPluginSetStruct GetPluginSetStruct
type GetPluginsStruct ¶
type GetPluginsStruct struct {
//in: path
//required: true
TenantName string `json:"tenant_name"`
}
GetPluginsStruct GetPluginsStruct
type GetServiceCheckInfoStruct ¶
type GetServiceCheckInfoStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
UUID string `json:"uuid"`
}
GetServiceCheckInfoStruct 获取应用检测信息
type GetSingleServiceInfoStruct ¶
type GetSingleServiceInfoStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
}
GetSingleServiceInfoStruct GetSingleServiceInfoStruct
type GetSupportProtocols ¶
type GetSupportProtocols struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
}
GetSupportProtocols GetSupportProtocols swagger:parameters getSupportProtocols
type GetTokenInfo ¶
type GetTokenInfo struct {
// in: path
// required: true
EID string `json:"eid" validate:"eid|required"`
}
GetTokenInfo GetTokenInfo
type GetUserToken ¶
type GetUserToken struct {
// in: body
Body struct {
// eid
// in: body
// required: true
EID string `json:"eid" validate:"eid|required"`
// 可控范围:all_power|node_manager|server_source
// in: body
// required: false
Range string `json:"range" validate:"range"`
// 有效期
// in: body
// required: true
ValidityPeriod int `json:"validity_period" validate:"validity_period|required"` //1549812345
// 数据中心标识
// in: body
// required: false
RegionTag string `json:"region_tag" validate:"region_tag"`
BeforeTime int `json:"before_time"`
}
}
GetUserToken GetUserToken
type GetVersionEnvStruct ¶
type GetVersionEnvStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
// 插件id
// in: path
// required: true
PluginID string `json:"plugin_id"`
}
GetVersionEnvStruct GetVersionEnvStruct
type HeaderRules ¶
HeaderRules HeaderRules
type HorizontalServiceStruct ¶
type HorizontalServiceStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 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"`
}
type Item ¶
type Item struct {
Key string `json:"key" validate:"key"`
Value interface{} `json:"value" validate:"value"`
}
Item source值,键值对形式
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 LanguageSet ¶
LanguageSet set language
type LastLinesStruct ¶
type LastLinesStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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"`
Tenant int `json:"tenant"`
EndTime string `json:"end_time"`
StartTime string `json:"start_time"`
DataCenter int `json:"data_center"`
ModuleList []string `json:"module_list"`
}
LicenseInfo license info
type LogByLevelStruct ¶
type LogByLevelStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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 LogFileStruct ¶
type LogFileStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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
TenantName string `json:"tenant_name" validate:"tenant_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 rainbond-app/docker-compose
SourceDir string `json:"source_dir"`
}
func BuildMQBodyFrom ¶
func BuildMQBodyFrom(app *ExportAppStruct) *MQBody
type MessageData ¶
type MessageData struct {
Message string `json:"message"`
Time string `json:"time"`
Unixtime int64 `json:"utime"`
}
MessageData message data 获取指定操作的操作日志
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 PagedTenantResList ¶
type PagedTenantResList struct {
List []*TenantResource `json:"list"`
Length int `json:"length"`
}
PagedTenantResList PagedTenantResList
type PluginBuildVersionStruct ¶
type PluginBuildVersionStruct struct {
//in: path
//required: true
TenantName string `json:"tenant_name" validate:"tenant_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
TenantName string `json:"tenant_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 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
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
}
PodsStructStruct PodsStructStruct
type ResourceSpec ¶
type ResourceSpec struct {
BasePorts []*BasePort `json:"base_ports"`
BaseServices []*BaseService `json:"base_services"`
BaseNormal BaseEnv `json:"base_normal"`
}
ResourceSpec 资源结构体
type RollBackStruct ¶
type RollBackStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 RollbackStruct ¶
type RollbackStruct struct {
TenantID string `json:"tenant_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 ServiceCheckStruct ¶
type ServiceCheckStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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"`
// 检测来源定义,
// 代码: https://github.com/shurcooL/githubql.git master
// docker-run: docker run --name xxx nginx:latest nginx
// docker-compose: compose全文
// in: body
// required: true
SourceBody string `json:"source_body" validate:"source_body|required"`
TenantID string
EventID string `json:"event_id"`
}
}
ServiceCheckStruct 应用检测,支持源码检测,镜像检测,dockerrun检测
type ServiceGetCommon ¶
type ServiceGetCommon struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
}
ServiceGetCommon path参数
type ServiceImage ¶
type ServiceLBPortChange ¶
type ServiceLBPortChange struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_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"`
}
}
ServicePortInnerOrOuter service port swagger:parameters PortInnerController PortOuterController
type ServicePorts ¶
type ServicePorts struct {
Port []*TenantServicesPort
}
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"`
}
ServiceProbe 应用探针信息
type ServiceShare ¶
type ServiceShare struct {
// required: true
TenantName string `json:"tenant_name"`
// required: true
ServiceAlias string `json:"service_alias"`
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 ServiceStruct ¶
type ServiceStruct struct {
TenantID string `json:"tenant_id" validate:"tenant_id"`
// in: path
// required: true
ServiceID string `json:"service_id" validate:"service_id"`
// 服务key
// in: body
// required: false
ServiceKey string `json:"service_key" validate:"service_key"`
// 服务别名
// in: body
// required: true
ServiceAlias string `json:"service_alias" validate:"service_alias"`
// 服务描述
// 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
ContainerCPU int `json:"container_cpu" validate:"container_cpu"`
// 容器最大内存
// in: body
// required: false
ContainerMemory int `json:"container_memory" validate:"container_memory"`
// 容器启动命令
// in: body
// required: false
ContainerCMD string `json:"container_cmd" validate:"container_cmd"`
// 容器环境变量
// in: body
// required: false
ContainerEnv string `json:"container_env" validate:"container_env"`
// 卷名字
// in: body
// required: false
VolumePath string `json:"volume_path" validate:"volume_path"`
// 容器挂载目录
// in: body
// required: false
VolumeMountPath string `json:"volume_mount_path" validate:"volume_mount_path"`
// 宿主机目录
// in: body
// required: false
HostPath string `json:"host_path" validate:"host_path"`
// 扩容方式;0:无状态;1:有状态;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
ServiceType string `json:"service_type" validate:"service_type"`
// 镜像来源
// in: body
// required: false
Namespace string `json:"namespace" validate:"namespace"`
// 共享类型shared、exclusive
// in: body
// required: false
VolumeType string `json:"volume_type" validate:"volume_type"`
// 端口类型,one_outer;dif_protocol;multi_outer
// in: body
// required: false
PortType string `json:"port_type" validate:"port_type"`
// 更新时间
// 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"`
// 代码来源:gitlab,github
// in: body
// required: false
CodeFrom string `json:"code_from" validate:"code_from"`
Domain string `json:"domain" validate:"domain"`
ServiceLabel string `json:"service_label" validate:"service_label"`
NodeLabel string `json:"node_label" validate:"node_label"`
Operator string `json:"operator" validate:"operator"`
RepoURL string `json:"repo_url" validate:"repo_url"`
DependIDs []dbmodel.TenantServiceRelation `json:"depend_ids"`
VolumesInfo []dbmodel.TenantServiceVolume `json:"volumes_info"`
DepVolumesInfo []dbmodel.TenantServiceMountRelation `json:"dep_volumes_info"`
EnvsInfo []dbmodel.TenantServiceEnvVar `json:"envs_info"`
PortsInfo []dbmodel.TenantServicesPort `json:"ports_info"`
}
ServiceStruct service struct
type ServicesInfoStruct ¶
type ServicesInfoStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_name" validate:"tenant_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 SetLanguageStruct ¶
type SetLanguageStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
//in: body
Body struct {
// the tenant 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
TenantName string `json:"tenant_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 SetVersionEnv ¶
type SetVersionEnv struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
// 插件id
// in: path
// required: true
PluginID string `json:"plugin_id"`
//in: body
Body struct {
TenantID string `json:"tenant_id"`
ServiceID string `json:"service_id"`
// 环境变量
// in: body
// required: true
ConfigEnvs ConfigEnvs `json:"config_envs" validate:"config_envs"`
}
}
SetVersionEnv SetVersionEnv
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
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
//in: body
Body struct {
// the tenant id
// in: body
// required: false
EventID string `json:"event_id"`
}
}
StartServiceStruct StartServiceStruct
type StartStopStruct ¶
type StartStopStruct struct {
ServiceID string
TenantID string
DeployVersion string
EventID string
TaskType string
}
StartStopStruct start struct
type StatusList ¶
type StatusList struct {
TenantID string `json:"tenant_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"`
PodList []PodsList `json:"pod_list"`
}
StatusList status list
type StatusServiceListStruct ¶
type StatusServiceListStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_name"`
// in: path
// required: true
ServiceAlias string `json:"service_alias"`
}
StatusServiceStruct StatusServiceStruct
type TenantLogByLevelStruct ¶
type TenantLogByLevelStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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"`
}
}
TenantLogByLevelStruct GetTenantLogByLevelStruct
type TenantResList ¶
type TenantResList []*TenantResource
TenantResList TenantResList
func (TenantResList) Len ¶
func (list TenantResList) Len() int
func (TenantResList) Less ¶
func (list TenantResList) Less(i, j int) bool
func (TenantResList) Swap ¶
func (list TenantResList) Swap(i, j int)
type TenantResource ¶
type TenantResource struct {
AllocatedCPU int `json:"alloc_cpu"`
AllocatedMEM int `json:"alloc_memory"`
UsedCPU int `json:"used_cpu"`
UsedMEM int `json:"used_memory"`
Name string `json:"name"`
UUID string `json:"uuid"`
EID string `json:"eid"`
}
TenantResource path参数
type TenantResources ¶
type TenantResources struct {
// in: body
Body struct {
// in: body
// required: true
TenantNames []string `json:"tenant_name" validate:"tenant_name"`
}
}
TenantResources TenantResources swagger:parameters tenantResources
type TenantServiceVolume ¶
type TenantServiceVolume 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"`
}
TenantServiceVolume 应用持久化记录
type TenantServicesPort ¶
type TenantServicesPort struct {
Model
TenantID string `gorm:"column:tenant_id;size:32" validate:"tenant_id|between:30,33" json:"tenant_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"`
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"`
}
TenantServicesPort 应用端口信息
type TokenInfo ¶
type TokenInfo struct {
EID string `json:"eid"`
Token string `json:"token"`
CA string `json:"ca"`
Key string `json:"key"`
}
TokenInfo TokenInfo
type TotalStatsInfo ¶
type TotalStatsInfo struct {
Data []*StatsInfo `json:"data"`
}
TotalStatsInfo total stats info
type TransPlugins ¶
type TransPlugins struct {
// in: path
// required: true
TenantName string `json:"tenant_name"`
//in: body
Body struct {
// 从该租户安装
// in: body
// required: true
FromTenantName string `json:"from_tenant_name" validate:"from_tenant_name"`
// 插件id
// in: body
// required: true
PluginsID []string `json:"plugins_id" validate:"plugins_id"`
}
}
TransPlugins TransPlugins
type UpdateDefineSourcesStruct ¶
type UpdateDefineSourcesStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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 UpdateNetDownStreamRuleStruct ¶
type UpdateNetDownStreamRuleStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_name" validate:"tenant_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
TenantName string `json:"tenant_name" validate:"tenant_name|required"`
// 插件id
// in: path
// required: true
PluginID string `json:"plugin_id" validate:"tenant_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 UpdateServiceStruct ¶
type UpdateServiceStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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 UpdateToken ¶
type UpdateToken struct {
// in: path
// required: true
EID string `json:"eid" validate:"eid|required"`
//in: body
Body struct {
// 有效期
// in: body
// required: true
ValidityPeriod int `json:"validity_period" validate:"validity_period|required"` //1549812345
}
}
UpdateToken UpdateToken
type UpgradeServiceStruct ¶
type UpgradeServiceStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_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
TenantName string `json:"tenant_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:^/"`
}
}
V2AddVolumeStruct AddVolumeStruct
type V2DelVolumeDependencyStruct ¶
type V2DelVolumeDependencyStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
TenantName string `json:"tenant_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 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
type VerticalServiceStruct ¶
type VerticalServiceStruct struct {
// in: path
// required: true
TenantName string `json:"tenant_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
ContainerCPU int `json:"container_cpu"`
// 内存大小
// in: body
// required: false
ContainerMemory int `json:"container_memory"`
}
}
VerticalServiceStruct VerticalServiceStruct