cephutils

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TIMTOUT_SECOND = 15

Variables

This section is empty.

Functions

This section is empty.

Types

type CephClient

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

func NewClient

func NewClient(monHost, key, pool string) (*CephClient, error)

func (*CephClient) Child

func (cli *CephClient) Child(pool string) *CephClient

func (*CephClient) Close

func (cli *CephClient) Close() error

func (*CephClient) CreateImage

func (cli *CephClient) CreateImage(name string, sizeMb int64) (*SImage, error)

func (*CephClient) GetCapacity

func (cli *CephClient) GetCapacity() (*SCapacity, error)

* {"kb_used":193408,"bytes_used":198049792,"percent_used":0.32,"bytes_used2":0,"percent_used2":0.00,"osd_max_used":0,"osd_max_used_ratio":0.32,"max_avail":61003137024,"objects":1,"origin_bytes":0,"compress_bytes":0} * {"stored":6198990973173,"objects":1734699,"kb_used":12132844593,"bytes_used":12424032862699,"percent_used":0.30800202488899231,"max_avail":13956734255104}

func (*CephClient) GetImage

func (cli *CephClient) GetImage(name string) (*SImage, error)

func (*CephClient) ListImages

func (cli *CephClient) ListImages() ([]string, error)

func (*CephClient) Output

func (cli *CephClient) Output(name string, opts []string) (jsonutils.JSONObject, error)

func (*CephClient) SetTimeout

func (cli *CephClient) SetTimeout(timeout int)

func (*CephClient) ShowConf

func (cli *CephClient) ShowConf() error

type SCapacity

type SCapacity struct {
	CapacitySizeKb     int64
	UsedCapacitySizeKb int64
}

type SChildren

type SChildren struct {
	Pool          string
	PoolNamespace string
	Image         string
}

type SImage

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

func (*SImage) Clone

func (img *SImage) Clone(ctx context.Context, pool, name string) (*SImage, error)

func (*SImage) CreateSnapshot

func (img *SImage) CreateSnapshot(name string) (*SSnapshot, error)

func (*SImage) Delete

func (img *SImage) Delete() error

func (*SImage) Flatten

func (img *SImage) Flatten() error

func (*SImage) GetInfo

func (img *SImage) GetInfo() (*SImageInfo, error)

func (*SImage) GetName

func (img *SImage) GetName() string

func (*SImage) GetSnapshot

func (img *SImage) GetSnapshot(name string) (*SSnapshot, error)

func (*SImage) IsSnapshotExist

func (img *SImage) IsSnapshotExist(name string) (bool, error)

func (*SImage) ListSnapshots

func (img *SImage) ListSnapshots() ([]SSnapshot, error)

func (*SImage) Remove

func (img *SImage) Remove() error

func (*SImage) Rename

func (img *SImage) Rename(name string) error

func (*SImage) Resize

func (img *SImage) Resize(sizeMb int64) error

type SImageInfo

type SImageInfo struct {
	Name            string        `json:"name"`
	ID              string        `json:"id"`
	SizeByte        int64         `json:"size"`
	Objects         int           `json:"objects"`
	Order           int           `json:"order"`
	ObjectSize      int           `json:"object_size"`
	SnapshotCount   int           `json:"snapshot_count"`
	BlockNamePrefix string        `json:"block_name_prefix"`
	Format          int           `json:"format"`
	Features        []string      `json:"features"`
	OpFeatures      []interface{} `json:"op_features"`
	Flags           []interface{} `json:"flags"`
	CreateTimestamp time.Time     `json:"create_timestamp"`
	AccessTimestamp time.Time     `json:"access_timestamp"`
	ModifyTimestamp time.Time     `json:"modify_timestamp"`
}

type SSnapshot

type SSnapshot struct {
	Name string
	Id   string
	Size int64
	// Protected bool
	Timestamp string
	// contains filtered or unexported fields
}

func (*SSnapshot) Clone

func (snap *SSnapshot) Clone(pool, name string, flattern bool) (*SImage, error)

func (*SSnapshot) Delete

func (snap *SSnapshot) Delete() error

func (*SSnapshot) GetName

func (snap *SSnapshot) GetName() string

func (*SSnapshot) ListChildren

func (snap *SSnapshot) ListChildren() ([]SChildren, error)

func (*SSnapshot) Remove

func (snap *SSnapshot) Remove() error

func (*SSnapshot) Rollback

func (snap *SSnapshot) Rollback() error

func (*SSnapshot) Unprotect

func (snap *SSnapshot) Unprotect() error

Jump to

Keyboard shortcuts

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