volume

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: BSD-3-Clause Imports: 71 Imported by: 0

Documentation

Overview

Package volume owns Docker volumes: CRUD and pruning, the helper-container file browser, backup and restore, and the HTTP surface for all of it.

Index

Constants

This section is empty.

Variables

View Source
var ErrVolumeBackupAlreadyRunning = errors.New("a backup is already running for this volume")

Functions

func RegisterVolumes

func RegisterVolumes(api huma.API, dockerService *docker.DockerClientService, volumeService *VolumeService, activityService *activity.ActivityService, environmentService *environment.EnvironmentService, uploadService *upload.UploadService, appCtx handlerutil.ActivityAppContext)

RegisterVolumes registers volume management routes using Huma.

Types

type BackupHasPathInput

type BackupHasPathInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
	Path          string `query:"path" doc:"Path to check"`
}

type BackupHasPathResponse

type BackupHasPathResponse struct {
	Exists bool `json:"exists"`
}

type BrowseBackupFilesInput added in v2.10.0

type BrowseBackupFilesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
	Path          string `query:"path" doc:"Folder path relative to the backup root"`
	Search        string `query:"search" doc:"Case-insensitive full-path search"`
	Start         int    `query:"start" default:"0" doc:"Start index for the page"`
	Limit         int    `query:"limit" default:"20" doc:"Requested page size"`
}

type CreateBackupInput

type CreateBackupInput struct {
	EnvironmentID string                           `path:"id" doc:"Environment ID"`
	VolumeName    string                           `path:"volumeName" doc:"Volume name"`
	Body          *volumetypes.CreateBackupRequest `json:"body,omitempty"`
}

type CreateVolumeInput

type CreateVolumeInput struct {
	EnvironmentID string             `path:"id" doc:"Environment ID"`
	Body          volumetypes.Create `doc:"Volume creation data"`
}

type DeleteBackupInput

type DeleteBackupInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
}

type Dependencies

Dependencies are the collaborators the volume domain needs.

type DownloadBackupInput

type DownloadBackupInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
}

type GetVolumeBackupPolicyInput added in v2.9.0

type GetVolumeBackupPolicyInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
}

type GetVolumeInput

type GetVolumeInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
}

type GetVolumeSizesInput

type GetVolumeSizesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
}

type GetVolumeUsageCountsInput

type GetVolumeUsageCountsInput struct {
	EnvironmentID   string `path:"id" doc:"Environment ID"`
	IncludeInternal bool   `query:"includeInternal" default:"false" doc:"Include internal volumes"`
}

type GetVolumeUsageInput

type GetVolumeUsageInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
}

type GetVolumeWorkspaceFileInput

type GetVolumeWorkspaceFileInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	RelativePath  string `query:"relativePath" doc:"Path relative to the volume workspace root"`
}

type GetVolumeWorkspaceInput

type GetVolumeWorkspaceInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
}

type ListBackupFilesInput

type ListBackupFilesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
}

type ListBackupsInput

type ListBackupsInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	Search        string `query:"search" doc:"Search query"`
	Sort          string `query:"sort" doc:"Column to sort by"`
	Order         string `query:"order" default:"asc" doc:"Sort direction"`
	Start         int    `query:"start" default:"0" doc:"Start index"`
	Limit         int    `query:"limit" default:"20" doc:"Limit"`
	Type          string `query:"type" doc:"Management origin filter"`
}

type ListBackupsOutput

type ListBackupsOutput struct {
	Body VolumeBackupPaginatedResponse
}

type ListVolumesInput

type ListVolumesInput struct {
	EnvironmentID   string `path:"id" doc:"Environment ID"`
	Search          string `query:"search" doc:"Search query"`
	Sort            string `query:"sort" doc:"Column to sort by"`
	Order           string `query:"order" default:"asc" doc:"Sort direction (asc or desc)"`
	Start           int    `query:"start" default:"0" doc:"Start index for pagination"`
	Limit           int    `query:"limit" default:"20" doc:"Number of items per page"`
	InUse           string `query:"inUse" doc:"Filter by in-use status (true/false)"`
	IncludeInternal bool   `query:"includeInternal" default:"false" doc:"Include internal volumes"`
}

