nvmeof

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDFormat       = "nvmeof-%s"
	FilenameFormat = "linstor-gateway-nvmeof-%s.toml"
)
View Source
const (
	DefaultPort    = 4420
	CurrentVersion = 1
)

Variables

View Source
var UUIDNVMeoF = uuid.NewSHA1(uuid.Nil, []byte("nvmeof.gateway.linstor.linbit.com"))

Functions

This section is empty.

Types

type NVMeoF

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

func New

func New(controllers []string) (*NVMeoF, error)

func (*NVMeoF) AddVolume

func (n *NVMeoF) AddVolume(ctx context.Context, nqn Nqn, volCfg *common.VolumeConfig) (*ResourceConfig, error)

func (*NVMeoF) Create

func (n *NVMeoF) Create(ctx context.Context, rsc *ResourceConfig) (*ResourceConfig, error)

Create creates an NVMe-oF target according to the resource configuration described in rsc. It automatically prepends a "cluster private volume" to the list of volumes, so volume numbers must start at 1.

func (*NVMeoF) Delete

func (n *NVMeoF) Delete(ctx context.Context, nqn Nqn) error

func (*NVMeoF) DeleteVolume

func (n *NVMeoF) DeleteVolume(ctx context.Context, nqn Nqn, nsid int) (*ResourceConfig, error)

func (*NVMeoF) Get

func (n *NVMeoF) Get(ctx context.Context, nqn Nqn) (*ResourceConfig, error)

func (*NVMeoF) List

func (n *NVMeoF) List(ctx context.Context) ([]*ResourceConfig, error)

func (*NVMeoF) Start

func (n *NVMeoF) Start(ctx context.Context, nqn Nqn) (*ResourceConfig, error)

func (*NVMeoF) Stop

func (n *NVMeoF) Stop(ctx context.Context, nqn Nqn) (*ResourceConfig, error)

type Nqn

type Nqn [2]string

Nqn represents a conventional nvme qualified name

func NewNqn

func NewNqn(s string) (Nqn, error)

func (Nqn) MarshalJSON

func (n Nqn) MarshalJSON() ([]byte, error)

func (Nqn) MarshalText

func (n Nqn) MarshalText() ([]byte, error)

func (Nqn) String

func (n Nqn) String() string

func (*Nqn) Subsystem

func (n *Nqn) Subsystem() string

func (*Nqn) UnmarshalJSON

func (n *Nqn) UnmarshalJSON(text []byte) error

func (*Nqn) UnmarshalText

func (n *Nqn) UnmarshalText(text []byte) error

func (*Nqn) Vendor

func (n *Nqn) Vendor() string

type ResourceConfig

type ResourceConfig struct {
	NQN           Nqn                   `json:"nqn"`
	ServiceIP     common.IpCidr         `json:"service_ip"`
	ResourceGroup string                `json:"resource_group"`
	Volumes       []common.VolumeConfig `json:"volumes"`
	Status        common.ResourceStatus `json:"status"`
	GrossSize     bool                  `json:"gross_size"`
}

func FromPromoter

func FromPromoter(cfg *reactor.PromoterConfig, definition *client.ResourceDefinition, volumeDefinition []client.VolumeDefinition) (*ResourceConfig, error)

func (*ResourceConfig) FillDefaults

func (r *ResourceConfig) FillDefaults()

func (*ResourceConfig) ID

func (r *ResourceConfig) ID() string

func (*ResourceConfig) Matches

func (r *ResourceConfig) Matches(o *ResourceConfig) bool

func (*ResourceConfig) ToPromoter

func (r *ResourceConfig) ToPromoter(deployment []client.ResourceWithVolumes) (*reactor.PromoterConfig, error)

func (*ResourceConfig) Valid

func (r *ResourceConfig) Valid() error

func (*ResourceConfig) VolumeConfig

func (r *ResourceConfig) VolumeConfig(number int) *common.Volume

Jump to

Keyboard shortcuts

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