model

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StrategyIsValid

func StrategyIsValid(strategy []string, serviceDeployType string) bool

StrategyIsValid 验证策略是否有效 策略包括以下值: prestart 先启动后关闭 prestop 先关闭后启动 rollingupdate 滚动形式 grayupdate 灰度形式 bluegreenupdate 蓝绿形式

Types

type ApplyPluginConfigTaskBody

type ApplyPluginConfigTaskBody struct {
	ServiceID string `json:"service_id"`
	PluginID  string `json:"plugin_id"`
	EventID   string `json:"event_id"`
	//Action put delete
	Action string `json:"action"`
}

ApplyPluginConfigTaskBody apply plugin dynamic discover config

type ApplyRegistryAuthSecretTaskBody added in v1.1.0

type ApplyRegistryAuthSecretTaskBody struct {
	Action      string `json:"action"`
	TenantEnvID string `json:"tenant_env_id"`
	SecretID    string `json:"secret_id"`
	Domain      string `json:"domain"`
	Username    string `json:"username"`
	Password    string `json:"password"`
}

ApplyRegistryAuthSecretTaskBody contains information for ApplyRegistryAuthSecretTask

type ApplyRuleTaskBody

type ApplyRuleTaskBody struct {
	ServiceID   string            `json:"service_id"`
	EventID     string            `json:"event_id"`
	ServiceKind string            `json:"service_kind"`
	Action      string            `json:"action"`
	Port        int               `json:"port"`
	IsInner     bool              `json:"is_inner"`
	Limit       map[string]string `json:"limit"`
}

ApplyRuleTaskBody contains information for ApplyRuleTask

type DefaultTaskBody

type DefaultTaskBody map[string]interface{}

DefaultTaskBody 默认操作任务主体

type DeleteTenantEnvTaskBody added in v1.1.0

type DeleteTenantEnvTaskBody struct {
	TenantEnvID string `json:"tenant_env_id"`
}

DeleteTenantEnvTaskBody -

type Dependence

type Dependence struct {
	CurrentServiceID string `json:"current_service_id"`
	DependServiceID  string `json:"depend_service_id"`
}

Dependence 依赖关系

type ExportHelmChartOrK8sYamlTaskBody added in v1.1.0

type ExportHelmChartOrK8sYamlTaskBody struct {
	TenantEnvID string `json:"tenant_env_id"`
	ServiceID   string `json:"service_id"`
	// EventID     string `json:"event_id"`
	// Configs     map[string]string `json:"configs"`
	AppName    string `json:"app_name"`
	AppVersion string `json:"app_version"`
	End        bool   `json:"end"`
}

type GroupStartTaskBody

type GroupStartTaskBody struct {
	Services    []StartTaskBody `json:"services"`
	Dependences []Dependence    `json:"dependences"`
	//组启动策略
	//顺序启动,无序并发启动
	Strategy []string `json:"strategy"`
}

GroupStartTaskBody 组应用启动操作任务主体

type GroupStopTaskBody

type GroupStopTaskBody struct {
	Services    []StartTaskBody `json:"services"`
	Dependences []Dependence    `json:"dependences"`
	//组关闭策略
	//顺序关系,无序并发关闭
	Strategy []string `json:"strategy"`
}

GroupStopTaskBody 组应用停止操作任务主体

type HorizontalScalingTaskBody

type HorizontalScalingTaskBody struct {
	TenantEnvID string `json:"tenant_env_id"`
	ServiceID   string `json:"service_id"`
	Replicas    int32  `json:"replicas"`
	EventID     string `json:"event_id"`
	Username    string `json:"username"`
}

HorizontalScalingTaskBody 水平伸缩操作任务主体

type RefreshHPATaskBody

type RefreshHPATaskBody struct {
	ServiceID string `json:"service_id"`
	RuleID    string `json:"rule_id"`
	EventID   string `json:"eventID"`
}

RefreshHPATaskBody -

type RestartTaskBody

