Documentation
¶
Index ¶
- func GetCommonInternalVolumeName(c *dvp.CommonStorageDriverConfig, name string) string
- func SanitizeCommonStorageDriverConfig(c *dvp.CommonStorageDriverConfig)
- type CommonStorageDriverConfigExternal
- type IscsiAccessInfo
- type NfsAccessInfo
- type PersistentStorageBackendConfig
- type StorageBackend
- func (b *StorageBackend) AddStoragePool(vc *StoragePool)
- func (b *StorageBackend) AddVolume(volConfig *VolumeConfig, storagePool *StoragePool, ...) (*Volume, error)
- func (b *StorageBackend) ConstructExternal() *StorageBackendExternal
- func (b *StorageBackend) ConstructPersistent() *StorageBackendPersistent
- func (b *StorageBackend) GetDriverName() string
- func (b *StorageBackend) GetProtocol() config.Protocol
- func (b *StorageBackend) HasVolumes() bool
- func (b *StorageBackend) RemoveVolume(vol *Volume) error
- type StorageBackendExternal
- type StorageBackendPersistent
- type StorageDriver
- type StoragePool
- func (pool *StoragePool) AddStorageClass(class string)
- func (pool *StoragePool) AddVolume(vol *Volume, bootstrap bool)
- func (pool *StoragePool) ConstructExternal() *StoragePoolExternal
- func (pool *StoragePool) DeleteVolume(vol *Volume) bool
- func (pool *StoragePool) RemoveStorageClass(class string) bool
- type StoragePoolExternal
- type TridentDriver
- type Volume
- type VolumeAccessInfo
- type VolumeConfig
- type VolumeExternal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommonInternalVolumeName ¶
func GetCommonInternalVolumeName( c *dvp.CommonStorageDriverConfig, name string, ) string
func SanitizeCommonStorageDriverConfig ¶
func SanitizeCommonStorageDriverConfig(c *dvp.CommonStorageDriverConfig)
Types ¶
type CommonStorageDriverConfigExternal ¶
type CommonStorageDriverConfigExternal struct {
Version int `json:"version"`
StorageDriverName string `json:"storageDriverName"`
StoragePrefix *string `json:"storagePrefix"`
SerialNumbers []string `json:"serialNumbers"`
}
func GetCommonStorageDriverConfigExternal ¶
func GetCommonStorageDriverConfigExternal( c *dvp.CommonStorageDriverConfig, ) *CommonStorageDriverConfigExternal
SanitizeCommonConfig makes sure none of the fields in dvp.CommonStorageDriverConfig are nil. If this is not done, any attempts to marshal the config object will error.
type IscsiAccessInfo ¶
type IscsiAccessInfo struct {
IscsiTargetPortal string `json:"iscsiTargetPortal,omitempty"`
IscsiTargetIQN string `json:"iscsiTargetIqn,omitempty"`
IscsiLunNumber int32 `json:"iscsiLunNumber,omitempty"`
IscsiInterface string `json:"iscsiInterface,omitempty"`
IscsiIgroup string `json:"iscsiIgroup,omitempty"`
IscsiVAGs []int64 `json:"iscsiVags,omitempty"`
}
type NfsAccessInfo ¶
type PersistentStorageBackendConfig ¶
type PersistentStorageBackendConfig struct {
OntapConfig *dvp.OntapStorageDriverConfig `json:"ontap_config,omitempty"`
SolidfireConfig *dvp.SolidfireStorageDriverConfig `json:"solidfire_config,omitempty"`
EseriesConfig *dvp.ESeriesStorageDriverConfig `json:"eseries_config,omitempty"`
FakeStorageDriverConfig *fake.FakeStorageDriverConfig `json:"fake_config,omitempty"`
}
type StorageBackend ¶
type StorageBackend struct {
Driver StorageDriver
Name string
//TODO: the granualarity of online should probably be a StoragePool, not the whole backend, which in the case of ONTAP can be the whole cluster.
Online bool
Storage map[string]*StoragePool
}
func NewStorageBackend ¶
func NewStorageBackend(driver StorageDriver) (*StorageBackend, error)
func (*StorageBackend) AddStoragePool ¶
func (b *StorageBackend) AddStoragePool(vc *StoragePool)
func (*StorageBackend) AddVolume ¶
func (b *StorageBackend) AddVolume( volConfig *VolumeConfig, storagePool *StoragePool, volumeAttributes map[string]storage_attribute.Request, ) (*Volume, error)
func (*StorageBackend) ConstructExternal ¶
func (b *StorageBackend) ConstructExternal() *StorageBackendExternal
func (*StorageBackend) ConstructPersistent ¶
func (b *StorageBackend) ConstructPersistent() *StorageBackendPersistent
func (*StorageBackend) GetDriverName ¶
func (b *StorageBackend) GetDriverName() string
func (*StorageBackend) GetProtocol ¶
func (b *StorageBackend) GetProtocol() config.Protocol
func (*StorageBackend) HasVolumes ¶
func (b *StorageBackend) HasVolumes() bool
HasVolumes returns true if the StorageBackend has one or more volumes provisioned on it.
func (*StorageBackend) RemoveVolume ¶
func (b *StorageBackend) RemoveVolume(vol *Volume) error
type StorageBackendExternal ¶
type StorageBackendExternal struct {
Name string `json:"name"`
Config interface{} `json:"config"`
Storage map[string]*StoragePoolExternal `json:"storage"`
Online bool `json:"online"`
Volumes []string `json:"volumes"`
}
type StorageBackendPersistent ¶
type StorageBackendPersistent struct {
Version string `json:"version"`
Config PersistentStorageBackendConfig `json:"config"`
Name string `json:"name"`
Online bool `json:"online"`
}
func (*StorageBackendPersistent) MarshalConfig ¶
func (p *StorageBackendPersistent) MarshalConfig() (string, error)
Unfortunately, this method appears to be necessary to avoid arbitrary values ending up in the json.RawMessage fields of CommonStorageDriverConfig. Ideally, StorageBackendPersistent would just store a serialized config, but doing so appears to cause problems with the json.RawMessage fields.
type StorageDriver ¶
type StorageDriver interface {
dvp.StorageDriver
TridentDriver
}
This shadows the dvp.StorageDriver interface, combining it with the Trident specific methods. Implementing structs should in-line an instance of dvp.StorageDriver
type StoragePool ¶
type StoragePool struct {
Name string
// A Trident storage pool can potentially satisfy more than one storage
// class.
StorageClasses []string
Volumes map[string]*Volume
Backend *StorageBackend
Attributes map[string]sa.Offer
}
func NewStoragePool ¶
func NewStoragePool(backend *StorageBackend, name string) *StoragePool
func (*StoragePool) AddStorageClass ¶
func (pool *StoragePool) AddStorageClass(class string)
func (*StoragePool) AddVolume ¶
func (pool *StoragePool) AddVolume(vol *Volume, bootstrap bool)
func (*StoragePool) ConstructExternal ¶
func (pool *StoragePool) ConstructExternal() *StoragePoolExternal
func (*StoragePool) DeleteVolume ¶
func (pool *StoragePool) DeleteVolume(vol *Volume) bool
func (*StoragePool) RemoveStorageClass ¶
func (pool *StoragePool) RemoveStorageClass(class string) bool
type StoragePoolExternal ¶
type TridentDriver ¶
type TridentDriver interface {
CreatePrepare(volConfig *VolumeConfig) bool
// CreateFollowup adds necessary information for accessing the volume
// to VolumeConfig.
CreateFollowup(volConfig *VolumeConfig) error
// GetInternalVolumeName will return a name that satisfies any character
// constraints present on the backend and that will be unique to Trident.
// The latter requirement should generally be done by prepending the
// value of CommonStorageDriver.SnapshotPrefix to the name.
GetInternalVolumeName(name string) string
GetStorageBackendSpecs(backend *StorageBackend) error
GetVolumeOpts(
volConfig *VolumeConfig,
pool *StoragePool,
requests map[string]storage_attribute.Request,
) (map[string]string, error)
GetProtocol() config.Protocol
GetDriverName() string
StoreConfig(b *PersistentStorageBackendConfig)
// GetExternalConfig returns a version of the driver configuration that
// lacks confidential information, such as usernames and passwords.
GetExternalConfig() interface{}
}
type Volume ¶
type Volume struct {
Config *VolumeConfig
Backend *StorageBackend
Pool *StoragePool
}
func NewVolume ¶
func NewVolume(conf *VolumeConfig, backend *StorageBackend, pool *StoragePool) *Volume
func (*Volume) ConstructExternal ¶
func (v *Volume) ConstructExternal() *VolumeExternal
type VolumeAccessInfo ¶
type VolumeAccessInfo struct {
IscsiAccessInfo
NfsAccessInfo
}
type VolumeConfig ¶
type VolumeConfig struct {
Version string `json:"version"`
Name string `json:"name"`
InternalName string `json:"internalName"`
Size string `json:"size"`
Protocol config.Protocol `json:"protocol"`
SnapshotPolicy string `json:"snapshotPolicy,omitempty"`
ExportPolicy string `json:"exportPolicy,omitempty"`
SnapshotDir string `json:"snapshotDirectory,omitempty"`
UnixPermissions string `json:"unixPermissions,omitempty"`
StorageClass string `json:"storageClass,omitempty"`
AccessMode config.AccessMode `json:"accessMode,omitempty"`
AccessInfo VolumeAccessInfo `json:"accessInformation"`
BlockSize string `json:"blockSize"`
FileSystem string `json:"fileSystem"`
}
func (*VolumeConfig) Validate ¶
func (c *VolumeConfig) Validate() error
type VolumeExternal ¶
type VolumeExternal struct {
Config *VolumeConfig
Backend string `json:"backend"`
Pool string `json:"pool"`
}