type ListVolumesOutput

type ListVolumesOutput struct {
	Body base.PaginatedWithCounts[volumetypes.Volume, VolumeUsageCountsData]
}

type Module

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

Module wires the volume domain and mounts its routes.

func New

func New(deps Dependencies) *Module

New builds the volume domain from its dependencies.

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)

RegisterRoutes mounts the volume endpoints. A nil module still registers, so OpenAPI spec generation can discover the routes without a service graph.

func (*Module) Service

func (m *Module) Service() *VolumeService

Service exposes the volume service to collaborators that use it directly, such as the helper-container reaper job.

type PruneVolumesInput

type PruneVolumesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
}

type RemoveVolumeInput

type RemoveVolumeInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	Force         bool   `query:"force" doc:"Force removal"`
}

type RenameVolumeInput added in v2.9.0

type RenameVolumeInput struct {
	EnvironmentID string             `path:"id" doc:"Environment ID"`
	VolumeName    string             `path:"volumeName" doc:"Current volume name"`
	Body          volumetypes.Rename `doc:"Volume rename data"`
}

type RestoreBackupFilesInput

type RestoreBackupFilesInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
	Body          backuptypes.RestoreSelection
}

type RestoreBackupInput

type RestoreBackupInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
}

type UpdateVolumeBackupPolicyInput added in v2.9.0

type UpdateVolumeBackupPolicyInput struct {
	EnvironmentID string                           `path:"id" doc:"Environment ID"`
	VolumeName    string                           `path:"volumeName" doc:"Volume name"`
	Body          volumetypes.UpdateBackupPolicies `doc:"Scheduled volume backup policies"`
}

type UpdateVolumeWorkspaceInput

type UpdateVolumeWorkspaceInput struct {
	EnvironmentID string         `path:"id" doc:"Environment ID"`
	VolumeName    string         `path:"volumeName" doc:"Volume name"`
	RawBody       multipart.Form `contentType:"multipart/form-data"`
}

type UploadAndRestoreInput

type UploadAndRestoreInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	VolumeName    string `path:"volumeName" doc:"Volume name"`
	Body          uploadtypes.ConsumeRequest
}

type UploadBackupInput added in v2.9.0

type UploadBackupInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	BackupID      string `path:"backupId" doc:"Backup ID"`
	Body          volumetypes.UploadBackupRequest
}

type VolumeBackup added in v2.8.1

type VolumeBackup struct {
	database.BaseModel

	VolumeName        string                     `json:"volumeName" gorm:"column:volume_name;index"`
	Size              int64                      `json:"size" gorm:"column:size"`
	CreatedAt         time.Time                  `json:"createdAt" gorm:"column:created_at"`
	Status            VolumeBackupStatus         `json:"status" gorm:"column:status;type:text;not null;default:succeeded"`
	Trigger           VolumeBackupTrigger        `json:"trigger" gorm:"column:trigger;type:text;not null;default:manual"`
	Destination       volume.BackupDestination   `json:"destination" gorm:"column:destination;type:text;not null;default:local"`
	Format            VolumeBackupFormat         `json:"format" gorm:"column:format;type:text;not null;default:archive"`
	LocalSnapshotID   string                     `json:"localSnapshotId,omitempty" gorm:"column:local_snapshot_id;type:text"`
	RemoteSnapshotID  string                     `json:"remoteSnapshotId,omitempty" gorm:"column:remote_snapshot_id;type:text"`
	S3DestinationID   string                     `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
	S3DestinationName string                     `json:"s3DestinationName,omitempty" gorm:"-"`
	PolicyID          string                     `json:"policyId,omitempty" gorm:"column:policy_id;type:text;index"`
	Error             string                     `json:"error,omitempty" gorm:"column:error;type:text"`
	ActivityID        *string                    `json:"activityId,omitempty" gorm:"-"`
	Type              backuptypes.ManagementType `json:"type" gorm:"-"`
}

func (*VolumeBackup) TableName added in v2.8.1

func (*VolumeBackup) TableName() string

func (*VolumeBackup) ToDTO added in v2.8.1

func (b *VolumeBackup) ToDTO() volume.BackupEntry

type VolumeBackupFormat added in v2.9.0

type VolumeBackupFormat string
const (
	VolumeBackupFormatArchive VolumeBackupFormat = "archive"
	VolumeBackupFormatRustic  VolumeBackupFormat = "rustic"
)

type VolumeBackupPaginatedResponse

type VolumeBackupPaginatedResponse struct {
	Success    bool                    `json:"success"`
	Data       []VolumeBackup          `json:"data"`
	Pagination base.PaginationResponse `json:"pagination"`
	Warnings   []string                `json:"warnings,omitempty"`
}

type VolumeBackupPolicy added in v2.9.0

type VolumeBackupPolicy struct {
	database.BaseModel

	VolumeName      string `json:"volumeName" gorm:"column:volume_name;not null;index"`
	Enabled         bool   `json:"enabled" gorm:"column:enabled;not null;default:false"`
	Schedule        string `json:"schedule" gorm:"column:schedule;type:text;not null"`
	RetentionCount  int    `json:"retentionCount" gorm:"column:retention_count;not null;default:7"`
	StopContainers  bool   `json:"stopContainers" gorm:"column:stop_containers;not null;default:false"`
	LocalEnabled    bool   `json:"localEnabled" gorm:"column:local_enabled;not null"`
	S3Enabled       bool   `json:"s3Enabled" gorm:"column:s3_enabled;not null;default:false"`
	S3DestinationID string `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
}