type RestartTaskBody struct {
	TenantEnvID   string `json:"tenant_env_id"`
	ServiceID     string `json:"service_id"`
	DeployVersion string `json:"deploy_version"`
	EventID       string `json:"event_id"`
	//重启策略,此策略不保证生效
	//例如应用如果为有状态服务,此策略如配置为先启动后关闭,此策略不生效
	//无状态服务默认使用先启动后关闭,保证服务不受影响
	Strategy []string          `json:"strategy"`
	Configs  map[string]string `json:"configs"`
}

RestartTaskBody 重启操作任务主体

type RollBackTaskBody

type RollBackTaskBody struct {
	TenantEnvID string `json:"tenant_env_id"`
	ServiceID   string `json:"service_id"`
	//当前版本
	CurrentDeployVersion string `json:"current_deploy_version"`
	//回滚目标版本
	OldDeployVersion string `json:"old_deploy_version"`
	EventID          string `json:"event_id"`
	//重启策略,此策略不保证生效
	//例如应用如果为有状态服务,此策略如配置为先启动后关闭,此策略不生效
	//无状态服务默认使用先启动后关闭,保证服务不受影响
	//如需使用滚动升级等策略,使用多策略方式
	Strategy []string `json:"strategy"`
}

RollBackTaskBody 回滚操作任务主体

type RollingUpgradeTaskBody

type RollingUpgradeTaskBody struct {
	TenantEnvID      string            `json:"tenant_env_id"`
	ServiceID        string            `json:"service_id"`
	NewDeployVersion string            `json:"deploy_version"`
	EventID          string            `json:"event_id"`
	Strategy         []string          `json:"strategy"`
	Configs          map[string]string `json:"configs"`
	DryRun           bool              `json:"dry_run"`
	AppName          string            `json:"app_name"`
	AppVersion       string            `json:"app_version"`
	EventIDs         []string          `json:"event_ids"`
	End              bool              `json:"end"`
}

RollingUpgradeTaskBody 升级操作任务主体

type ServiceGCTaskBody

type ServiceGCTaskBody struct {
	TenantEnvID string   `json:"tenant_env_id"`
	ServiceID   string   `json:"service_id"`
	EventIDs    []string `json:"event_ids"`
}

ServiceGCTaskBody holds the request body to execute service gc task.

type StartTaskBody

type StartTaskBody struct {
	TenantEnvID   string            `json:"tenant_env_id"`
	ServiceID     string            `json:"service_id"`
	DeployVersion string            `json:"deploy_version"`
	EventID       string            `json:"event_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"`
}

StartTaskBody 启动操作任务主体

type StopTaskBody

type StopTaskBody struct {
	TenantEnvID   string            `json:"tenant_env_id"`
	ServiceID     string            `json:"service_id"`
	DeployVersion string            `json:"deploy_version"`
	EventID       string            `json:"event_id"`
	Configs       map[string]string `json:"configs"`
}

StopTaskBody 停止操作任务主体

type Task

type Task struct {
	Type       TaskType  `json:"type"`
	Body       TaskBody  `json:"body"`
	CreateTime time.Time `json:"time,omitempty"`
	User       string    `json:"user"`
}

Task 任务

func NewTask

func NewTask(data []byte) (*Task, error)

NewTask 从json bytes data create task

func TransTask

func TransTask(task *pb.TaskMessage) (*Task, error)

TransTask transtask

type TaskBody

type TaskBody interface{}

TaskBody task body

func CreateTaskBody

func CreateTaskBody(taskType string) TaskBody

CreateTaskBody 通过类型串创建实体

func NewTaskBody

func NewTaskBody(taskType string, body []byte) TaskBody

NewTaskBody new task body

type TaskType

type TaskType string

TaskType 任务类型

type VerticalScalingTaskBody

type VerticalScalingTaskBody struct {
	TenantEnvID      string  `json:"tenant_env_id"`
	ServiceID        string  `json:"service_id"`
	ContainerCPU     *int    `json:"container_cpu"`
	ContainerMemory  *int    `json:"container_memory"`
	ContainerGPUType *string `json:"container_gpu_type"`
	ContainerGPU     *int    `json:"container_gpu"`
	EventID          string  `json:"event_id"`
}

VerticalScalingTaskBody 垂直伸缩操作任务主体

Jump to

Keyboard shortcuts

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