model

package
v0.0.0-...-a4ebe3d Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RUN = iota + 1
	RETRY
	ROLLBACK
	CANCEL
	PASS

	RUN_STR      = "RUN"
	RETRY_STR    = "RETRY"
	ROLLBACK_STR = "ROLLBACK"
	CANCEL_STR   = "CANCEL"
	PASS_STR     = "PASS"
)
View Source
const (
	PENDING = iota + 1
	READY
	RUNNING
	FAILED
	SUCCEED

	PENDING_STR = "PENDING"
	READY_STR   = "READY"
	RUNNING_STR = "RUNNING"
	FAILED_STR  = "FAILED"
	SUCCEED_STR = "SUCCEED"
)

State

View Source
const (
	TASK_NAME_UPDATE_CONFIG    = "Update cluster config"
	TASK_NAME_UPDATE_OB_CONFIG = "Update observer config"

	DAG_INIT_CLUSTER   = "Initialize cluster"
	DAG_JOIN_TO_MASTER = "Join to master"
	DAG_JOIN_SELF      = "Join self"
)

Variables

Functions

func GetFailedDagLastLog

func GetFailedDagLastLog(currentDag *DagDetailDTO) (res []string)

Types

type AdditionalDataDTO

type AdditionalDataDTO struct {
	AdditionalData *map[string]any `json:"additional_data"`
}

type AgentIdentity

type AgentIdentity string
const (
	MASTER             AgentIdentity = "MASTER"
	FOLLOWER           AgentIdentity = "FOLLOWER"
	SINGLE             AgentIdentity = "SINGLE"
	CLUSTER_AGENT      AgentIdentity = "CLUSTER AGENT"
	TAKE_OVER_MASTER   AgentIdentity = "TAKE OVER MASTER"
	TAKE_OVER_FOLLOWER AgentIdentity = "TAKE OVER FOLLOWER"
	SCALING_OUT        AgentIdentity = "SCALING OUT"
	UNIDENTIFIED       AgentIdentity = "UNIDENTIFIED"
)

type AgentInfo

type AgentInfo struct {
	Ip   string `json:"ip" form:"ip" binding:"required"`
	Port int    `json:"port" form:"port" binding:"required"`
}

func (*AgentInfo) String

func (agent *AgentInfo) String() string

type AgentInfoWithIdentity

type AgentInfoWithIdentity struct {
	AgentInfo
	Identity AgentIdentity `json:"identity" binding:"required"`
}

type AgentInstance

type AgentInstance struct {
	AgentInfo
	Zone     string        `json:"zone" binding:"required"`
	Identity AgentIdentity `json:"identity" binding:"required"`
	Version  string        `json:"version"`
}

type AgentRunStatus

type AgentRunStatus struct {
	Pid      int    `json:"pid"`
	State    int32  `json:"state"`
	StartAt  int64  `json:"startAt"`
	HomePath string `json:"homePath"`
	AgentInstance
	SupportedAuth []string `json:"supportedAuth"`
}

type AgentStatus

type AgentStatus struct {
	Agent AgentInfoWithIdentity `json:"agent"`
	// service state
	State int32 `json:"state"`
	// service version
	Version string `json:"version"`
	// service pid
	Pid int `json:"pid"`
	// timestamp when service started
	StartAt int64 `json:"startAt"`
	// Ports process occupied ports
	OBState          int  `json:"obState"`
	UnderMaintenance bool `json:"underMaintenance"`
}

type CdbObBackupTask

type CdbObBackupTask struct {
	TenantID              int64     `json:"tenant_id"`
	TaskID                int64     `json:"task_id"`
	JobID                 int64     `json:"job_id"`
	Incarnation           int64     `json:"incarnation"`
	BackupSetID           int64     `json:"backup_set_id"`
	StartTimestamp        time.Time `json:"start_timestamp"`
	EndTimestamp          time.Time `json:"end_timestamp"`
	Status                string    `json:"status"`
	StartScn              int64     `json:"start_scn"`
	EndScn                int64     `json:"end_scn"`
	UserLsStartScn        int64     `json:"user_ls_start_scn"`
	EncryptionMode        string    `json:"encryption_mode"`
	InputBytes            int64     `json:"input_bytes"`
	OutputBytes           int64     `json:"output_bytes"`
	OutputRateBytes       float64   `json:"output_rate_bytes"`
	ExtraMetaBytes        int64     `json:"extra_meta_bytes"`
	TabletCount           int64     `json:"tablet_count"`
	FinishTabletCount     int64     `json:"finish_tablet_count"`
	MacroBlockCount       int64     `json:"macro_block_count"`
	FinishMacroBlockCount int64     `json:"finish_macro_block_count"`
	FileCount             int64     `json:"file_count"`
	MetaTurnID            int64     `json:"meta_turn_id"`
	DataTurnID            int64     `json:"data_turn_id"`
	Result                int64     `json:"result"`
	Comment               string    `json:"comment"`
	Path                  string    `json:"path"`
}