func (VolumeBackupPolicy) TableName added in v2.9.0

func (VolumeBackupPolicy) TableName() string

func (VolumeBackupPolicy) ToDTO added in v2.9.0

type VolumeBackupStatus added in v2.9.0

type VolumeBackupStatus string
const (
	VolumeBackupStatusRunning   VolumeBackupStatus = "running"
	VolumeBackupStatusSucceeded VolumeBackupStatus = "succeeded"
	VolumeBackupStatusFailed    VolumeBackupStatus = "failed"
)

type VolumeBackupTrigger added in v2.9.0

type VolumeBackupTrigger string
const (
	VolumeBackupTriggerManual    VolumeBackupTrigger = "manual"
	VolumeBackupTriggerScheduled VolumeBackupTrigger = "scheduled"
	VolumeBackupTriggerSafety    VolumeBackupTrigger = "safety"
)

type VolumeHandler

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

VolumeHandler provides Huma-based volume management endpoints.

func (*VolumeHandler) BackupHasPath

func (*VolumeHandler) BrowseBackupFiles added in v2.10.0

func (*VolumeHandler) CreateBackup

func (*VolumeHandler) CreateVolume

CreateVolume creates a new Docker volume.

func (*VolumeHandler) DeleteBackup

func (*VolumeHandler) DownloadBackup

func (h *VolumeHandler) DownloadBackup(ctx context.Context, input *DownloadBackupInput) (*huma.StreamResponse, error)

func (*VolumeHandler) DownloadVolumeWorkspaceFile

func (h *VolumeHandler) DownloadVolumeWorkspaceFile(ctx context.Context, input *GetVolumeWorkspaceFileInput) (*huma.StreamResponse, error)

func (*VolumeHandler) GetBackupPolicy added in v2.9.0

func (*VolumeHandler) GetVolume

GetVolume returns a volume by name.

func (*VolumeHandler) GetVolumeSizes

func (h *VolumeHandler) GetVolumeSizes(ctx context.Context, input *GetVolumeSizesInput) (*handlerutil.Out[[]VolumeSizeInfo], error)

GetVolumeSizes returns disk usage sizes for all volumes. This is a slow operation as it requires calculating disk usage.

func (*VolumeHandler) GetVolumeUsage

GetVolumeUsage returns containers using a specific volume.

func (*VolumeHandler) GetVolumeUsageCounts

GetVolumeUsageCounts returns counts of volumes by usage status.

func (*VolumeHandler) GetVolumeWorkspace

func (*VolumeHandler) GetVolumeWorkspaceFile

func (*VolumeHandler) ListBackupFiles

