driver

package
Version: v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSize        = 16
	DefaultFS          = "ext4"
	DefaultReplicas    = 3
	DefaultPlacement   = "hybrid"
	DefaultPersistence = "manual"
	DriverVersion      = "2.0.3"

	DRIVER = "Docker-Volume"

	// Volume Options
	OptSize        = "size"
	OptReplica     = "replica"
	OptTemplate    = "template"
	OptFstype      = "fsType"
	OptMaxiops     = "maxIops"
	OptMaxbw       = "maxBW"
	OptPlacement   = "placementMode"
	OptPersistence = "persistenceMode"
	OptCloneSrc    = "cloneSrc"

	// V2 Volume Plugin static mounts must be under /mnt
	MountLoc = "/mnt"

	// Misc
	DeleteConst = "auto"
)

Variables

View Source
var Opts = map[string][]string{
	OptSize:        []string{"Volume Size In GiB", strconv.Itoa(DefaultSize)},
	OptReplica:     []string{"Volume Replicas", strconv.Itoa(DefaultReplicas)},
	OptTemplate:    []string{"Volume Template", "None"},
	OptFstype:      []string{"Volume Filesystem", DefaultFS},
	OptMaxiops:     []string{"Volume Max Total IOPS", "0"},
	OptMaxbw:       []string{"Volume Max Total Bandwidth", "0"},
	OptPlacement:   []string{"Volume Placement", DefaultPlacement},
	OptPersistence: []string{"Volume Persistence", DefaultPersistence},
	OptCloneSrc:    []string{"Volume Source For Clone", "None"},
}

Functions

func OptsFromMeta

func OptsFromMeta(ctxt context.Context, d DateraDriver, name string) (string, string, error)

Types

type DateraDriver

type DateraDriver struct {
	DateraClient IClient
	Mutex        *sync.Mutex
	Version      string
	Debug        *bool
	Ssl          bool
	Conf         *dc.Config
}

func NewDateraDriver

func NewDateraDriver(conf *dc.Config) DateraDriver

func (DateraDriver) Capabilities

func (d DateraDriver) Capabilities() *dv.CapabilitiesResponse

func (DateraDriver) Create

func (d DateraDriver) Create(r *dv.CreateRequest) error

Create creates a volume on the configured Datera backend

Specified using `--opt key=value` in the docker volume create command

Available Options:

	size
	replica -- Default: 3
 template
 fsType -- Default: ext4
 maxIops
 maxBW
 placementMode -- Default: hybrid
 persistenceMode -- Default: manual
 cloneSrc

func (DateraDriver) Get

func (d DateraDriver) Get(r *dv.GetRequest) (*dv.GetResponse, error)

func (DateraDriver) List

func (d DateraDriver) List() (*dv.ListResponse, error)

func (DateraDriver) Mount

func (DateraDriver) MountPoint

func (d DateraDriver) MountPoint(name string) string

func (DateraDriver) Path

func (DateraDriver) Remove

func (d DateraDriver) Remove(r *dv.RemoveRequest) error

func (DateraDriver) Unmount

func (d DateraDriver) Unmount(r *dv.UnmountRequest) error

type IClient

type IClient interface {
	GetVolume(context.Context, string) (*dsdk.AppInstance, error)
	CreateVolume(context.Context, string, *dc.VolOpts) error
	DeleteVolume(context.Context, string, string) error
	LoginVolume(context.Context, string, string) (string, error)
	MountVolume(context.Context, string, string, string, string) error
	UnmountVolume(context.Context, string, string) error
	DetachVolume(context.Context, string) error
	GetIQNandPortals(context.Context, string) (string, []string, string, error)
	FindDeviceFsType(context.Context, string) (string, error)
	ListVolumes(context.Context) ([]string, error)
	GetMetadata(context.Context, string) (*map[string]interface{}, error)
	PutMetadata(context.Context, string, *map[string]interface{}) error
}

Need to require interface instead of DateraClient directly so we can mock DateraClient out more easily

Source Files

Jump to

Keyboard shortcuts

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