snapshot

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchDockerID

func FetchDockerID(snapshot portainer.DockerSnapshot) (string, error)

FetchDockerID fetches info.Swarm.Cluster.ID if environment(endpoint) is swarm and info.ID otherwise

func FillSnapshotData

func FillSnapshotData(dataStore dataservices.DataStore, endpoint *portainer.Endpoint) error

func SupportDirectSnapshot

func SupportDirectSnapshot(endpoint *portainer.Endpoint) bool

SupportDirectSnapshot checks whether an environment(endpoint) can be used to trigger a direct a snapshot. It is mostly true for all environments(endpoints) except Edge and Azure environments(endpoints).

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service repesents a service to manage environment(endpoint) snapshots. It provides an interface to start background snapshots as well as specific Docker/Kubernetes environment(endpoint) snapshot methods.

func NewService

func NewService(snapshotIntervalFromFlag string, dataStore dataservices.DataStore, dockerSnapshotter portainer.DockerSnapshotter, kubernetesSnapshotter portainer.KubernetesSnapshotter, shutdownCtx context.Context) (*Service, error)

NewService creates a new instance of a service

func (*Service) Create

func (service *Service) Create(snapshot portainer.Snapshot) error

func (*Service) FillSnapshotData

func (service *Service) FillSnapshotData(endpoint *portainer.Endpoint) error

func (*Service) SetSnapshotInterval

func (service *Service) SetSnapshotInterval(snapshotInterval string) error

SetSnapshotInterval sets the snapshot interval and resets the service

func (*Service) SnapshotEndpoint

func (service *Service) SnapshotEndpoint(endpoint *portainer.Endpoint) error

SnapshotEndpoint will create a snapshot of the environment(endpoint) based on the environment(endpoint) type. If the snapshot is a success, it will be associated to the environment(endpoint).

func (*Service) Start

func (service *Service) Start()

Start will start a background routine to execute periodic snapshots of environments(endpoints)

Jump to

Keyboard shortcuts

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