common

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UBUNTU                   = "UBUNTU"
	DEBIAN                   = "DEBIAN"
	CENTOS                   = "CENTOS"
	AGENT_NAMESPACE          = "cb-dragonfly"
	AGENT_CLUSTERROLE        = "cb-dragonfly-agent-clusterrole"
	AGENT_CLUSTERROLEBINDING = "cb-dragonfly-agent-clusterrolebinding"
	PULL_MECHANISM           = "pull"
)

Variables

This section is empty.

Functions

func ChangeSnapshotAgentHosts added in v0.7.1

func ChangeSnapshotAgentHosts(sourceIP, targetIP string, sshInfo *sshrun.SSHInfo) error

func CleanAgentInstall

func CleanAgentInstall(info AgentInstallInfo, sshInfo *sshrun.SSHInfo, osType *string, kubeClient *kubernetes.Clientset)

func DeleteAgent

func DeleteAgent(info AgentInstallInfo) (string, error)

DeleteAgent 에이전트 메타데이터 삭제

func DeleteAgentByUUID

func DeleteAgentByUUID(agentUUID string) error

DeleteAgentByUUID UUID 기준 에이전트 메타데이터 삭제

func GetAllFilesinPath

func GetAllFilesinPath(path string) ([]string, error)

func GetPackageName

func GetPackageName(path string) (string, error)

func ListAgent

func ListAgent() (map[string]AgentInfo, error)

ListAgent 에이전트 메타데이터 목록 조회

func MakeAgentUUID

func MakeAgentUUID(info AgentInstallInfo) string

func MakeAgentUUIDByInfo added in v0.6.7

func MakeAgentUUIDByInfo(info AgentInfo) string

func RestoreSnapshotAgent added in v0.7.1

func RestoreSnapshotAgent(sshInfo *sshrun.SSHInfo)

Types

type AgentHealth

type AgentHealth string

AgentHealth 에이전트 구동 상태 (정상, 비정상)

const (
	Healthy   AgentHealth = "healthy"
	Unhealthy AgentHealth = "unhealthy"
)

type AgentInfo

type AgentInfo struct {
	ServiceType           string `json:"service_type"`
	NsId                  string `json:"ns_id"`
	McisId                string `json:"mcis_id"`
	VmId                  string `json:"vm_id"`
	CspType               string `json:"cspType"`
	AgentType             string `json:"agent_type"`
	AgentState            string `json:"agent_state"`
	AgentHealth           string `json:"agent_health"`
	AgentUnhealthyRespCnt int    `json:"agent_unhealthy_resp_cnt"`
	PublicIp              string `json:"public_ip"`
	Mck8sId               string `json:"mck8s_id"`
}

AgentInfo 에이전트 상세 정보

func GetAgent

func GetAgent(info AgentInstallInfo) (*AgentInfo, error)

func GetAgentByUUID

func GetAgentByUUID(agentUUID string) (*AgentInfo, error)

GetAgentByUUID UUID 기준 에이전트 메타데이터 조회

func PutAgent

func PutAgent(info AgentInstallInfo, unHealthyRespCnt int, agentState AgentState, agentHealth AgentHealth) (string, AgentInfo, error)

PutAgent 에이전트 메타데이터 수정

type AgentInstallInfo

type AgentInstallInfo struct {
	NsId          string
	McisId        string
	VmId          string
	PublicIp      string
	UserName      string
	SshKey        string
	CspType       string
	Port          string
	ServiceType   string
	Mck8sId       string
	APIServerURL  string
	ServerCA      string
	ClientCA      string
	ClientKey     string
	ClientToken   string
	PrivateDomain bool
	IP            *string
}

type AgentState

type AgentState string

AgentState 에이전트 설치 상태 (설치, 제거)

const (
	Enable  AgentState = "enable"
	Disable AgentState = "disable"
)

type SnapshotAgentInstallInfo added in v0.7.1

type SnapshotAgentInstallInfo struct {
	BaseAgent AgentInstallInfo `json:"base"`
	NewAgent  AgentInstallInfo `json:"new"`
}

Jump to

Keyboard shortcuts

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