pools

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Application_RBD    Application = "rbd"
	Application_CEPHFS Application = "cephfs"
	Application_RGW    Application = "rgw"

	PgAutoscaleMode_ON   PgAutoscaleMode = "on"
	PgAutoscaleMode_OFF  PgAutoscaleMode = "off"
	PgAutoscaleMode_WARN PgAutoscaleMode = "warn"

	Type_REPLICATED Type = "replicated"
	Type_ERASURE    Type = "erasure"
	Type_UNKNOWN    Type = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application added in v0.0.15

type Application string

func PtrApplication added in v0.0.15

func PtrApplication(i Application) *Application

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, req CreateRequest) (string, error)

Create Create Ceph pool. Deprecated, please use `/nodes/{node}/ceph/pool`.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req DeleteRequest) (string, error)

Delete Destroy pool. Deprecated, please use `/nodes/{node}/ceph/pool/{name}`.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req FindRequest) (FindResponse, error)

Find List pool settings. Deprecated, please use `/nodes/{node}/ceph/pool/{pool}/status`.

func (*Client) Index

func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)

Index List all pools. Deprecated, please use `/nodes/{node}/ceph/pool`.

func (*Client) Update

func (c *Client) Update(ctx context.Context, req UpdateRequest) (string, error)

Update Change POOL settings. Deprecated, please use `/nodes/{node}/ceph/pool/{name}`.

type CreateRequest

type CreateRequest struct {
	Name string `url:"name" json:"name"` // The name of the pool. It must be unique.
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	AddStorages     *util.PVEBool    `url:"add_storages,omitempty" json:"add_storages,omitempty"`           // Configure VM and CT storage using the new pool.
	Application     *Application     `url:"application,omitempty" json:"application,omitempty"`             // The application of the pool.
	CrushRule       *string          `url:"crush_rule,omitempty" json:"crush_rule,omitempty"`               // The rule to use for mapping object placement in the cluster.
	ErasureCoding   *ErasureCoding   `url:"erasure-coding,omitempty" json:"erasure-coding,omitempty"`       // Create an erasure coded pool for RBD with an accompaning replicated pool for metadata storage. With EC, the common ceph options 'size', 'min_size' and 'crush_rule' parameters will be applied to the metadata pool.
	MinSize         *int             `url:"min_size,omitempty" json:"min_size,omitempty"`                   // Minimum number of replicas per object
	PgAutoscaleMode *PgAutoscaleMode `url:"pg_autoscale_mode,omitempty" json:"pg_autoscale_mode,omitempty"` // The automatic PG scaling mode of the pool.
	PgNum           *int             `url:"pg_num,omitempty" json:"pg_num,omitempty"`                       // Number of placement groups.
	PgNumMin        *int             `url:"pg_num_min,omitempty" json:"pg_num_min,omitempty"`               // Minimal number of placement groups.
	Size            *int             `url:"size,omitempty" json:"size,omitempty"`                           // Number of replicas per object
	TargetSize      *string          `url:"target_size,omitempty" json:"target_size,omitempty"`             // The estimated target size of the pool for the PG autoscaler.
	TargetSizeRatio *float64         `url:"target_size_ratio,omitempty" json:"target_size_ratio,omitempty"` // The estimated target ratio of the pool for the PG autoscaler.
}

type DeleteRequest

type DeleteRequest struct {
	Name string `url:"name" json:"name"` // The name of the pool. It must be unique.
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Force           *util.PVEBool `url:"force,omitempty" json:"force,omitempty"`                       // If true, destroys pool even if in use
	RemoveEcprofile *util.PVEBool `url:"remove_ecprofile,omitempty" json:"remove_ecprofile,omitempty"` // Remove the erasure code profile. Defaults to true, if applicable.
	RemoveStorages  *util.PVEBool `url:"remove_storages,omitempty" json:"remove_storages,omitempty"`   // Remove all pveceph-managed storages configured for this pool
}

type ErasureCoding added in v0.0.10

