Documentation ¶
Index ¶
- Constants
- func CMDExecWrapper(cmd *exec.Cmd, output *bytes.Buffer) error
- type AnkaCLI
- func (ac *AnkaCLI) ActivateLicense(licenseKey string) error
- func (ac *AnkaCLI) EnsureAnkaBin() error
- func (ac *AnkaCLI) Exec(vmID string, command []string) error
- func (ac *AnkaCLI) PullImage(vmTemplateID string) error
- func (ac *AnkaCLI) Show(vmID string) (VMShowOutput, error)
- func (ac *AnkaCLI) Start(vmId string) (VMStartOutput, error)
- func (ac *AnkaCLI) Stop(vmId string) (VMStopOutput, error)
- func (ac *AnkaCLI) ValidateLicense() error
- type AnkaRegistryClient
- type CommandExecutor
- type DeleteVMBody
- type MacRuntime
- func (m *MacRuntime) ContainerStatus(unitName, unitImage string) (*api.UnitStatus, error)
- func (m *MacRuntime) CreateContainer(unit api.Unit, spec *api.PodSpec, podName string, ...) (*api.UnitStatus, error)
- func (m *MacRuntime) GetLogBuffer(options runtime.LogOptions) (*logbuf.LogBuffer, error)
- func (m *MacRuntime) GetPid(unitName string) (int, bool)
- func (m *MacRuntime) RemoveContainer(unit *api.Unit) error
- func (m *MacRuntime) RemovePodSandbox(spec *api.PodSpec) error
- func (m *MacRuntime) RunPodSandbox(spec *api.PodSpec) error
- func (m *MacRuntime) SetPodNetwork(netNS, podIP string)
- func (m *MacRuntime) StartContainer(unit api.Unit, spec *api.PodSpec, podName string) (*api.UnitStatus, error)
- func (m *MacRuntime) StopPodSandbox(spec *api.PodSpec) error
- func (m *MacRuntime) UnitRunning(unitName string) bool
- type RegistryClient
- type StartVMBody
- type StartVMResp
- type VMCreateOutput
- type VMInfo
- type VMInfoBase
- type VMPullOutput
- type VMRespBase
- type VMRunOutput
- type VMShowBody
- type VMShowOutput
- type VMStartOutput
- type VMStatusBody
- type VMStatusEmptyResp
- type VMStatusResp
- type VMStopOutput
Constants ¶
View Source
const ( AnkaStatusFail = "FAIL" AnkaStatusError = "ERROR" AnkaStatusOK = "OK" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnkaCLI ¶
type AnkaCLI struct {
// contains filtered or unexported fields
}
func NewAnkaCLI ¶
func NewAnkaCLI(executor CommandExecutor) *AnkaCLI
func (*AnkaCLI) ActivateLicense ¶
func (*AnkaCLI) EnsureAnkaBin ¶
func (*AnkaCLI) ValidateLicense ¶
type AnkaRegistryClient ¶
type AnkaRegistryClient struct{}
func NewAnkaRegistryClient ¶
func NewAnkaRegistryClient() *AnkaRegistryClient
func (*AnkaRegistryClient) GetVMTemplate ¶
func (cc *AnkaRegistryClient) GetVMTemplate(vmTemplateUrl string) (string, error)
type DeleteVMBody ¶
type DeleteVMBody struct {
VMID string `json:"id"`
}
type MacRuntime ¶
type MacRuntime struct { metrics.AnkaMetricsProvider UnitsVMIDs *sync.Map // contains filtered or unexported fields }
func NewMacRuntime ¶
func NewMacRuntime(registryClient RegistryClient) *MacRuntime
func (*MacRuntime) ContainerStatus ¶
func (m *MacRuntime) ContainerStatus(unitName, unitImage string) (*api.UnitStatus, error)
func (*MacRuntime) CreateContainer ¶
func (m *MacRuntime) CreateContainer(unit api.Unit, spec *api.PodSpec, podName string, registryCredentials map[string]api.RegistryCredentials, useOverlayfs bool) (*api.UnitStatus, error)
func (*MacRuntime) GetLogBuffer ¶
func (m *MacRuntime) GetLogBuffer(options runtime.LogOptions) (*logbuf.LogBuffer, error)
func (*MacRuntime) RemoveContainer ¶
func (m *MacRuntime) RemoveContainer(unit *api.Unit) error
func (*MacRuntime) RemovePodSandbox ¶
func (m *MacRuntime) RemovePodSandbox(spec *api.PodSpec) error
func (*MacRuntime) RunPodSandbox ¶
func (m *MacRuntime) RunPodSandbox(spec *api.PodSpec) error
func (*MacRuntime) SetPodNetwork ¶
func (m *MacRuntime) SetPodNetwork(netNS, podIP string)
func (*MacRuntime) StartContainer ¶
func (m *MacRuntime) StartContainer(unit api.Unit, spec *api.PodSpec, podName string) (*api.UnitStatus, error)
func (*MacRuntime) StopPodSandbox ¶
func (m *MacRuntime) StopPodSandbox(spec *api.PodSpec) error
func (*MacRuntime) UnitRunning ¶
func (m *MacRuntime) UnitRunning(unitName string) bool
type RegistryClient ¶
type StartVMBody ¶
type StartVMBody struct { VMID string `json:"vmid"` Tag string `json:"tag,omitempty"` Count int `json:"count,omitempty"` Name string `json:"name,omitempty"` CPU int `json:"vpcu,omitempty"` RAM int `json:"vram,omitempty"` NodeID string `json:"node_id,omitempty"` NameTemplate string `json:"name_template,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
type StartVMResp ¶
type StartVMResp struct { VMRespBase IDs []string `json:"body"` }
type VMCreateOutput ¶
type VMCreateOutput struct { VMRespBase Body VMInfoBase `json:"body"` }
type VMInfo ¶
type VMInfo struct { VMInfoBase NodeID string `json:"node_id"` CpuCores int `json:"cpu_cores"` IP string `json:"ip"` Status string `json:"status"` }
type VMInfoBase ¶
type VMInfoBase struct {
UUID string `json:"uuid"`
}
type VMPullOutput ¶
type VMPullOutput struct {
VMRespBase `json:",inline"`
}
type VMRespBase ¶
type VMRunOutput ¶
type VMRunOutput struct {
VMRespBase `json:",inline"`
}
type VMShowBody ¶
type VMShowBody struct { VMRespBase Name string `json:"name"` CreationDate string `json:"creation_date"` CPUCores int `json:"cpu_cores"` CPUFrequency int `json:"cpu_frequency"` CPUHtt bool `json:"cpu_htt"` RAM string `json:"ram"` RAMSize int `json:"ram_size"` FrameBuffers int `json:"frame_buffers"` HardDrive int `json:"hard_drive"` ImageSize int `json:"image_size"` Encrypted bool `json:"encrypted"` Status string `json:"status"` StopDate string `json:"stop_date"` }
type VMShowOutput ¶
type VMShowOutput struct { VMRespBase `json:",inline"` Body VMShowBody `json:",inline"` }
type VMStartOutput ¶
type VMStartOutput struct { VMRespBase `json:",inline"` Body VMShowBody `json:",inline"` }
type VMStatusBody ¶
type VMStatusEmptyResp ¶
type VMStatusEmptyResp struct { VMRespBase Body []string `json:"body"` }
type VMStatusResp ¶
type VMStatusResp struct { VMRespBase Body VMStatusBody `json:"body,omitempty"` }
type VMStopOutput ¶
type VMStopOutput struct {
VMRespBase `json:",inline"`
}
Click to show internal directories.
Click to hide internal directories.