func (h *VolumeHandler) ListBackupFiles(ctx context.Context, input *ListBackupFilesInput) (*handlerutil.Out[[]string], error)

func (*VolumeHandler) ListBackups

func (h *VolumeHandler) ListBackups(ctx context.Context, input *ListBackupsInput) (*ListBackupsOutput, error)

func (*VolumeHandler) ListVolumes

func (h *VolumeHandler) ListVolumes(ctx context.Context, input *ListVolumesInput) (*ListVolumesOutput, error)

ListVolumes returns a paginated list of volumes.

func (*VolumeHandler) PruneVolumes

PruneVolumes removes all unused Docker volumes.

func (*VolumeHandler) RemoveVolume

RemoveVolume removes a Docker volume.

func (*VolumeHandler) RenameVolume added in v2.9.0

RenameVolume renames an unused Docker volume.

func (*VolumeHandler) RestoreBackup

func (*VolumeHandler) RestoreBackupFiles

func (*VolumeHandler) UpdateBackupPolicy added in v2.9.0

func (*VolumeHandler) UpdateVolumeWorkspace

func (*VolumeHandler) UploadAndRestore

func (*VolumeHandler) UploadBackup added in v2.9.0

func (h *VolumeHandler) UploadBackup(ctx context.Context, input *UploadBackupInput) (*handlerutil.Out[*VolumeBackup], error)

type VolumePruneReportData

type VolumePruneReportData struct {
	VolumesDeleted []string `json:"volumesDeleted,omitempty"`
	SpaceReclaimed uint64   `json:"spaceReclaimed"`
	ActivityID     *string  `json:"activityId,omitempty"`
}

VolumePruneReportData represents the result of a volume prune operation. This is a local type to avoid schema naming conflicts with image.PruneReport.

type VolumeService

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

func NewVolumeService

func NewVolumeService(db *database.DB, dockerService *docker.DockerClientService, eventService *event.EventService, activityService *activity.ActivityService, settingsService *settings.SettingsService, containerService *container.ContainerService, imageService *image.ImageService, engine *backup.Engine, s3Destinations *s3domain.S3DestinationService, cfg *config.Config) *VolumeService

func (*VolumeService) BackupHasPath

func (s *VolumeService) BackupHasPath(ctx context.Context, backupID, filePath string) (bool, error)

func (*VolumeService) BackupMountWarning

func (s *VolumeService) BackupMountWarning(ctx context.Context) string

func (*VolumeService) BackupStorageMount added in v2.9.0

func (s *VolumeService) BackupStorageMount(ctx context.Context, dockerClient *client.Client, target string, readOnly bool) (mount.Mount, error)

BackupStorageMount resolves the repository mount shared with system-backup operations.

func (*VolumeService) BrowseBackupFiles added in v2.10.0

func (s *VolumeService) BrowseBackupFiles(ctx context.Context, backupID, requestedPath string, params pagination.QueryParams) ([]backuptypes.BackupFileEntry, pagination.Response, error)

BrowseBackupFiles returns one lazy-loaded page from a volume backup tree.

func (*VolumeService) CleanupHelperContainers

func (s *VolumeService) CleanupHelperContainers(ctx context.Context)

func (*VolumeService) CleanupOrphanedVolumeHelpers

func (s *VolumeService) CleanupOrphanedVolumeHelpers(ctx context.Context) (int, error)

func (*VolumeService) CountUsageFromSnapshot

func (s *VolumeService) CountUsageFromSnapshot(volumes []volume.Volume, containers []container.Summary) volumetypes.UsageCounts

CountUsageFromSnapshot derives volume usage counts from an already-fetched volume and container listing. It mirrors the semantics of ListVolumesPaginated — internal volumes are excluded and a volume counts as in use when any container mounts it — so dashboard tile numbers agree with the volumes page.

func (*VolumeService) CreateBackup

func (s *VolumeService) CreateBackup(ctx context.Context, volumeName string, user common.User, trigger VolumeBackupTrigger, request volumetypes.CreateBackupRequest) (_ *VolumeBackup, err error)

func (*VolumeService) CreateSystemManagedBackup added in v2.10.0

