Documentation
¶
Index ¶
- Constants
- func BuildSnapshotMetadata(instanceID string, userMetadata tags.Tags) tags.Tags
- func BuildSnapshotName(prefix string, runAt time.Time) string
- func InitialNextRunAt(instanceID string, interval time.Duration, now time.Time) time.Time
- func IsScheduledSnapshot(metadata tags.Tags, instanceID string) bool
- func ListInstanceIDs(dir string) ([]string, error)
- func MarshalSchedule(schedule *Schedule) ([]byte, error)
- func NextRun(previous time.Time, interval time.Duration, now time.Time) time.Time
- func ValidateSetRequest(req SetRequest, validateName func(name string) error) error
- type Retention
- type Schedule
- type SetRequest
Constants ¶
View Source
const ( MetadataKeyScheduled = "hypeman.scheduled" MetadataKeySourceInstanceID = "hypeman.schedule_instance_id" DefaultNamePrefix = "scheduled" NameTimestampFormat = "20060102-150405" MaxSnapshotNameLength = 63 MaxNamePrefixLength = MaxSnapshotNameLength - len(NameTimestampFormat) - 1 MinInterval = time.Minute )
Variables ¶
This section is empty.
Functions ¶
func BuildSnapshotMetadata ¶
func InitialNextRunAt ¶
func ListInstanceIDs ¶
func MarshalSchedule ¶
func ValidateSetRequest ¶
func ValidateSetRequest(req SetRequest, validateName func(name string) error) error
Types ¶
type Retention ¶
type Retention struct {
MaxCount int // Keep at most this many scheduled snapshots for the instance (0 = unlimited)
MaxAge time.Duration // Delete scheduled snapshots older than this age (0 = unlimited)
}
Retention defines automatic cleanup rules for scheduled snapshots.
type Schedule ¶
type Schedule struct {
InstanceID string
Interval time.Duration
NamePrefix string
Metadata tags.Tags
Retention Retention
NextRunAt time.Time
LastRunAt *time.Time
LastSnapshotID *string
LastError *string
CreatedAt time.Time
UpdatedAt time.Time
}
Schedule defines periodic snapshot capture for a single instance.
func UnmarshalSchedule ¶
Click to show internal directories.
Click to hide internal directories.