longhorn

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRIVER_NAME        = "longhorn"
	DRIVER_CONFIG_FILE = "longhorn.cfg"
	MOUNTS_DIR         = "mounts"
	DEV_DIR            = "/dev/longhorn/%s"

	VOLUME_CFG_PREFIX   = "volume_"
	LONGHORN_CFG_PREFIX = DRIVER_NAME + "_"
	CFG_POSTFIX         = ".json"

	SNAPSHOT_PATH = "snapshots"

	DEFAULT_VOLUME_SIZE = "10G"

	RANCHER_METADATA_URL = "http://rancher-metadata/2015-12-19"

	LH_RANCHER_URL         = "lh.rancherurl"
	LH_RANCHER_ACCESS_KEY  = "lh.rancheraccesskey"
	LH_RANCHER_SECRET_KEY  = "lh.ranchersecretkey"
	LH_DEFAULT_VOLUME_SIZE = "lh.defaultvolumesize"
	LH_CONTAINER_NAME      = "lh.containername"

	COMPOSE_VOLUME_NAME = "VOLUME_NAME"
	COMPOSE_VOLUME_SIZE = "VOLUME_SIZE"
	COMPOSE_SLAB_SIZE   = "SLAB_SIZE"
	COMPOSE_CONVOY      = "CONVOY_CONTAINER"

	AFFINITY_LABEL = "io.rancher.scheduler.affinity:container"
)
View Source
const (
	RETRY_INTERVAL = 2 * time.Second
	RETRY_MAX      = 200
)

Variables

This section is empty.

Functions

func Backoff

func Backoff(maxDuration time.Duration, timeoutMessage string, f func() (bool, error)) error

func Init

func Init(root string, config map[string]string) (convoydriver.ConvoyDriver, error)

func WaitEnvironment

func WaitEnvironment(client *rancherClient.RancherClient, env *rancherClient.Environment) error

func WaitFor

func WaitFor(client *rancherClient.RancherClient, resource *rancherClient.Resource, output interface{}, transitioning func() string) error

func WaitService

func WaitService(client *rancherClient.RancherClient, service *rancherClient.Service) error

Types

type Device

type Device struct {
	Root              string
	DefaultVolumeSize int64
	RancherURL        string
	RancherAccessKey  string
	RancherSecretKey  string
}

func (*Device) ConfigFile

func (dev *Device) ConfigFile() (string, error)

type Driver

type Driver struct {
	Device
	// contains filtered or unexported fields
}

func (*Driver) BackupOps

func (d *Driver) BackupOps() (convoydriver.BackupOperations, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(id string, opts map[string]string) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(id string, opts map[string]string) error

func (*Driver) GetVolumeInfo

func (d *Driver) GetVolumeInfo(id string) (map[string]string, error)

func (*Driver) Info

func (d *Driver) Info() (map[string]string, error)

func (*Driver) ListVolume

func (d *Driver) ListVolume(opts map[string]string) (map[string]map[string]string, error)

func (*Driver) MountPoint

func (d *Driver) MountPoint(id string) (string, error)

func (*Driver) MountVolume

func (d *Driver) MountVolume(id string, opts map[string]string) (string, error)

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) SnapshotOps

func (d *Driver) SnapshotOps() (convoydriver.SnapshotOperations, error)

func (*Driver) UmountVolume

func (d *Driver) UmountVolume(id string) error

func (*Driver) VolumeOps

func (d *Driver) VolumeOps() (convoydriver.VolumeOperations, error)

type Stack

type Stack struct {
	Client        *rancherClient.RancherClient
	ExternalId    string
	Name          string
	Environment   map[string]interface{}
	Template      string
	ContainerName string
}

func (*Stack) Create

func (s *Stack) Create() (*rancherClient.Environment, error)

func (*Stack) Delete

func (s *Stack) Delete() error

func (*Stack) Find

func (s *Stack) Find() (*rancherClient.Environment, error)

func (*Stack) MoveController

func (s *Stack) MoveController() error

type Volume

type Volume struct {
	UUID         string
	Size         int64
	Name         string
	MountPoint   string
	PrepareForVM bool
	// contains filtered or unexported fields
}

func (*Volume) ConfigFile

func (v *Volume) ConfigFile() (string, error)

func (*Volume) GenerateDefaultMountPoint

func (v *Volume) GenerateDefaultMountPoint() string

func (*Volume) GetDevice

func (v *Volume) GetDevice() (string, error)

func (*Volume) GetMountOpts

func (v *Volume) GetMountOpts() []string

func (*Volume) Stack

func (v *Volume) Stack(driver *Driver) *Stack

Jump to

Keyboard shortcuts

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