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 ¶
- Variables
- type Interval
- type LevelSpec
- type MirrorSnashotScheduleAdmin
- func (mss *MirrorSnashotScheduleAdmin) Add(l LevelSpec, i Interval, s StartTime) error
- func (mss *MirrorSnashotScheduleAdmin) List(l LevelSpec) ([]SnapshotSchedule, error)
- func (mss *MirrorSnashotScheduleAdmin) Remove(l LevelSpec, i Interval, s StartTime) error
- func (mss *MirrorSnashotScheduleAdmin) Status(l LevelSpec) ([]ScheduledImage, error)
- type RBDAdmin
- type ScheduleTerm
- type ScheduleTime
- type ScheduledImage
- type SnapshotSchedule
- type StartTime
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewLevelSpec is used to construct a LevelSpec given a pool and optional namespace and image names.
func NewRawLevelSpec ¶
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 ¶
func (mss *MirrorSnashotScheduleAdmin) Add(l LevelSpec, i Interval, s StartTime) error
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 ¶
func (mss *MirrorSnashotScheduleAdmin) List(l LevelSpec) ([]SnapshotSchedule, error)
List the snapshot schedules based on the supplied level spec.
Similar To:
rbd mirror snapshot schedule list <level_spec>
func (*MirrorSnashotScheduleAdmin) Remove ¶
func (mss *MirrorSnashotScheduleAdmin) Remove( l LevelSpec, i Interval, s StartTime) error
Remove a snapshot schedule matching the supplied arguments.
Similar To:
rbd mirror snapshot schedule remove <level_spec> <interval> <start_time>
func (*MirrorSnashotScheduleAdmin) Status ¶
func (mss *MirrorSnashotScheduleAdmin) Status(l LevelSpec) ([]ScheduledImage, error)
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 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.