model

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT 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 verifies whether the strategy is valid The strategy includes the following values: prestart starts first and then closes prestop is closed first and then started rollingupdate rolling form grayupdate gray form bluegreenupdate blue-green form

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 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 default operation task body

type DeleteTenantTaskBody

type DeleteTenantTaskBody struct {
	TenantID string `json:"tenant_id"`
}

DeleteTenantTaskBody -

type Dependence

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

Dependence dependency

type GroupStartTaskBody

type GroupStartTaskBody struct {
	Services    []StartTaskBody `json:"services"`
	Dependences []Dependence    `json:"dependences"`
	//Group startup strategy
	//Sequential start, disorderly concurrent start
	Strategy []string `json:"strategy"`
}

GroupStartTaskBody group application start operation task body

type GroupStopTaskBody

type GroupStopTaskBody struct {
	Services    []StartTaskBody `json:"services"`
	Dependences []Dependence    `json:"dependences"`
	//Group shutdown strategy
	//Sequence relationship, unordered concurrent close
	Strategy []string `json:"strategy"`
}

GroupStopTaskBody group application stops operating the task body

type HorizontalScalingTaskBody

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

HorizontalScalingTaskBody Horizontal scaling operation task body

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 {
	TenantID      string `json:"tenant_id"`
	ServiceID     string `json:"service_id"`
	DeployVersion string `json:"deploy_version"`
	EventID       string `json:"event_id"`
	//Restart policy, this policy is not guaranteed to take effect
	//For example, if the application is a stateful service, if this policy is configured to be started and then closed, this policy will not take effect
	//Stateless services are used by default to start and then close to ensure that the service is not affected
	Strategy []string          `json:"strategy"`
	Configs  map[string]string `json:"configs"`
}

RestartTaskBody restart operation task body

type RollBackTaskBody

type RollBackTaskBody struct {
	TenantID  string `json:"tenant_id"`
	ServiceID string `json:"service_id"`
	//current version
	CurrentDeployVersion string `json:"current_deploy_version"`
	//Roll back the target version
	OldDeployVersion string `json:"old_deploy_version"`
	EventID          string `json:"event_id"`
	//Restart policy, this policy is not guaranteed to take effect
	//For example, if the application is a stateful service, if this policy is configured to be started and then closed, this policy will not take effect
	//Stateless services are used by default to start and then close to ensure that the service is not affected
	//If you need to use rolling upgrades and other strategies, use multiple strategies
	Strategy []string `json:"strategy"`
}

RollBackTaskBody rollback operation task body

type RollingUpgradeTaskBody

type RollingUpgradeTaskBody struct {
	TenantID         string            `json:"tenant_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"`
}

RollingUpgradeTaskBody Upgrade operation task body

type ServiceGCTaskBody

type ServiceGCTaskBody struct {
	TenantID  string   `json:"tenant_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 {
	TenantID      string            `json:"tenant_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 starts the operation task body

type StopTaskBody

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

StopTaskBody stops the operation task body

type Task

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

Task 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 creates an entity through the type string

func NewTaskBody

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

NewTaskBody new task body

type TaskType

type TaskType string

TaskType task type

type VerticalScalingTaskBody

type VerticalScalingTaskBody struct {
	TenantID        string `json:"tenant_id"`
	ServiceID       string `json:"service_id"`
	ContainerCPU    *int   `json:"container_cpu"`
	ContainerMemory *int   `json:"container_memory"`
	ContainerGPU    *int   `json:"container_gpu"`
	EventID         string `json:"event_id"`
}

VerticalScalingTaskBody vertical scaling operation task body

Jump to

Keyboard shortcuts

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