disk

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

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

func New

func New(hostAPI diskapi.HostAPI) (*Disk, error)

func (*Disk) GetDiskState

func (d *Disk) GetDiskState(context context.Context, request *GetDiskStateRequest) (*GetDiskStateResponse, error)

func (*Disk) GetDiskStats

func (d *Disk) GetDiskStats(context context.Context, request *GetDiskStatsRequest) (*GetDiskStatsResponse, error)

func (*Disk) ListDiskIDs

func (d *Disk) ListDiskIDs(context context.Context, request *ListDiskIDsRequest) (*ListDiskIDsResponse, error)

func (*Disk) ListDiskLocations

func (d *Disk) ListDiskLocations(context context.Context, request *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error)

func (*Disk) PartitionDisk

func (d *Disk) PartitionDisk(context context.Context, request *PartitionDiskRequest) (*PartitionDiskResponse, error)

func (*Disk) Rescan

func (d *Disk) Rescan(context context.Context, request *RescanRequest) (*RescanResponse, error)

func (*Disk) SetDiskState

func (d *Disk) SetDiskState(context context.Context, request *SetDiskStateRequest) (*SetDiskStateResponse, error)

type DiskIDs

type DiskIDs struct {
	// Map of Disk ID types and Disk ID values
	Page83 string

	// The disk serial number
	SerialNumber string
}

type DiskLocation

type DiskLocation struct {
	Adapter string
	Bus     string
	Target  string
	LUNID   string
}

type GetDiskStateRequest

type GetDiskStateRequest struct {
	// Disk device ID of the disk
	DiskNumber uint32
}

type GetDiskStateResponse

type GetDiskStateResponse struct {
	// Online state of the disk. true for online, false for offline
	IsOnline bool
}

type GetDiskStatsRequest

type GetDiskStatsRequest struct {
	// Disk device number of the disk to get the stats from
	DiskNumber uint32
}

type GetDiskStatsResponse

type GetDiskStatsResponse struct {
	TotalBytes int64
}

type Interface

type Interface interface {
	// GetDiskState gets the offline/online state of a disk.
	GetDiskState(context.Context, *GetDiskStateRequest) (*GetDiskStateResponse, error)

	// GetDiskStats returns the stats of a disk (currently it returns the disk size).
	GetDiskStats(context.Context, *GetDiskStatsRequest) (*GetDiskStatsResponse, error)

	// ListDiskIDs returns a map of DiskID objects where the key is the disk number.
	ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error)

	// ListDiskLocations returns locations <Adapter, Bus, Target, LUN ID> of all
	// disk devices enumerated by the host.
	ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error)

	// PartitionDisk initializes and partitions a disk device with the GPT partition style
	// (if the disk has not been partitioned already) and returns the resulting volume device ID.
	PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error)

	// Rescan refreshes the host's storage cache.
	Rescan(context.Context, *RescanRequest) (*RescanResponse, error)

	// SetDiskState sets the offline/online state of a disk.
	SetDiskState(context.Context, *SetDiskStateRequest) (*SetDiskStateResponse, error)
}

type ListDiskIDsRequest

type ListDiskIDsRequest struct {
}

type ListDiskIDsResponse

type ListDiskIDsResponse struct {
	// Map of disk device numbers and IDs associated with each disk device
	DiskIDs map[uint32]*DiskIDs
}

type ListDiskLocationsRequest

type ListDiskLocationsRequest struct {
}

type ListDiskLocationsResponse

type ListDiskLocationsResponse struct {
	// Map of disk device IDs and <adapter, bus, target, lun ID> associated with each disk device
	DiskLocations map[uint32]*DiskLocation
}

type PartitionDiskRequest

type PartitionDiskRequest struct {
	// Disk device ID of the disk to partition
	DiskNumber uint32
}

type PartitionDiskResponse

type PartitionDiskResponse struct {
}

type RescanRequest

type RescanRequest struct {
}

type RescanResponse

type RescanResponse struct {
}

type SetDiskStateRequest

type SetDiskStateRequest struct {
	// Disk device ID of the disk which state will change
	DiskNumber uint32

	// Online state to set for the disk. true for online, false for offline
	IsOnline bool
}

type SetDiskStateResponse

type SetDiskStateResponse struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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