type ClusterConfig

type ClusterConfig struct {
	ClusterID   int                        `json:"id"`
	ClusterName string                     `json:"name"`
	Version     string                     `json:"version"`
	ZoneConfig  map[string][]*ServerConfig `json:"topology"`
}

type DagDetail

type DagDetail struct {
	DagID    int64  `json:"dag_id" uri:"dag_id"`
	Name     string `json:"name"`
	Stage    int    `json:"stage"`
	MaxStage int    `json:"max_stage"`
	TaskStatusDTO
	AdditionalDataDTO
	Nodes []*NodeDetailDTO `json:"nodes"`
}

type DagDetailDTO

type DagDetailDTO struct {
	*GenericDTO
	*DagDetail
}

type GenericDTO

type GenericDTO struct {
	GenericID string `json:"id" uri:"id" binding:"required"`
}

type GitInfo

type GitInfo struct {
	GitBranch        string `json:"branch"`
	GitCommitId      string `json:"commitId"`
	GitShortCommitId string `json:"shortCommitId"`
	GitCommitTime    string `json:"commitTime"`
}

type NodeDetail

type NodeDetail struct {
	NodeID int64  `json:"node_id" uri:"node_id"`
	Name   string `json:"name"`
	TaskStatusDTO
	AdditionalDataDTO
	SubTasks []*TaskDetailDTO `json:"sub_tasks"`
}

type NodeDetailDTO

type NodeDetailDTO struct {
	*GenericDTO
	*NodeDetail
}

type ObInfoResp

type ObInfoResp struct {
	Agents []AgentInstance `json:"agent_info"`
	Config ClusterConfig   `json:"obcluster_info"`
}

type ParameterInfo

type ParameterInfo struct {
	Name      string `json:"name"`
	Value     string `json:"value"`
	DataType  string `json:"data_type"`
	Info      string `json:"info"`
	EditLevel string `json:"edit_level"`
}

type RecycledTenantOverView

type RecycledTenantOverView struct {
	Name         string `json:"object_name"`
	OriginalName string `json:"original_tenant_name"`
	CanUndrop    string `json:"can_undrop"`
	CanPurge     string `json:"can_purge"`
}

type ResourcePoolInfo

type ResourcePoolInfo struct {
	Name         string `json:"name"`
	Id           int    `json:"id"`
	ZoneList     string `json:"zone_list"`
	UnitNum      int    `json:"unit_num"`
	UnitConfigId int    `json:"unit_config_id"`
	TenantId     int    `json:"tenant_id"`
}

type ResourcePoolWithUnit

type ResourcePoolWithUnit struct {
	Name     string              `json:"pool_name"`
	Id       int                 `json:"pool_id"`
	ZoneList string              `json:"zone_list"`
	UnitNum  int                 `json:"unit_num"`
	Unit     *ResourceUnitConfig `json:"unit_config"`
}

type ResourceUnitConfig

type ResourceUnitConfig struct {
	GmtCreate    time.Time `json:"create_time"`
	GmtModified  time.Time `json:"modify_time"`
	UnitConfigId int       `json:"unit_config_id"`
	Name         string    `json:"name"`
	MaxCpu       float64   `json:"max_cpu"`
	MinCpu       float64   `json:"min_cpu"`
	MemorySize   int       `json:"memory_size"`
	LogDiskSize  int       `json:"log_disk_size"`
	MaxIops      int       `json:"max_iops"`
	MinIops      int       `json:"min_iops"`
}

type RestoreInfo

