oimcontroller

package
v0.0.0-...-ee17956 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Server

func Server(endpoint string, c oim.ControllerServer, creds credentials.TransportCredentials) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))

Server configures an arbitrary OIM controller implementation as a gRPC server.

Types

type Controller

type Controller struct {
	SPDK *spdk.Client
	// contains filtered or unexported fields
}

Controller implements oim.Controller.

func New

func New(options ...Option) (*Controller, error)

New constructs a new OIM controller instance.

func (*Controller) CheckMallocBDev

func (c *Controller) CheckMallocBDev(ctx context.Context, in *oim.CheckMallocBDevRequest) (*oim.CheckMallocBDevReply, error)

CheckMallocBDev checks whether the Malloc BDev exists.

func (*Controller) Close

func (c *Controller) Close()

Close ends the interaction with the OIM Registry, if one was configured, and frees all resources.

func (*Controller) MapVolume

func (c *Controller) MapVolume(ctx context.Context, in *oim.MapVolumeRequest) (*oim.MapVolumeReply, error)

MapVolume ensures that there is a BDev for the volume and makes it available as block device.

func (*Controller) ProvisionMallocBDev

func (c *Controller) ProvisionMallocBDev(ctx context.Context, in *oim.ProvisionMallocBDevRequest) (*oim.ProvisionMallocBDevReply, error)

ProvisionMallocBDev creates a new local Malloc BDev.

func (*Controller) Server

func (c *Controller) Server(endpoint string) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))

Server returns a new gRPC server listening on the given endpoint.

func (*Controller) Start

func (c *Controller) Start() error

Start begins the interaction with the OIM Registry, if one was configured.

func (*Controller) UnmapVolume

func (c *Controller) UnmapVolume(ctx context.Context, in *oim.UnmapVolumeRequest) (*oim.UnmapVolumeReply, error)

UnmapVolume removes the block device for a BDev and (if not a local Malloc BDev) the BDev itself.

type Option

type Option func(c *Controller) error

Option is what New accepts to reconfigure the resulting controller.

func WithControllerAddress

func WithControllerAddress(address string) Option

WithControllerAddress sets the *external* address for the controller, i.e. what the OIM registry needs to use for gRPC.Dial to contact the controller.

func WithControllerID

func WithControllerID(controllerID string) Option

WithControllerID sets the unique ID that this controller instance has inside the OIM registry. Only needed when self-registration is enabled with WithRegistry.

func WithCreds

func WithCreds(creds credentials.TransportCredentials) Option

WithCreds sets the secret key and CA used by the controller for mutual TLS.

func WithRegistry

func WithRegistry(address string) Option

WithRegistry sets the OIM registry end point for the optional self-registrarion. It takes a gRPC dial string.

func WithRegistryDelay

func WithRegistryDelay(delay time.Duration) Option

WithRegistryDelay sets the interval between self-registration calls.

func WithSPDK

func WithSPDK(path string) Option

WithSPDK sets the SPDK vhost socket path for JSON RPC.

func WithVHostController

func WithVHostController(vhost string) Option

WithVHostController sets the name of the existing SCSI device to which BDevs are to be attached.

func WithVHostDev

func WithVHostDev(dev string) Option

WithVHostDev sets the PCI address of the SCSI device. It takes a PCI Bus/Device/Function string.

Jump to

Keyboard shortcuts

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