Documentation
¶
Index ¶
- func DetectCattle() bool
- func DetectDocker(config *DockerConfig) bool
- func DetectKubernetes() bool
- type CattleConfig
- type CattleOrchestrator
- func (o *CattleOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
- func (o *CattleOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
- func (o *CattleOrchestrator) DeployAgent(image string, cmd []string, envs []string, v *volume.Volume) (success bool, output string, err error)
- func (o *CattleOrchestrator) GetContainersMountingVolume(v *volume.Volume) (mountedVolumes []*volume.MountedVolume, err error)
- func (*CattleOrchestrator) GetName() string
- func (*CattleOrchestrator) GetPath(v *volume.Volume) string
- func (o *CattleOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
- func (o *CattleOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
- func (o *CattleOrchestrator) RemoveContainer(container *client.Container)
- func (o *CattleOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
- type DockerConfig
- type DockerOrchestrator
- func (o *DockerOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
- func (o *DockerOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
- func (o *DockerOrchestrator) DeployAgent(image string, cmd []string, envs []string, v *volume.Volume) (success bool, output string, err error)
- func (o *DockerOrchestrator) GetContainersMountingVolume(v *volume.Volume) (mountedVolumes []*volume.MountedVolume, err error)
- func (o *DockerOrchestrator) GetName() string
- func (*DockerOrchestrator) GetPath(v *volume.Volume) string
- func (o *DockerOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
- func (o *DockerOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
- func (o *DockerOrchestrator) PullImage(image string) (err error)
- func (o *DockerOrchestrator) RemoveContainer(containerID string) (err error)
- func (o *DockerOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
- type KubernetesConfig
- type KubernetesOrchestrator
- func (o *KubernetesOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
- func (o *KubernetesOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
- func (o *KubernetesOrchestrator) DeletePod(name, namespace string)
- func (o *KubernetesOrchestrator) DeployAgent(image string, cmd, envs []string, v *volume.Volume) (success bool, output string, err error)
- func (o *KubernetesOrchestrator) GetContainersMountingVolume(v *volume.Volume) (containers []*volume.MountedVolume, er error)
- func (*KubernetesOrchestrator) GetName() string
- func (*KubernetesOrchestrator) GetPath(v *volume.Volume) string
- func (o *KubernetesOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
- func (o *KubernetesOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
- func (o *KubernetesOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
- type Orchestrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectCattle ¶
func DetectCattle() bool
DetectCattle returns true if the Volback is running on the orchestrator Cattle
func DetectDocker ¶
func DetectDocker(config *DockerConfig) bool
DetectDocker tries to detect a Docker orchestrator by connecting to the endpoint
func DetectKubernetes ¶
func DetectKubernetes() bool
DetectKubernetes returns true if Volback is running on the orchestrator Kubernetes
Types ¶
type CattleConfig ¶
CattleConfig stores Cattle configuration
type CattleOrchestrator ¶
type CattleOrchestrator struct {
// contains filtered or unexported fields
}
CattleOrchestrator implements a container orchestrator for Cattle
func NewCattleOrchestrator ¶
func NewCattleOrchestrator(config *CattleConfig) (o *CattleOrchestrator, err error)
NewCattleOrchestrator creates a Cattle client
func (*CattleOrchestrator) AttachOrphanAgent ¶
func (o *CattleOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
AttachOrphanAgent connects to a running agent and wait for the end of the backup proccess
func (*CattleOrchestrator) ContainerExec ¶
func (o *CattleOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
ContainerExec executes a command in a container
func (*CattleOrchestrator) DeployAgent ¶
func (o *CattleOrchestrator) DeployAgent(image string, cmd []string, envs []string, v *volume.Volume) (success bool, output string, err error)
DeployAgent creates a `volback agent` container
func (*CattleOrchestrator) GetContainersMountingVolume ¶
func (o *CattleOrchestrator) GetContainersMountingVolume(v *volume.Volume) (mountedVolumes []*volume.MountedVolume, err error)
GetContainersMountingVolume returns containers mounting a volume
func (*CattleOrchestrator) GetName ¶
func (*CattleOrchestrator) GetName() string
GetName returns the orchestrator name
func (*CattleOrchestrator) GetPath ¶
func (*CattleOrchestrator) GetPath(v *volume.Volume) string
GetPath returns the backup path
func (*CattleOrchestrator) GetVolumes ¶
func (o *CattleOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
GetVolumes returns the Cattle volumes, inspected and filtered
func (*CattleOrchestrator) IsNodeAvailable ¶
func (o *CattleOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
IsNodeAvailable checks if the node is available to run backups on it
func (*CattleOrchestrator) RemoveContainer ¶
func (o *CattleOrchestrator) RemoveContainer(container *client.Container)
RemoveContainer remove container based on its ID
func (*CattleOrchestrator) RetrieveOrphanAgents ¶
func (o *CattleOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
RetrieveOrphanAgents returns the list of orphan Volback agents
type DockerConfig ¶
type DockerConfig struct {
Endpoint string
}
DockerConfig stores Docker configuration
type DockerOrchestrator ¶
type DockerOrchestrator struct {
// contains filtered or unexported fields
}
DockerOrchestrator implements a container orchestrator for Docker
func NewDockerOrchestrator ¶
func NewDockerOrchestrator(config *DockerConfig) (o *DockerOrchestrator, err error)
NewDockerOrchestrator creates a Docker client
func (*DockerOrchestrator) AttachOrphanAgent ¶
func (o *DockerOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
AttachOrphanAgent connects to a running agent and wait for the end of the backup proccess
func (*DockerOrchestrator) ContainerExec ¶
func (o *DockerOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
ContainerExec executes a command in a container
func (*DockerOrchestrator) DeployAgent ¶
func (o *DockerOrchestrator) DeployAgent(image string, cmd []string, envs []string, v *volume.Volume) (success bool, output string, err error)
DeployAgent creates a `volback agent` container
func (*DockerOrchestrator) GetContainersMountingVolume ¶
func (o *DockerOrchestrator) GetContainersMountingVolume(v *volume.Volume) (mountedVolumes []*volume.MountedVolume, err error)
GetContainersMountingVolume returns mounted volumes
func (*DockerOrchestrator) GetName ¶
func (o *DockerOrchestrator) GetName() string
GetName returns the orchestrator's name
func (*DockerOrchestrator) GetPath ¶
func (*DockerOrchestrator) GetPath(v *volume.Volume) string
GetPath returns the backup path
func (*DockerOrchestrator) GetVolumes ¶
func (o *DockerOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
GetVolumes returns the Docker volumes, inspected and filtered
func (*DockerOrchestrator) IsNodeAvailable ¶
func (o *DockerOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
IsNodeAvailable checks if the node is available to run backups on it
func (*DockerOrchestrator) PullImage ¶
func (o *DockerOrchestrator) PullImage(image string) (err error)
PullImage pulls a Docker image
func (*DockerOrchestrator) RemoveContainer ¶
func (o *DockerOrchestrator) RemoveContainer(containerID string) (err error)
RemoveContainer removes a container based on its ID
func (*DockerOrchestrator) RetrieveOrphanAgents ¶
func (o *DockerOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
RetrieveOrphanAgents returns the list of orphan Volback agents
type KubernetesConfig ¶
type KubernetesConfig struct { Namespace string AllNamespaces bool KubeConfig string AgentServiceAccount string }
KubernetesConfig stores Kubernetes configuration
type KubernetesOrchestrator ¶
type KubernetesOrchestrator struct {
// contains filtered or unexported fields
}
KubernetesOrchestrator implements a container orchestrator for Kubernetes
func NewKubernetesOrchestrator ¶
func NewKubernetesOrchestrator(config *KubernetesConfig) (o *KubernetesOrchestrator, err error)
NewKubernetesOrchestrator creates a Kubernetes client
func (*KubernetesOrchestrator) AttachOrphanAgent ¶
func (o *KubernetesOrchestrator) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error)
AttachOrphanAgent connects to a running agent and wait for the end of the backup proccess
func (*KubernetesOrchestrator) ContainerExec ¶
func (o *KubernetesOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error)
ContainerExec executes a command in a container
func (*KubernetesOrchestrator) DeletePod ¶
func (o *KubernetesOrchestrator) DeletePod(name, namespace string)
DeletePod removes pod based on its name
func (*KubernetesOrchestrator) DeployAgent ¶
func (o *KubernetesOrchestrator) DeployAgent(image string, cmd, envs []string, v *volume.Volume) (success bool, output string, err error)
DeployAgent creates a `volback agent` container
func (*KubernetesOrchestrator) GetContainersMountingVolume ¶
func (o *KubernetesOrchestrator) GetContainersMountingVolume(v *volume.Volume) (containers []*volume.MountedVolume, er error)
GetContainersMountingVolume returns containers mounting a volume
func (*KubernetesOrchestrator) GetName ¶
func (*KubernetesOrchestrator) GetName() string
GetName returns the orchestrator name
func (*KubernetesOrchestrator) GetPath ¶
func (*KubernetesOrchestrator) GetPath(v *volume.Volume) string
GetPath returns the backup path
func (*KubernetesOrchestrator) GetVolumes ¶
func (o *KubernetesOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error)
GetVolumes returns the Kubernetes persistent volume claims, inspected and filtered
func (*KubernetesOrchestrator) IsNodeAvailable ¶
func (o *KubernetesOrchestrator) IsNodeAvailable(hostID string) (ok bool, err error)
IsNodeAvailable checks if the node is available to run backups on it
func (*KubernetesOrchestrator) RetrieveOrphanAgents ¶
func (o *KubernetesOrchestrator) RetrieveOrphanAgents() (containers map[string]string, err error)
RetrieveOrphanAgents returns the list of orphan Volback agents
type Orchestrator ¶
type Orchestrator interface { GetName() string GetPath(v *volume.Volume) string GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error) DeployAgent(image string, cmd []string, envs []string, volume *volume.Volume) (success bool, output string, err error) GetContainersMountingVolume(v *volume.Volume) (mountedVolumes []*volume.MountedVolume, err error) ContainerExec(mountedVolumes *volume.MountedVolume, command []string) (stdout string, err error) IsNodeAvailable(hostID string) (ok bool, err error) RetrieveOrphanAgents() (containers map[string]string, err error) AttachOrphanAgent(containerID, namespace string) (success bool, output string, err error) }
Orchestrator implements a container Orchestrator interface