type RestoreInfo struct {
	TenantId          int64  `json:"tenant_id"`
	JobID             int64  `json:"job_id"`
	RestoreTenantName string `json:"restore_tenant_name"`
	RestoreTenantId   int64  `json:"restore_tenant_id"`
	BackupTenantName  string `json:"backup_tenant_name"`
	BackupTenantId    int64  `json:"backup_tenant_id"`
	BackupClusterName string `json:"backup_cluster_name"`
	BackupDest        string `json:"backup_dest"`

	RestoreOption     string `json:"restore_option"`
	RestoreScn        int64  `json:"restore_scn"`
	RestoreScnDisplay string `json:"restore_scn_display"`

	Status         string `json:"status"`
	StartTimestamp string `json:"start_timestamp"`

	BackupSetList   string `json:"backup_set_list"`
	BackupPieceList string `json:"backup_piece_list"`

	TabletCount        int64  `json:"tablet_count"`
	TotalBytes         int64  `json:"total_bytes"`
	Description        string `json:"description"`
	FinishTabletCount  int64  `json:"finish_tablet_count"`
	FinishBytes        int64  `json:"finish_bytes"`
	FinishBytesDisplay string `json:"finish_bytes_display"`
	TotalBytesDisplay  string `json:"total_bytes_display"`
}

type RestoreOverview

type RestoreOverview struct {
	RestoreInfo

	RecoverScn        int64  `json:"recover_scn"`
	RecoverScnDisplay string `json:"recover_scn_display"`
	RecoverProgress   string `json:"recover_progress"`
	RestoreProgress   string `json:"restore_progress"`

	BackupClusterVersion int    `json:"backup_cluster_version"`
	LsCount              int    `json:"ls_count"`
	FinishLsCount        int    `json:"finish_ls_count"`
	Comment              string `json:"comment"`
	FinishTimestamp      string `json:"finish_timestamp"`
}

type Scope

type Scope struct {
	Type   string   `json:"type"`
	Target []string `json:"target"`
}

type ServerConfig

type ServerConfig struct {
	SvrIP        string `json:"svr_ip"`
	SvrPort      int    `json:"svr_port"`
	SqlPort      int    `json:"sql_port"`
	AgentPort    int    `json:"agent_port"`
	WithRootSvr  string `json:"with_rootserver"`
	Status       string `json:"status"`
	BuildVersion string `json:"build_version"`
}

type TaskDetail

type TaskDetail struct {
	TaskID int64  `json:"task_id" uri:"task_id"`
	Name   string `json:"name"`
	TaskStatusDTO
	AdditionalDataDTO
	ExecuteTimes int       `json:"execute_times"`
	ExecuteAgent AgentInfo `json:"execute_agent"`
	TaskLogs     []string  `json:"task_logs"`
}

type TaskDetailDTO

type TaskDetailDTO struct {
	*GenericDTO
	*TaskDetail
}

type TaskStatusDTO

type TaskStatusDTO struct {
	State     string    `json:"state"`
	Operator  string    `json:"operator"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
}

func (*TaskStatusDTO) IsCancel

func (t *TaskStatusDTO) IsCancel() bool

func (*TaskStatusDTO) IsFailed

func (t *TaskStatusDTO) IsFailed() bool

func (*TaskStatusDTO) IsFinished

func (t *TaskStatusDTO) IsFinished() bool

func (*TaskStatusDTO) IsPass

func (t *TaskStatusDTO) IsPass() bool

func (*TaskStatusDTO) IsPending

func (t *TaskStatusDTO) IsPending() bool

func (*TaskStatusDTO) IsReady

func (t *TaskStatusDTO) IsReady() bool

func (*TaskStatusDTO) IsRetry

func (t *TaskStatusDTO) IsRetry() bool

func (*TaskStatusDTO) IsRollback

func (t *TaskStatusDTO) IsRollback() bool

func (*TaskStatusDTO) IsRun

func (t *TaskStatusDTO) IsRun() bool

func (*TaskStatusDTO) IsRunning

func (t *TaskStatusDTO) IsRunning() bool

func (*TaskStatusDTO) IsSucceed

func (t *TaskStatusDTO) IsSucceed() bool

type TenantInfo

type TenantInfo struct {
	TenantOverview
	Charset   string                  `json:"charset"`   // Only for ORACLE tenant
	Collation string                  `json:"collation"` // Only for ORACLE tenant
	WhiteList string                  `json:"whitelist"`
	Pools     []*ResourcePoolWithUnit `json:"pools"`
}

type TenantOverview

type TenantOverview struct {
	Name         string    `json:"tenant_name"`
	Id           int       `json:"tenant_id"`
	CreatedTime  time.Time `json:"created_time"`
	Mode         string    `json:"mode"`
	Status       string    `json:"status"`
	Locked       string    `json:"locked"`
	PrimaryZone  string    `json:"primary_zone"`
	Locality     string    `json:"locality"`
	InRecyclebin string    `json:"in_recyclebin"`
}

type VariableInfo

type VariableInfo struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Info  string `json:"info"`
}

Jump to

Keyboard shortcuts

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