driver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 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      = "1.1.0"

	DRIVER = "Docker-Volume"

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

	// V2 Volume Plugin static mounts must be under /mnt
	MountLoc       = "/mnt"
	EnvFwk         = "DATERA_FRAMEWORK"
	EnvSize        = "DATERA_VOL_SIZE"
	EnvReplica     = "DATERA_REPLICAS"
	EnvPlacement   = "DATERA_PLACEMENT"
	EnvMaxiops     = "DATERA_MAX_IOPS"
	EnvMaxbw       = "DATERA_MAX_BW"
	EnvTemplate    = "DATERA_TEMPLATE"
	EnvFstype      = "DATERA_FSTYPE"
	EnvPersistence = "DATERA_PERSISTENCE"

	// Misc
	DeleteConst = "auto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DateraDriver

type DateraDriver struct {
	DateraClient IClient
	Volumes      map[string]*co.VolObj
	Mutex        *sync.Mutex
	Version      string
	Debug        bool
	Ssl          bool
}

func NewDateraDriver

func NewDateraDriver(restAddress, username, password, tenant string, debug, noSsl bool) 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

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 {
	VolumeExist(string) (bool, error)
	CreateVolume(string, int, int, string, int, int, string) error
	DeleteVolume(string, string) error
	LoginVolume(string, string) (string, error)
	MountVolume(string, string, string, string) error
	UnmountVolume(string, string) error
	DetachVolume(string) error
	GetIQNandPortal(string) (string, string, string, error)
	FindDeviceFsType(string) (string, error)
}

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

Jump to

Keyboard shortcuts

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