admin

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package admin is a convenience layer to support the administration of rbd volumes, snapshots, scheduling etc that is outside of the C api for librbd.

Unlike the rbd package this API does not map to APIs provided by ceph libraries themselves. This API is not yet stable and is subject to change.

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoInterval indicates no specific interval.
	NoInterval = Interval("")

	// NoStartTime indicates no specific start time.
	NoStartTime = StartTime("")
)

Functions

This section is empty.

Types

type Interval

type Interval string

Interval of time between scheduled snapshots. Typically in the form <num><m,h,d>. Exact content supported is defined internally on the ceph mgr.

type LevelSpec

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

LevelSpec values are used to identify RBD objects wherever Ceph APIs require a levelspec to select an image, pool, or namespace.

func NewLevelSpec

func NewLevelSpec(pool, namespace, image string) LevelSpec

NewLevelSpec is used to construct a LevelSpec given a pool and optional namespace and image names.

func NewRawLevelSpec

func NewRawLevelSpec(spec string) LevelSpec

NewRawLevelSpec returns a LevelSpec directly based on the spec string argument without constructing it from component values. This should only be used if NewLevelSpec can not create the levelspec value you want to pass to ceph.

type MirrorSnashotScheduleAdmin

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

MirrorSnashotScheduleAdmin encapsulates management functions for ceph rbd mirror snapshot schedules.

func (*MirrorSnashotScheduleAdmin) Add

Add a new snapshot schedule to the given pool/image based on the supplied level spec.

Similar To:

rbd mirror snapshot schedule add <level_spec> <interval> <start_time>

func (*MirrorSnashotScheduleAdmin) List

List the snapshot schedules based on the supplied level spec.

Similar To:

rbd mirror snapshot schedule list <level_spec>

func (*MirrorSnashotScheduleAdmin) Remove

Remove a snapshot schedule matching the supplied arguments.

Similar To:

rbd mirror snapshot schedule remove <level_spec> <interval> <start_time>

func (*MirrorSnashotScheduleAdmin) Status

Status returns the status of the snapshot (eg. when it will next take place) matching the supplied level spec.

Similar To:

rbd mirror snapshot schedule status <level_spec>

type RBDAdmin

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

RBDAdmin is used to administrate rbd volumes and pools.

func NewFromConn

func NewFromConn(conn ccom.RadosCommander) *RBDAdmin

NewFromConn creates an new management object from a preexisting rados connection. The existing connection can be rados.Conn or any type implementing the RadosCommander interface.

func (*RBDAdmin) MirrorSnashotSchedule

func (ra *RBDAdmin) MirrorSnashotSchedule() *MirrorSnashotScheduleAdmin

MirrorSnashotSchedule returns a MirrorSnashotScheduleAdmin type for managing ceph rbd mirror snapshot schedules.

type ScheduleTerm

type ScheduleTerm struct {
	Interval  Interval  `json:"interval"`
	StartTime StartTime `json:"start_time"`
}

ScheduleTerm represents the interval and start time component of a snapshot schedule.

type ScheduleTime

type ScheduleTime string

ScheduleTime is the time a snapshot will occur.

type ScheduledImage

type ScheduledImage struct {
	Image        string       `json:"image"`
	ScheduleTime ScheduleTime `json:"schedule_time"`
}

ScheduledImage contains the item scheduled and when it will next occur.

type SnapshotSchedule

type SnapshotSchedule struct {
	Name        string
	LevelSpecID string
	Schedule    []ScheduleTerm
}

SnapshotSchedule contains values representing an entire snapshot schedule for an image or pool.

type StartTime

type StartTime string

StartTime is the time the snapshot schedule begins. Exact content supported is defined internally on the ceph mgr.

Jump to

Keyboard shortcuts

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