func (s *VolumeService) CreateSystemManagedBackup(ctx context.Context, volumeName string, user common.User, trigger VolumeBackupTrigger, policyID string, policy backuptypes.UpdateBackupPolicy) (*VolumeBackup, error)

CreateSystemManagedBackup runs the existing volume backup workflow with a transient centralized policy.

func (*VolumeService) CreateVolume

func (s *VolumeService) CreateVolume(ctx context.Context, options client.VolumeCreateOptions, user common.User) (*volumetypes.Volume, error)

func (*VolumeService) DeleteBackup

func (s *VolumeService) DeleteBackup(ctx context.Context, backupID string, user *common.User) error

func (*VolumeService) DeleteVolume

func (s *VolumeService) DeleteVolume(ctx context.Context, name string, force bool, user common.User) error

func (*VolumeService) DownloadBackup

func (s *VolumeService) DownloadBackup(ctx context.Context, backupID string, user *common.User) (io.ReadCloser, int64, error)

DownloadBackup streams a backup as a tar.gz archive. Legacy archive rows stream their stored file; local Rustic rows are restored into a scratch volume and packaged on the fly.

func (*VolumeService) DownloadVolumeWorkspaceFile

func (s *VolumeService) DownloadVolumeWorkspaceFile(ctx context.Context, volumeName, relativePath string) (io.ReadCloser, int64, error)

func (*VolumeService) GetBackupPolicies added in v2.9.0

func (s *VolumeService) GetBackupPolicies(ctx context.Context, volumeName string) (*volumetypes.BackupPolicyCollection, error)

func (*VolumeService) GetVolumeByName

func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*volumetypes.Volume, error)

func (*VolumeService) GetVolumeSizes

func (s *VolumeService) GetVolumeSizes(ctx context.Context) (map[string]VolumeSizeData, error)

GetVolumeSizes returns disk usage data for all volumes. This is a slow operation as it calls Docker's DiskUsage API.

func (*VolumeService) GetVolumeUsage

func (s *VolumeService) GetVolumeUsage(ctx context.Context, name string) (bool, []string, error)

func (*VolumeService) GetVolumeWorkspace

func (s *VolumeService) GetVolumeWorkspace(ctx context.Context, volumeName string) (*workspacetypes.Workspace, error)

func (*VolumeService) GetVolumeWorkspaceFile

func (s *VolumeService) GetVolumeWorkspaceFile(ctx context.Context, volumeName, relativePath string) (*workspacetypes.FileContent, error)

func (*VolumeService) HasEnabledBackupPolicy added in v2.10.0

func (s *VolumeService) HasEnabledBackupPolicy(ctx context.Context, volumeName string) (bool, error)

HasEnabledBackupPolicy reports whether a volume-level schedule takes precedence over centralized backups.

func (*VolumeService) ListBackupFiles

func (s *VolumeService) ListBackupFiles(ctx context.Context, backupID string) ([]string, error)

func (*VolumeService) ListBackupVolumeOptions added in v2.10.0

func (s *VolumeService) ListBackupVolumeOptions(ctx context.Context) ([]backuptypes.SystemVolumeBackupOption, error)

ListBackupVolumeOptions returns the current non-internal volumes used by centralized backup selection.

func (*VolumeService) ListBackups

func (s *VolumeService) ListBackups(ctx context.Context, volumeName string) ([]VolumeBackup, error)

func (*VolumeService) ListBackupsPaginated

func (s *VolumeService) ListBackupsPaginated(ctx context.Context, volumeName string, params pagination.QueryParams) ([]VolumeBackup, pagination.Response, error)

func (*VolumeService) ListVolumesPaginated

func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams, includeInternal bool) ([]volumetypes.Volume, pagination.Response, volumetypes.UsageCounts, error)

func (*VolumeService) PruneVolumes

func (s *VolumeService) PruneVolumes(ctx context.Context) (*volumetypes.PruneReport, error)

func (*VolumeService) PruneVolumesWithOptions

func (s *VolumeService) PruneVolumesWithOptions(ctx context.Context, all bool) (*volumetypes.PruneReport, error)

