ceph

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Action_STOP    Action = "stop"
	Action_DESTROY Action = "destroy"

	Service_OSD Service = "osd"
	Service_MON Service = "mon"
	Service_MDS Service = "mds"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.0.15

type Action string

func PtrAction added in v0.0.15

func PtrAction(i Action) *Action

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) CmdSafety

func (c *Client) CmdSafety(ctx context.Context, req CmdSafetyRequest) (CmdSafetyResponse, error)

CmdSafety Heuristical check if it is safe to perform an action.

func (*Client) Config

func (c *Client) Config(ctx context.Context, req ConfigRequest) (string, error)

Config Get the Ceph configuration file. Deprecated, please use `/nodes/{node}/ceph/cfg/raw.

func (*Client) Configdb

func (c *Client) Configdb(ctx context.Context, req ConfigdbRequest) ([]ConfigdbResponse, error)

Configdb Get the Ceph configuration database. Deprecated, please use `/nodes/{node}/ceph/cfg/db.

func (*Client) Crush

func (c *Client) Crush(ctx context.Context, req CrushRequest) (string, error)

Crush Get OSD crush map

func (*Client) Index

func (c *Client) Index(ctx context.Context, req IndexRequest) ([]map[string]interface{}, error)

Index Directory index.

func (*Client) Init

func (c *Client) Init(ctx context.Context, req InitRequest) error

Init Create initial ceph default configuration and setup symlinks.

func (*Client) Log

func (c *Client) Log(ctx context.Context, req LogRequest) ([]LogResponse, error)

Log Read ceph log

func (*Client) Restart

func (c *Client) Restart(ctx context.Context, req RestartRequest) (string, error)

Restart Restart ceph services.

func (*Client) Rules

func (c *Client) Rules(ctx context.Context, req RulesRequest) ([]RulesResponse, error)

Rules List ceph rules.

func (*Client) Start

func (c *Client) Start(ctx context.Context, req StartRequest) (string, error)

Start Start ceph services.

func (*Client) Status

func (c *Client) Status(ctx context.Context, req StatusRequest) (map[string]interface{}, error)

Status Get ceph status.

func (*Client) Stop

func (c *Client) Stop(ctx context.Context, req StopRequest) (string, error)

Stop Stop ceph services.

type CmdSafetyRequest

type CmdSafetyRequest struct {
	Action  Action  `url:"action" json:"action"`   // Action to check
	Id      string  `url:"id" json:"id"`           // ID of the service
	Node    string  `url:"node" json:"node"`       // The cluster node name.
	Service Service `url:"service" json:"service"` // Service type

}

type CmdSafetyResponse

type CmdSafetyResponse struct {
	Safe util.PVEBool `url:"safe" json:"safe"` // If it is safe to run the command.

	// The following parameters are optional
	Status *string `url:"status,omitempty" json:"status,omitempty"` // Status message given by Ceph.
}

type ConfigRequest

type ConfigRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type ConfigdbRequest

type ConfigdbRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type ConfigdbResponse

type ConfigdbResponse struct {
	CanUpdateAtRuntime util.PVEBool `url:"can_update_at_runtime" json:"can_update_at_runtime"`
	Level              string       `url:"level" json:"level"`
	Mask               string       `url:"mask" json:"mask"`
	Name               string       `url:"name" json:"name"`
	Section            string       `url:"section" json:"section"`
	Value              string       `url:"value" json:"value"`
}

type CrushRequest

type CrushRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type InitRequest

type InitRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	ClusterNetwork *string       `url:"cluster-network,omitempty" json:"cluster-network,omitempty"` // Declare a separate cluster network, OSDs will routeheartbeat, object replication and recovery traffic over it
	DisableCephx   *util.PVEBool `url:"disable_cephx,omitempty" json:"disable_cephx,omitempty"`     // Disable cephx authentication. WARNING: cephx is a security feature protecting against man-in-the-middle attacks. Only consider disabling cephx if your network is private!
	MinSize        *int          `url:"min_size,omitempty" json:"min_size,omitempty"`               // Minimum number of available replicas per object to allow I/O
	Network        *string       `url:"network,omitempty" json:"network,omitempty"`                 // Use specific network for all ceph related traffic
	PgBits         *int          `url:"pg_bits,omitempty" json:"pg_bits,omitempty"`                 // Placement group bits, used to specify the default number of placement groups. NOTE: 'osd pool default pg num' does not work for default pools.
	Size           *int          `url:"size,omitempty" json:"size,omitempty"`                       // Targeted number of replicas per object
}

type LogRequest

type LogRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Limit *int `url:"limit,omitempty" json:"limit,omitempty"`
	Start *int `url:"start,omitempty" json:"start,omitempty"`
}

type LogResponse

type LogResponse struct {
	N int    `url:"n" json:"n"` // Line number
	T string `url:"t" json:"t"` // Line text

}

type RestartRequest

type RestartRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Service *string `url:"service,omitempty" json:"service,omitempty"` // Ceph service name.
}

type RulesRequest

type RulesRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type RulesResponse

type RulesResponse struct {
	Name string `url:"name" json:"name"` // Name of the CRUSH rule.

}

type Service added in v0.0.15

type Service string

func PtrService added in v0.0.15

func PtrService(i Service) *Service

type StartRequest

type StartRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Service *string `url:"service,omitempty" json:"service,omitempty"` // Ceph service name.
}

type StatusRequest

type StatusRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

}

type StopRequest

type StopRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Service *string `url:"service,omitempty" json:"service,omitempty"` // Ceph service name.
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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