ceph

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfPoolExists

func CheckIfPoolExists(conn *rados.Conn, pool string) error

func ConnectToRados

func ConnectToRados(ctx context.Context, c Credentials) (*rados.Conn, error)

func GetKeyFromKeyring

func GetKeyFromKeyring(keyringFile string) (string, error)

Types

type Command

type Command interface {
	PoolStats() (*PoolStats, error)
}

type CommandClient

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

func NewCommandClient

func NewCommandClient(conn *rados.Conn, poolName string) (*CommandClient, error)

func (*CommandClient) PoolStats

func (c *CommandClient) PoolStats() (*PoolStats, error)

type CommandRequest

type CommandRequest struct {
	Prefix string `json:"prefix"`
	Detail string `json:"detail"`
	Format string `json:"format"`
}

type Credentials

type Credentials struct {
	Monitors string
	User     string
	Keyfile  string
}

type DfCommandResponse

type DfCommandResponse struct {
	Stats        Stats        `json:"stats"`
	StatsByClass StatsByClass `json:"stats_by_class"`
	Pools        []Pool       `json:"pools"`
}

type Pool

type Pool struct {
	Name  string    `json:"name"`
	Id    int       `json:"id"`
	Stats PoolStats `json:"stats"`
}

type PoolStats

type PoolStats struct {
	Stored      int     `json:"stored"`
	Objects     int     `json:"objects"`
	KbUsed      int     `json:"kb_used"`
	BytesUsed   int     `json:"bytes_used"`
	PercentUsed float64 `json:"percent_used"`
	MaxAvail    int64   `json:"max_avail"`
}

type Stats

type Stats struct {
	TotalBytes         int64   `json:"total_bytes"`
	TotalAvailBytes    int64   `json:"total_avail_bytes"`
	TotalUsedBytes     int     `json:"total_used_bytes"`
	TotalUsedRawBytes  int     `json:"total_used_raw_bytes"`
	TotalUsedRawRatio  float64 `json:"total_used_raw_ratio"`
	NumOsds            int     `json:"num_osds"`
	NumPerPoolOsds     int     `json:"num_per_pool_osds"`
	NumPerPoolOmapOsds int     `json:"num_per_pool_omap_osds"`
}

type StatsByClass

type StatsByClass map[string]struct {
	TotalBytes        int64   `json:"total_bytes"`
	TotalAvailBytes   int64   `json:"total_avail_bytes"`
	TotalUsedBytes    int     `json:"total_used_bytes"`
	TotalUsedRawBytes int     `json:"total_used_raw_bytes"`
	TotalUsedRawRatio float64 `json:"total_used_raw_ratio"`
}

Jump to

Keyboard shortcuts

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