storage

package
v0.0.0-...-c5bde80 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateVolumeGroup

func CreateVolumeGroup(volumeGroup VolumeGroup) error

func ExamineDisk

func ExamineDisk(d Disk) error

ExamineDisk will look at the configuration of a disk.

func FileSystemCreate

func FileSystemCreate(f Filesystem) error

FileSystemCreate handles the creation of filesystems.

func MBRPartition

func MBRPartition(d Disk) error

MBRPartition will create the partitions and write them to the disk.

func Mount

func Mount(f Filesystem) error

Mount -=.

func Partition

func Partition(d Disk) error

Partition will create the partitions and write them to the disk.

func VerifyBlockDevice

func VerifyBlockDevice(device string) error

VerifyBlockDevice will check that the device actually exists and is a block device.

func Wipe

func Wipe(d Disk) error

Wipe will clean the table from a disk.

Types

type Disk

type Disk struct {
	Device     string       `json:"device"`
	Partitions []Partitions `json:"partitions"`
	WipeTable  bool         `json:"wipe_table"`
}

Disk defines the configuration for a disk.

type Filesystem

type Filesystem struct {
	Mount struct {
		Create struct {
			Options []string `json:"options"`
		} `json:"create"`
		Device string `json:"device"`
		Format string `json:"format"`
		Point  string `json:"point"`
	} `json:"mount"`
}

Filesystem defines the organisation of a filesystem.

type Instance

type Instance struct {
	CryptedRootPassword    string `json:"crypted_root_password"`
	Hostname               string `json:"hostname"`
	OperatingSystemVersion struct {
		Distro     string `json:"distro"`
		OsCodename string `json:"os_codename"`
		OsSlug     string `json:"os_slug"`
		Version    string `json:"version"`
	} `json:"operating_system_version"`
	Storage struct {
		Disks        []Disk        `json:"disks"`
		Filesystems  []Filesystem  `json:"filesystems"`
		VolumeGroups []VolumeGroup `json:"volume_groups"`
	} `json:"storage"`
}

Instance is a dervied struct taken from a metadata request.

type LogicalVolume

type LogicalVolume struct {
	Name string   `json:"name"`
	Size uint64   `json:"size"`
	Tags []string `json:"tags"`
	Opts []string `json:"opts"`
}

LogicalVolume defines the configuration of a logical volume.

type Metadata

type Metadata struct {
	Instance Instance `json:"instance"`
}

Metadata is an auto generated struct taken from a metadata request.

func RetrieveData

func RetrieveData() (*Metadata, error)

RetrieveData retrieves metadata from Hegel.

type Partitions

type Partitions struct {
	Label  string `json:"label"`
	Number int    `json:"number"`
	Size   uint64 `json:"size"`
}

Partitions details the architecture.

type VolumeGroup

type VolumeGroup struct {
	Name            string          `json:"name"`
	PhysicalVolumes []string        `json:"physical_volumes"`
	LogicalVolumes  []LogicalVolume `json:"logical_volumes"`
	Tags            []string        `json:"tags"`
}

VolumeGroup defines the configuration of a volume group.

type Wrapper

type Wrapper struct {
	Metadata Metadata `json:"metadata"`
}

Wrapper is a top level struct to unmarshal the metadata.

Jump to

Keyboard shortcuts

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