type ErasureCoding struct {
	K int `url:"k" json:"k"` // Number of data chunks. Will create an erasure coded pool plus a replicated pool for metadata.
	M int `url:"m" json:"m"` // Number of coding chunks. Will create an erasure coded pool plus a replicated pool for metadata.

	// The following parameters are optional
	DeviceClass   *string `url:"device-class,omitempty" json:"device-class,omitempty"`     // CRUSH device class. Will create an erasure coded pool plus a replicated pool for metadata.
	FailureDomain *string `url:"failure-domain,omitempty" json:"failure-domain,omitempty"` // CRUSH failure domain. Default is 'host'. Will create an erasure coded pool plus a replicated pool for metadata.
	Profile       *string `url:"profile,omitempty" json:"profile,omitempty"`               // Override the erasure code (EC) profile to use. Will create an erasure coded pool plus a replicated pool for metadata.
}

Create an erasure coded pool for RBD with an accompaning replicated pool for metadata storage. With EC, the common ceph options 'size', 'min_size' and 'crush_rule' parameters will be applied to the metadata pool.

func (ErasureCoding) EncodeValues added in v0.0.10

func (t ErasureCoding) EncodeValues(key string, v *url.Values) error

func (*ErasureCoding) UnmarshalJSON added in v0.0.19

func (t *ErasureCoding) UnmarshalJSON(d []byte) error

type FindRequest

type FindRequest struct {
	Name string `url:"name" json:"name"` // The name of the pool. It must be unique.
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Verbose *util.PVEBool `url:"verbose,omitempty" json:"verbose,omitempty"` // If enabled, will display additional data(eg. statistics).
}

type FindResponse

type FindResponse struct {
	FastRead             util.PVEBool `url:"fast_read" json:"fast_read"`
	Hashpspool           util.PVEBool `url:"hashpspool" json:"hashpspool"`
	Id                   int          `url:"id" json:"id"`
	Name                 string       `url:"name" json:"name"` // The name of the pool. It must be unique.
	NodeepScrub          util.PVEBool `url:"nodeep-scrub" json:"nodeep-scrub"`
	Nodelete             util.PVEBool `url:"nodelete" json:"nodelete"`
	Nopgchange           util.PVEBool `url:"nopgchange" json:"nopgchange"`
	Noscrub              util.PVEBool `url:"noscrub" json:"noscrub"`
	Nosizechange         util.PVEBool `url:"nosizechange" json:"nosizechange"`
	PgpNum               int          `url:"pgp_num" json:"pgp_num"`
	UseGmtHitset         util.PVEBool `url:"use_gmt_hitset" json:"use_gmt_hitset"`
	WriteFadviseDontneed util.PVEBool `url:"write_fadvise_dontneed" json:"write_fadvise_dontneed"`

	// The following parameters are optional
	Application     *Application              `url:"application,omitempty" json:"application,omitempty"` // The application of the pool.
	ApplicationList *[]map[string]interface{} `url:"application_list,omitempty" json:"application_list,omitempty"`
	AutoscaleStatus *map[string]interface{}   `url:"autoscale_status,omitempty" json:"autoscale_status,omitempty"`
	CrushRule       *string                   `url:"crush_rule,omitempty" json:"crush_rule,omitempty"`               // The rule to use for mapping object placement in the cluster.
	MinSize         *int                      `url:"min_size,omitempty" json:"min_size,omitempty"`                   // Minimum number of replicas per object
	PgAutoscaleMode *PgAutoscaleMode          `url:"pg_autoscale_mode,omitempty" json:"pg_autoscale_mode,omitempty"` // The automatic PG scaling mode of the pool.
	PgNum           *int                      `url:"pg_num,omitempty" json:"pg_num,omitempty"`                       // Number of placement groups.
	PgNumMin        *int                      `url:"pg_num_min,omitempty" json:"pg_num_min,omitempty"`               // Minimal number of placement groups.
	Size            *int                      `url:"size,omitempty" json:"size,omitempty"`                           // Number of replicas per object
	Statistics      *map[string]interface{}   `url:"statistics,omitempty" json:"statistics,omitempty"`
	TargetSize      *string                   `url:"target_size,omitempty" json:"target_size,omitempty"`             // The estimated target size of the pool for the PG autoscaler.
	TargetSizeRatio *float64                  `url:"target_size_ratio,omitempty" json:"target_size_ratio,omitempty"` // The estimated target ratio of the pool for the PG autoscaler.
}

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 IndexResponse

