disks

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: 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) Index

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

Index Node index.

func (*Client) Initgpt

func (c *Client) Initgpt(ctx context.Context, req InitgptRequest) (string, error)

Initgpt Initialize Disk with GPT

func (*Client) List

func (c *Client) List(ctx context.Context, req ListRequest) ([]ListResponse, error)

List List local disks.

func (*Client) Smart

func (c *Client) Smart(ctx context.Context, req SmartRequest) (SmartResponse, error)

Smart Get SMART Health of a disk.

func (*Client) WipeDiskWipedisk

func (c *Client) WipeDiskWipedisk(ctx context.Context, req WipeDiskWipediskRequest) (string, error)

WipeDiskWipedisk Wipe a disk or partition.

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 InitgptRequest

type InitgptRequest struct {
	Disk string `url:"disk" json:"disk"` // Block device name
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Uuid *string `url:"uuid,omitempty" json:"uuid,omitempty"` // UUID for the GPT table
}

type ListRequest

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

	// The following parameters are optional
	IncludePartitions *util.PVEBool `url:"include-partitions,omitempty" json:"include-partitions,omitempty"` // Also include partitions.
	Skipsmart         *util.PVEBool `url:"skipsmart,omitempty" json:"skipsmart,omitempty"`                   // Skip smart checks.
	Type              *Type         `url:"type,omitempty" json:"type,omitempty"`                             // Only list specific types of disks.
}

type ListResponse

type ListResponse struct {
	Devpath string       `url:"devpath" json:"devpath"` // The device path
	Gpt     util.PVEBool `url:"gpt" json:"gpt"`
	Mounted util.PVEBool `url:"mounted" json:"mounted"`
	Osdid   int          `url:"osdid" json:"osdid"`
	Size    int          `url:"size" json:"size"`

	// The following parameters are optional
	Health *string `url:"health,omitempty" json:"health,omitempty"`
	Model  *string `url:"model,omitempty" json:"model,omitempty"`
	Parent *string `url:"parent,omitempty" json:"parent,omitempty"` // For partitions only. The device path of the disk the partition resides on.
	Serial *string `url:"serial,omitempty" json:"serial,omitempty"`
	Used   *string `url:"used,omitempty" json:"used,omitempty"`
	Vendor *string `url:"vendor,omitempty" json:"vendor,omitempty"`
	Wwn    *string `url:"wwn,omitempty" json:"wwn,omitempty"`
}

type SmartRequest

type SmartRequest struct {
	Disk string `url:"disk" json:"disk"` // Block device name
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	Healthonly *util.PVEBool `url:"healthonly,omitempty" json:"healthonly,omitempty"` // If true returns only the health status
}

type SmartResponse

type SmartResponse struct {
	Health string `url:"health" json:"health"`

	// The following parameters are optional
	Attributes *[]map[string]interface{} `url:"attributes,omitempty" json:"attributes,omitempty"`
	Text       *string                   `url:"text,omitempty" json:"text,omitempty"`
	Type       *string                   `url:"type,omitempty" json:"type,omitempty"`
}

type Type added in v0.0.15

type Type string
const (
	Type_UNUSED        Type = "unused"
	Type_JOURNAL_DISKS Type = "journal_disks"
)

func PtrType added in v0.0.15

func PtrType(i Type) *Type

type WipeDiskWipediskRequest

type WipeDiskWipediskRequest struct {
	Disk string `url:"disk" json:"disk"` // Block device name
	Node string `url:"node" json:"node"` // The cluster node name.

}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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