Documentation ¶
Index ¶
- Constants
- type ACLRequest
- type APIToken
- type APITokenRequest
- type APITokenResponse
- type Exclusion
- type Job
- type PBSStatus
- type PBSStatusResponse
- type PartialFile
- type Store
- func (storeInstance *Store) AgentPing(agentTarget *Target) (bool, error)
- func (storeInstance *Store) CheckProxyAuth(r *http.Request) error
- func (storeInstance *Store) CreateAPIToken() (*APIToken, error)
- func (store *Store) CreateExclusion(exclusion Exclusion) error
- func (store *Store) CreateJob(job Job) error
- func (store *Store) CreatePartialFile(partialFile PartialFile) error
- func (store *Store) CreateTables() error
- func (store *Store) CreateTarget(target Target) error
- func (store *Store) DeleteExclusion(path string) error
- func (store *Store) DeleteJob(id string) error
- func (store *Store) DeletePartialFile(path string) error
- func (store *Store) DeleteTarget(name string) error
- func (store *Store) GetAllGlobalExclusions() ([]Exclusion, error)
- func (store *Store) GetAllJobExclusions(jobId string) ([]Exclusion, error)
- func (store *Store) GetAllJobs() ([]Job, error)
- func (store *Store) GetAllPartialFiles() ([]PartialFile, error)
- func (store *Store) GetAllTargets() ([]Target, error)
- func (store *Store) GetAllTargetsByIP(ip string) ([]Target, error)
- func (store *Store) GetExclusion(path string) (*Exclusion, error)
- func (store *Store) GetJob(id string) (*Job, error)
- func (storeInstance *Store) GetJobTask(ctx context.Context, taskChan chan Task, job *Job) error
- func (storeInstance *Store) GetPBSStatus() (*PBSStatus, error)
- func (store *Store) GetPartialFile(path string) (*PartialFile, error)
- func (store *Store) GetTarget(name string) (*Target, error)
- func (storeInstance *Store) GetTaskByUPID(upid string) (*Task, error)
- func (storeInstance *Store) GetTaskEndTime(task *Task) (int64, error)
- func (storeInstance *Store) ProxmoxHTTPRequest(method, url string, body io.Reader, respBody any) error
- func (store *Store) SetSchedule(job Job) error
- func (store *Store) UpdateExclusion(exclusion Exclusion) error
- func (store *Store) UpdateJob(job Job) error
- func (store *Store) UpdatePartialFile(partialFile PartialFile) error
- func (store *Store) UpdateTarget(target Target) error
- type Target
- type Task
- type TaskResponse
- type TimerInfo
- type Token
- type TokenRequest
- type TokenResponse
Constants ¶
const ( ProxyTargetURL = "https://127.0.0.1:8007" // The target server URL ModifiedFilePath = "/js/proxmox-backup-gui.js" // The specific JS file to modify CertFile = "/etc/proxmox-backup/proxy.pem" // Path to generated SSL certificate KeyFile = "/etc/proxmox-backup/proxy.key" // Path to generated private key TimerBasePath = "/lib/systemd/system" DbBasePath = "/var/lib/proxmox-backup" AgentMountBasePath = "/mnt/pbs-plus-mounts" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLRequest ¶
type APITokenRequest ¶
type APITokenRequest struct {
Comment string `json:"comment"`
}
type APITokenResponse ¶
type APITokenResponse struct {
Data APIToken `json:"data"`
}
type Job ¶
type Job struct { ID string `db:"id" json:"id"` Store string `db:"store" json:"store"` Target string `db:"target" json:"target"` Subpath string `db:"subpath" json:"subpath"` Schedule string `db:"schedule" json:"schedule"` Comment string `db:"comment" json:"comment"` NotificationMode string `db:"notification_mode" json:"notification-mode"` Namespace string `db:"namespace" json:"ns"` NextRun *int64 `db:"next_run" json:"next-run"` LastRunUpid *string `db:"last_run_upid" json:"last-run-upid"` LastRunState *string `json:"last-run-state"` LastRunEndtime *int64 `json:"last-run-endtime"` Duration *int64 `json:"duration"` Exclusions []Exclusion `json:"exclusions"` RawExclusions string `json:"rawexclusions"` }
Job represents the pbs-disk-backup-job-status model
type PBSStatus ¶
type PBSStatus struct { BootInfo map[string]interface{} `json:"boot-info"` CPU float64 `json:"cpu"` CPUInfo map[string]interface{} `json:"cpuinfo"` CurrentKernel map[string]interface{} `json:"current-kernel"` Info map[string]string `json:"info"` KVersion string `json:"kversion"` LoadAvg []float32 `json:"loadavg"` Memory map[string]int64 `json:"memory"` Root map[string]int64 `json:"root"` Swap map[string]int64 `json:"swap"` Uptime int64 `json:"uptime"` Wait float32 `json:"wait"` }
type PBSStatusResponse ¶
type PBSStatusResponse struct {
Data PBSStatus `json:"data"`
}
type PartialFile ¶ added in v0.3.0
type Store ¶
Store holds the database instance
func Initialize ¶
Initialize initializes the database connection and returns a Store instance
func (*Store) CheckProxyAuth ¶ added in v0.3.2
func (*Store) CreateAPIToken ¶
func (*Store) CreateExclusion ¶ added in v0.3.0
func (*Store) CreatePartialFile ¶ added in v0.3.0
func (store *Store) CreatePartialFile(partialFile PartialFile) error
func (*Store) CreateTables ¶
CreateTables creates the necessary tables in the SQLite database
func (*Store) CreateTarget ¶
CreateTarget inserts a new Target into the database
func (*Store) DeleteExclusion ¶ added in v0.3.0
DeleteExclusion deletes a Exclusion from the database
func (*Store) DeletePartialFile ¶ added in v0.3.0
DeletePartialFile deletes a PartialFile from the database
func (*Store) DeleteTarget ¶
DeleteTarget deletes a Target from the database
func (*Store) GetAllGlobalExclusions ¶ added in v0.4.0
func (*Store) GetAllJobExclusions ¶ added in v0.3.0
func (*Store) GetAllJobs ¶
GetAllJobs retrieves all Job records from the database
func (*Store) GetAllPartialFiles ¶ added in v0.3.0
func (store *Store) GetAllPartialFiles() ([]PartialFile, error)
func (*Store) GetAllTargets ¶
func (*Store) GetAllTargetsByIP ¶ added in v0.3.2
func (*Store) GetExclusion ¶ added in v0.3.0
func (*Store) GetJobTask ¶ added in v0.4.0
func (*Store) GetPBSStatus ¶
func (*Store) GetPartialFile ¶ added in v0.3.0
func (store *Store) GetPartialFile(path string) (*PartialFile, error)
func (*Store) GetTaskEndTime ¶
func (*Store) ProxmoxHTTPRequest ¶
func (*Store) SetSchedule ¶
func (*Store) UpdateExclusion ¶ added in v0.3.0
UpdateExclusion updates an existing Exclusion in the database
func (*Store) UpdatePartialFile ¶ added in v0.3.0
func (store *Store) UpdatePartialFile(partialFile PartialFile) error
UpdatePartialFile updates an existing PartialFile in the database
func (*Store) UpdateTarget ¶
UpdateTarget updates an existing Target in the database
type Target ¶
type Target struct { Name string `db:"name" json:"name"` Path string `db:"path" json:"path"` IsAgent bool `json:"is_agent"` ConnectionStatus bool `json:"connection_status"` }
Target represents the pbs-model-targets model
type Task ¶
type Task struct { WID string `json:"id"` Node string `json:"node"` PID int `json:"pid"` PStart int `json:"pstart"` StartTime int64 `json:"starttime"` EndTime int64 `json:"endtime"` UPID string `json:"upid"` User string `json:"user"` WorkerType string `json:"worker_type"` Status string `json:"status"` ExitStatus string `json:"exitstatus"` }
type TaskResponse ¶
type TokenRequest ¶
type TokenResponse ¶
type TokenResponse struct {
Data Token `json:"data"`
}