zfs

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) (*CreateResponse, error)

Create Create a ZFS pool.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, 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 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 string `url:"raidlevel",json:"raidlevel"` // The RAID level to use.

	// The following parameters are optional
	AddStorage  *util.SpecialBool `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 *string           `url:"compression,omitempty",json:"compression,omitempty"` // The compression algorithm to use.
	DraidConfig *string           `url:"draid-config,omitempty",json:"draid-config,omitempty"`
}

type CreateResponse

type CreateResponse string

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.SpecialBool `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.SpecialBool `url:"cleanup-disks,omitempty",json:"cleanup-disks,omitempty"`   // Also wipe disks so they can be repurposed afterwards.
}

type DeleteResponse

type DeleteResponse string

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 []*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"`
	} `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"`
}

Jump to

Keyboard shortcuts

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