type IndexResponse struct {
	BytesUsed     int     `url:"bytes_used" json:"bytes_used"`
	CrushRule     int     `url:"crush_rule" json:"crush_rule"`
	CrushRuleName string  `url:"crush_rule_name" json:"crush_rule_name"`
	MinSize       int     `url:"min_size" json:"min_size"`
	PercentUsed   float64 `url:"percent_used" json:"percent_used"`
	PgNum         int     `url:"pg_num" json:"pg_num"`
	Pool          int     `url:"pool" json:"pool"`
	PoolName      string  `url:"pool_name" json:"pool_name"`
	Size          int     `url:"size" json:"size"`
	Type          Type    `url:"type" json:"type"`

	// The following parameters are optional
	ApplicationMetadata *map[string]interface{} `url:"application_metadata,omitempty" json:"application_metadata,omitempty"`
	AutoscaleStatus     *map[string]interface{} `url:"autoscale_status,omitempty" json:"autoscale_status,omitempty"`
	PgAutoscaleMode     *string                 `url:"pg_autoscale_mode,omitempty" json:"pg_autoscale_mode,omitempty"`
	PgNumFinal          *int                    `url:"pg_num_final,omitempty" json:"pg_num_final,omitempty"`
	PgNumMin            *int                    `url:"pg_num_min,omitempty" json:"pg_num_min,omitempty"`
	TargetSize          *int                    `url:"target_size,omitempty" json:"target_size,omitempty"`
	TargetSizeRatio     *float64                `url:"target_size_ratio,omitempty" json:"target_size_ratio,omitempty"`
}

type PgAutoscaleMode added in v0.0.15

type PgAutoscaleMode string

func PtrPgAutoscaleMode added in v0.0.15

func PtrPgAutoscaleMode(i PgAutoscaleMode) *PgAutoscaleMode

type Type added in v0.0.15

type Type string

func PtrType added in v0.0.15

func PtrType(i Type) *Type

type UpdateRequest

type UpdateRequest struct {
	Name string `url:"name" json:"name"` // The name of the pool. It must be unique.
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Application     *Application     `url:"application,omitempty" json:"application,omitempty"`             // The application of the pool.
	CrushRule       *string          `url:"crush_rule,omitempty" json:"crush_rule,omitempty"`               // The rule to use for mapping object placement in the cluster.
	MinSize         *int             `url:"min_size,omitempty" json:"min_size,omitempty"`                   // Minimum number of replicas per object
	PgAutoscaleMode *PgAutoscaleMode `url:"pg_autoscale_mode,omitempty" json:"pg_autoscale_mode,omitempty"` // The automatic PG scaling mode of the pool.
	PgNum           *int             `url:"pg_num,omitempty" json:"pg_num,omitempty"`                       // Number of placement groups.
	PgNumMin        *int             `url:"pg_num_min,omitempty" json:"pg_num_min,omitempty"`               // Minimal number of placement groups.
	Size            *int             `url:"size,omitempty" json:"size,omitempty"`                           // Number of replicas per object
	TargetSize      *string          `url:"target_size,omitempty" json:"target_size,omitempty"`             // The estimated target size of the pool for the PG autoscaler.
	TargetSizeRatio *float64         `url:"target_size_ratio,omitempty" json:"target_size_ratio,omitempty"` // The estimated target ratio of the pool for the PG autoscaler.
}

Jump to

Keyboard shortcuts

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