linstorcontrol

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package linstorcontrol allows creating and deleting LINSTOR resources/volumes. It is a higher level abstraction to the low level golinstor REST package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultResourceProps

func DefaultResourceProps() map[string]string

DefaultResourceProps returns the default LINSTOR properties for a new resource

func StatusFromResources

func StatusFromResources(serviceCfgPath string, definition *client.ResourceDefinition, group *client.ResourceGroup, resources []client.ResourceWithVolumes) common.ResourceStatus

Types

type CreateResult

type CreateResult struct {
	// Linux device path (e.g., /dev/drbd1001)
	DevicePath string
	// List of nodes where the actual data got places (i.e., after autoplace)
	StorageNodes []string
}

CreateResult is a struct than is used as the result of a successful create action. It already contains the data that is most likely used by a consumer of a CreateVolume() call.

type Linstor

type Linstor struct {
	*client.Client
}

Linstor is a struct containing the configuration that is needed to create or delete a LINSTOR resource.

func Default

func Default(controllers []string) (*Linstor, error)

func (*Linstor) EnsureResource

EnsureResource creates or updates the given resource. It returns three values:

  • The newly created resource definition
  • A slice of all resources that have been spawned from this resource definition on the respective nodes
  • An error if one occurred, or nil

type Resource

type Resource struct {
	Name          string                `json:"resource_name,omitempty"`
	Volumes       []common.VolumeConfig `json:"volumes,omitempty"`
	ResourceGroup string                `json:"resource_group_name,omitempty"`
	FileSystem    string                `json:"file_system,omitempty"`
	GrossSize     bool                  `json:"gross_size"`
}

Jump to

Keyboard shortcuts

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