Documentation
¶
Index ¶
- Variables
- func GenerateAgentToken() string
- func GetObjectPath(subFolder, name string) string
- func ListVMLabels(projectKey string, logger *zap.SugaredLogger) ([]string, error)
- func OfflineVM(idString, user string, logger *zap.SugaredLogger) error
- type AgentAccessCmd
- type AgentAccessCmds
- type AgentBriefListResp
- type AgentDetails
- type CreateVMRequest
- type HeartbeatParameters
- type HeartbeatRequest
- type HeartbeatResponse
- type ObjectConfig
- type PollingJobArgs
- type PollingJobResp
- type RecoveryAgentCmd
- type RegisterAgentParameters
- type RegisterAgentRequest
- type RegisterAgentResponse
- type ReportAgentJobResp
- type ReportJobArgs
- type UpgradeAgentCmd
- type VMJobGetterMap
- type VMJobStatusMap
- type VerifyAgentParameters
- type VerifyAgentRequest
- type VerifyAgentResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var VMJobStatus = VMJobStatusMap{}
Functions ¶
func GenerateAgentToken ¶
func GenerateAgentToken() string
GenerateAgentToken TODO: consider how to generate vm token
func GetObjectPath ¶
func ListVMLabels ¶
func ListVMLabels(projectKey string, logger *zap.SugaredLogger) ([]string, error)
Types ¶
type AgentAccessCmd ¶
type AgentAccessCmds ¶
type AgentAccessCmds struct {
LinuxPlatform *AgentAccessCmd `json:"linux_platform,omitempty"`
MacOSPlatform *AgentAccessCmd `json:"macos_platform,omitempty"`
WinPlatform *AgentAccessCmd `json:"windows_platform,omitempty"`
}
func GenerateAgentAccessCmds ¶
func GenerateAgentAccessCmds(vm *commonmodels.PrivateKey) (*AgentAccessCmds, error)
func GetAgentAccessCmd ¶
func GetAgentAccessCmd(vmID string, logger *zap.SugaredLogger) (*AgentAccessCmds, error)
type AgentBriefListResp ¶
type AgentBriefListResp struct {
Name string `json:"name"`
Label string `json:"label"`
Status string `json:"status"`
Error string `json:"error"`
Platform string `json:"platform"`
Architecture string `json:"architecture"`
IP string `json:"ip"`
}
func ListVMs ¶
func ListVMs(logger *zap.SugaredLogger) ([]*AgentBriefListResp, error)
type AgentDetails ¶
type AgentDetails struct {
Name string `json:"name"`
Description string `json:"description"`
Provider string `json:"provider"`
Tags []string `json:"tags"`
VMIP string `json:"ip"`
VMPort int `json:"port"`
VMUser string `json:"user"`
LoginHost bool `json:"login_host"`
SSHPrivateKey string `json:"ssh_private_key"`
ScheduleWorkflow bool `json:"schedule_workflow"`
Workspace string `json:"workspace"`
TaskConcurrency int `json:"task_concurrency"`
Status string `json:"status"`
Error string `json:"error"`
Platform string `json:"platform"`
Architecture string `json:"architecture"`
}
type CreateVMRequest ¶
type CreateVMRequest struct {
Name string `json:"name"`
Description string `json:"description"`
Provider string `json:"provider"`
Tags []string `json:"tags"`
VMIP string `json:"ip"`
VMPort int `json:"port"`
VMUser string `json:"user"`
LoginHost bool `json:"login_host"`
SSHPrivateKey string `json:"ssh_private_key"`
ScheduleWorkflow bool `json:"schedule_workflow"`
Workspace string `json:"workspace"`
TaskConcurrency int `json:"task_concurrency"`
}
func (*CreateVMRequest) Validate ¶
func (args *CreateVMRequest) Validate() error
type HeartbeatParameters ¶
type HeartbeatRequest ¶
type HeartbeatRequest struct {
Token string `json:"token"`
Parameters *HeartbeatParameters `json:"parameters"`
}
type HeartbeatResponse ¶
type HeartbeatResponse struct {
NeedOffline bool `json:"need_offline"`
NeedUpdateAgentVersion bool `json:"need_update_agent_version"`
AgentVersion string `json:"agent_version"`
ScheduleWorkflow bool `json:"schedule_workflow"`
WorkDir string `json:"work_dir"`
Concurrency int `json:"concurrency"`
CacheType string `json:"cache_type"`
CachePath string `json:"cache_path"`
Object ObjectConfig `json:"object"`
ServerURL string `json:"server_url"`
VmName string `json:"vm_name"`
Description string `json:"description"`
ZadigVersion string `json:"zadig_version"`
}
func Heartbeat ¶
func Heartbeat(args *HeartbeatRequest, logger *zap.SugaredLogger) (*HeartbeatResponse, error)
type ObjectConfig ¶
type ObjectConfig struct {
}
type PollingJobArgs ¶
type PollingJobArgs struct {
Token string `json:"token"`
}
type PollingJobResp ¶
type PollingJobResp struct {
ID string `json:"id"`
ProjectName string `json:"project_name"`
WorkflowName string `json:"workflow_name"`
TaskID int64 `json:"task_id"`
JobOriginName string `json:"job_origin_name"`
JobName string `json:"job_name"`
JobType string `json:"job_type"`
Status string `json:"status"`
JobCtx string `json:"job_ctx"`
}
func PollingAgentJob ¶
func PollingAgentJob(token string, retry int, logger *zap.SugaredLogger) (*PollingJobResp, error)
type RecoveryAgentCmd ¶
func RecoveryVM ¶
func RecoveryVM(idString, user string, logger *zap.SugaredLogger) (*RecoveryAgentCmd, error)
type RegisterAgentParameters ¶
type RegisterAgentParameters struct {
IP string `json:"ip"`
OS string `json:"os"`
Arch string `json:"arch"`
CurrentUser string `json:"current_user"`
MemTotal uint64 `json:"mem_total"`
UsedMem uint64 `json:"used_mem"`
CpuNum int `json:"cpu_num"`
DiskSpace uint64 `json:"disk_space"`
FreeDiskSpace uint64 `json:"free_disk_space"`
HostName string `json:"host_name"`
AgentVersion string `json:"agent_version"`
WorkDir string `json:"work_dir"`
}
type RegisterAgentRequest ¶
type RegisterAgentRequest struct {
Token string `json:"token"`
Parameters *RegisterAgentParameters `json:"parameters"`
}
func (*RegisterAgentRequest) Validate ¶
func (args *RegisterAgentRequest) Validate() error
type RegisterAgentResponse ¶
type RegisterAgentResponse struct {
Token string `json:"token"`
Description string `json:"description"`
VmName string `json:"vm_name"`
ScheduleWorkflow bool `json:"schedule_workflow"`
TaskConcurrency int `json:"task_concurrency"`
AgentVersion string `json:"agent_version"`
ZadigVersion string `json:"zadig_version"`
WorkDir string `json:"work_dir"`
}
func RegisterAgent ¶
func RegisterAgent(args *RegisterAgentRequest, logger *zap.SugaredLogger) (*RegisterAgentResponse, error)
type ReportAgentJobResp ¶
type ReportAgentJobResp struct {
JobID string `json:"job_id"`
JobStatus string `json:"job_status"`
}
func ReportAgentJob ¶
func ReportAgentJob(args *ReportJobArgs, logger *zap.SugaredLogger) (*ReportAgentJobResp, error)
type ReportJobArgs ¶
type UpgradeAgentCmd ¶
type UpgradeAgentCmd struct {
UpgradeCmd map[string]string `json:"upgrade_cmd"`
Upgrade bool `json:"upgrade"`
}
func UpgradeAgent ¶
func UpgradeAgent(idString, user string, logger *zap.SugaredLogger) (*UpgradeAgentCmd, error)
type VMJobGetterMap ¶
func (*VMJobGetterMap) AddGetter ¶
func (m *VMJobGetterMap) AddGetter(jobID string) bool
func (*VMJobGetterMap) RemoveGetter ¶
func (m *VMJobGetterMap) RemoveGetter(jobID string)
type VMJobStatusMap ¶
type VMJobStatusMap struct {
}
func (*VMJobStatusMap) Delete ¶
func (v *VMJobStatusMap) Delete(key string)
func (*VMJobStatusMap) Exists ¶
func (v *VMJobStatusMap) Exists(key string) bool
func (*VMJobStatusMap) Set ¶
func (v *VMJobStatusMap) Set(key string)
type VerifyAgentParameters ¶
type VerifyAgentRequest ¶
type VerifyAgentRequest struct {
Token string `json:"token"`
Parameters *VerifyAgentParameters `json:"parameters"`
}
type VerifyAgentResponse ¶
type VerifyAgentResponse struct {
Verified bool `json:"verified"`
}
func VerifyAgent ¶
func VerifyAgent(args *VerifyAgentRequest, logger *zap.SugaredLogger) (*VerifyAgentResponse, error)
Click to show internal directories.
Click to hide internal directories.