disks

package
v0.0.8 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) Index

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

Index Node index.

func (*Client) Initgpt

func (c *Client) Initgpt(ctx context.Context, req *InitgptRequest) (*InitgptResponse, 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) (*WipeDiskWipediskResponse, 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 IndexResponse

type IndexResponse []*map[string]interface{}

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 InitgptResponse

type InitgptResponse string

type ListRequest

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

	// The following parameters are optional
	IncludePartitions *util.SpecialBool `url:"include-partitions,omitempty" json:"include-partitions,omitempty"` // Also include partitions.
	Skipsmart         *util.SpecialBool `url:"skipsmart,omitempty" json:"skipsmart,omitempty"`                   // Skip smart checks.
	Type              *string           `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.SpecialBool `url:"gpt" json:"gpt"`
	Mounted util.SpecialBool `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.SpecialBool `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 WipeDiskWipediskRequest

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

}

type WipeDiskWipediskResponse

type WipeDiskWipediskResponse string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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