zfs

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 (
	Compression_ON   Compression = "on"
	Compression_OFF  Compression = "off"
	Compression_GZIP Compression = "gzip"
	Compression_LZ4  Compression = "lz4"
	Compression_LZJB Compression = "lzjb"
	Compression_ZLE  Compression = "zle"
	Compression_ZSTD Compression = "zstd"

	Raidlevel_SINGLE Raidlevel = "single"
	Raidlevel_MIRROR Raidlevel = "mirror"
	Raidlevel_RAID10 Raidlevel = "raid10"
	Raidlevel_RAIDZ  Raidlevel = "raidz"
	Raidlevel_RAIDZ2 Raidlevel = "raidz2"
	Raidlevel_RAIDZ3 Raidlevel = "raidz3"
	Raidlevel_DRAID  Raidlevel = "draid"
	Raidlevel_DRAID2 Raidlevel = "draid2"
	Raidlevel_DRAID3 Raidlevel = "draid3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Children added in v0.0.10

type Children struct {
	Msg  string `url:"msg" json:"msg"`   // An optional message about the vdev.
	Name string `url:"name" json:"name"` // The name of the vdev or section.

	// The following parameters are optional
	Cksum *float64 `url:"cksum,omitempty" json:"cksum,omitempty"`
	Read  *float64 `url:"read,omitempty" json:"read,omitempty"`
	State *string  `url:"state,omitempty" json:"state,omitempty"` // The state of the vdev.
	Write *float64 `url:"write,omitempty" json:"write,omitempty"`
}

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 a ZFS pool.

func (*Client) Delete

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

Delete Destroy a ZFS pool.

func (*Client) Find

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

Find Get details about a zpool.

func (*Client) Index

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

Index List Zpools.

type Compression added in v0.0.15

type Compression string

func PtrCompression added in v0.0.15

func PtrCompression(i Compression) *Compression

type CreateRequest

type CreateRequest struct {
	Devices   string    `url:"devices" json:"devices"`     // The block devices you want to create the zpool on.
	Name      string    `url:"name" json:"name"`           // The storage identifier.
	Node      string    `url:"node" json:"node"`           // The cluster node name.
	Raidlevel Raidlevel `url:"raidlevel" json:"raidlevel"` // The RAID level to use.

	// The following parameters are optional
	AddStorage  *util.PVEBool `url:"add_storage,omitempty" json:"add_storage,omitempty"` // Configure storage using the zpool.
	Ashift      *int          `url:"ashift,omitempty" json:"ashift,omitempty"`           // Pool sector size exponent.
	Compression *Compression  `url:"compression,omitempty" json:"compression,omitempty"` // The compression algorithm to use.
	DraidConfig *DraidConfig  `url:"draid-config,omitempty" json:"draid-config,omitempty"`
}

type DeleteRequest

type DeleteRequest struct {
	Name string `url:"name" json:"name"` // The storage identifier.
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	CleanupConfig *util.PVEBool `url:"cleanup-config,omitempty" json:"cleanup-config,omitempty"` // Marks associated storage(s) as not available on this node anymore or removes them from the configuration (if configured for this node only).
	CleanupDisks  *util.PVEBool `url:"cleanup-disks,omitempty" json:"cleanup-disks,omitempty"`   // Also wipe disks so they can be repurposed afterwards.
}

type DraidConfig added in v0.0.10

type DraidConfig struct {
	Data   int `url:"data" json:"data"`     // The number of data devices per redundancy group. (dRAID)
	Spares int `url:"spares" json:"spares"` // Number of dRAID spares.

}

func (DraidConfig) EncodeValues added in v0.0.10

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

func (*DraidConfig) UnmarshalJSON added in v0.0.19

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

type FindRequest

type FindRequest struct {
	Name string `url:"name" json:"name"` // The storage identifier.
	Node string `url:"node" json:"node"` // The cluster node name.

}

type FindResponse

type FindResponse struct {
	Children []Children `url:"children" json:"children"` // The pool configuration information, including the vdevs for each section (e.g. spares, cache), may be nested.
	Errors   string     `url:"errors" json:"errors"`     // Information about the errors on the zpool.
	Name     string     `url:"name" json:"name"`         // The name of the zpool.
	State    string     `url:"state" json:"state"`       // The state of the zpool.

	// The following parameters are optional
	Action *string `url:"action,omitempty" json:"action,omitempty"` // Information about the recommended action to fix the state.
	Scan   *string `url:"scan,omitempty" json:"scan,omitempty"`     // Information about the last/current scrub.
	Status *string `url:"status,omitempty" json:"status,omitempty"` // Information about the state of the zpool.
}

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 {
	Alloc  int     `url:"alloc" json:"alloc"`
	Dedup  float64 `url:"dedup" json:"dedup"`
	Frag   int     `url:"frag" json:"frag"`
	Free   int     `url:"free" json:"free"`
	Health string  `url:"health" json:"health"`
	Name   string  `url:"name" json:"name"`
	Size   int     `url:"size" json:"size"`
}

type Raidlevel added in v0.0.15

type Raidlevel string

func PtrRaidlevel added in v0.0.15

func PtrRaidlevel(i Raidlevel) *Raidlevel

Jump to

Keyboard shortcuts

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