func (*VolumeService) ReapIdleHelpers

func (s *VolumeService) ReapIdleHelpers(ctx context.Context, idleTimeout time.Duration) (int, error)

ReapIdleHelpers removes reused helper containers that have not serviced a request within idleTimeout. It is map-driven (orphaned helpers not tracked in helperByVolume are left to the startup orphan sweep). Entries are removed from the map before the container is removed, so a concurrent request simply gets a cache miss and re-creates a fresh helper.

func (*VolumeService) ReconcileInterruptedBackups added in v2.10.2

func (s *VolumeService) ReconcileInterruptedBackups(ctx context.Context) error

ReconcileInterruptedBackups runs before this process can accept backup work.

func (*VolumeService) RegisterBackupJobsOnStartup added in v2.9.0

func (s *VolumeService) RegisterBackupJobsOnStartup(ctx context.Context)

func (*VolumeService) RenameVolume added in v2.9.0

func (s *VolumeService) RenameVolume(ctx context.Context, oldName, newName string, user common.User) (*volumetypes.Volume, error)

RenameVolume copies an unused volume to a new name and removes the source.

func (*VolumeService) RestoreBackup

func (s *VolumeService) RestoreBackup(ctx context.Context, volumeName, backupID string, user common.User) (err error)

func (*VolumeService) RestoreBackupFiles

func (s *VolumeService) RestoreBackupFiles(ctx context.Context, volumeName, backupID string, selection backuptypes.RestoreSelection, user common.User) (err error)

func (*VolumeService) SetScheduler added in v2.9.0

func (s *VolumeService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error

SetScheduler injects the dynamic scheduler and admission gate for per-policy backup jobs. Agent mode passes them too: agents run their own volume backups.

func (*VolumeService) StartBackup added in v2.10.2

func (s *VolumeService) StartBackup(ctx context.Context, environmentID, volumeName string, user common.User, request volumetypes.CreateBackupRequest) (volumetypes.BackupEntry, error)

StartBackup persists a running backup and submits application-owned work.

func (*VolumeService) StopHelper

func (s *VolumeService) StopHelper(ctx context.Context, volumeName string) error

StopHelper removes the reused helper for a single volume, if one exists. It is idempotent: stopping a volume with no active helper returns nil.

func (*VolumeService) UpdateBackupPolicies added in v2.9.0

func (s *VolumeService) UpdateBackupPolicies(ctx context.Context, volumeName string, updates []volumetypes.UpdateBackupPolicy) (*volumetypes.BackupPolicyCollection, error)

func (*VolumeService) UpdateVolumeWorkspace

func (s *VolumeService) UpdateVolumeWorkspace(ctx context.Context, volumeName string, manifest volumetypes.WorkspaceUpdateManifest, uploads map[int][]byte, user common.User) (*workspacetypes.Workspace, error)

func (*VolumeService) UploadAndRestore

func (s *VolumeService) UploadAndRestore(ctx context.Context, volumeName string, archive io.ReadSeeker, filename string, user common.User) error

func (*VolumeService) UploadBackup added in v2.9.0

func (s *VolumeService) UploadBackup(ctx context.Context, backupID, s3DestinationID string) (*VolumeBackup, error)

type VolumeSizeData

type VolumeSizeData struct {
	Size     int64
	RefCount int64
}

VolumeSizeData holds size information for a volume.

type VolumeSizeInfo

type VolumeSizeInfo struct {
	Name     string `json:"name"`
	Size     int64  `json:"size"`
	RefCount int64  `json:"refCount"`
}

VolumeSizeInfo represents size information for a single volume.

type VolumeUsageCountsData

type VolumeUsageCountsData struct {
	Inuse  int `json:"inuse"`
	Unused int `json:"unused"`
	Total  int `json:"total"`
}

VolumeUsageCountsData represents the counts of volumes by usage status. This is a local type to avoid schema naming conflicts with image.UsageCounts.

type VolumeUsageResponse

type VolumeUsageResponse struct {
	InUse      bool     `json:"inUse"`
	Containers []string `json:"containers"`
}

VolumeUsageResponse represents volume usage information.

Jump to

Keyboard shortcuts

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