utils

package
v0.4.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvStrArrayToPtr

func ConvStrArrayToPtr(strArr []string) []*string

ConvStrArrayToPtr converts the slice of strings to a slice of pointers to str

func GetMappedRBDs

func GetMappedRBDs() (map[string]string, error)

GetMappedRBDs returns a map of RBDs currently mapped to the *local* host

func GetRBDStatus

func GetRBDStatus(pool, image *string) (map[string]interface{}, error)

GetRBDStatus returns a map of RBD status info

func GetRadosPools

func GetRadosPools() ([]*string, error)

GetRadosPools returns a slice containing all the pool names

func GetVolumeID

func GetVolumeID(pool, image *string) *string

GetVolumeID returns an RBD Volume formatted as <pool>.<imageName>

func RBDCreate

func RBDCreate(
	pool *string,
	image *string,
	sizeGB *int64,
	objectSize *string,
	features []*string) error

RBDCreate creates a new RBD volume on the cluster

func RBDHasWatchers

func RBDHasWatchers(pool *string, image *string) (bool, error)

RBDHasWatchers returns true if RBD image has watchers

func RBDMap

func RBDMap(pool, image *string) (string, error)

RBDMap attaches the given RBD image to the *local* host

func RBDRemove

func RBDRemove(pool *string, image *string) error

RBDRemove deletes the RBD volume on the cluster

func RBDUnmap

func RBDUnmap(device *string) error

RBDUnmap detaches the given RBD device from the *local* host

Types

type RBDImage

type RBDImage struct {
	Name   string `json:"image"`
	Size   int64  `json:"size"`
	Format uint   `json:"format"`
	Pool   string
}

RBDImage holds details about an RBD image

func GetRBDImages

func GetRBDImages(pool *string) ([]*RBDImage, error)

GetRBDImages returns a slice of RBD image info

type RBDInfo

type RBDInfo struct {
	Name            string   `json:"name"`
	Size            int64    `json:"size"`
	Objects         int64    `json:"objects"`
	Order           int64    `json:"order"`
	ObjectSize      int64    `json:"object_size"`
	BlockNamePrefix string   `json:"block_name_prefix"`
	Format          int64    `json:"format"`
	Features        []string `json:"features"`
	Pool            string
}

RBDInfo holds low-level details about an RBD image

func GetRBDInfo

func GetRBDInfo(pool *string, name *string) (*RBDInfo, error)

GetRBDInfo gets low-level details about an RBD image

Jump to

Keyboard shortcuts

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