forked from NetApp/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
96 lines (88 loc) · 3.75 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright 2022 NetApp, Inc. All Rights Reserved.
package storage
//go:generate mockgen -destination=../mocks/mock_storage/mock_storage.go github.com/netapp/trident/storage Backend,Pool
import (
"context"
"github.com/RoaringBitmap/roaring"
"github.com/netapp/trident/config"
storageattribute "github.com/netapp/trident/storage_attribute"
"github.com/netapp/trident/utils"
)
type Backend interface {
Driver() Driver
SetDriver(Driver Driver)
Name() string
SetName(Name string)
BackendUUID() string
SetBackendUUID(BackendUUID string)
Online() bool
SetOnline(Online bool)
State() BackendState
SetState(State BackendState)
Storage() map[string]Pool
SetStorage(Storage map[string]Pool)
Volumes() map[string]*Volume
SetVolumes(Volumes map[string]*Volume)
ConfigRef() string
SetConfigRef(ConfigRef string)
AddStoragePool(pool Pool)
GetPhysicalPoolNames(ctx context.Context) []string
GetDriverName() string
GetProtocol(ctx context.Context) config.Protocol
IsCredentialsFieldSet(ctx context.Context) bool
AddVolume(
ctx context.Context, volConfig *VolumeConfig, storagePool Pool,
volAttributes map[string]storageattribute.Request, retry bool,
) (*Volume, error)
GetDebugTraceFlags(ctx context.Context) map[string]bool
CloneVolume(
ctx context.Context, sourceVolConfig, cloneVolConfig *VolumeConfig, storagePool Pool, retry bool,
) (*Volume, error)
PublishVolume(
ctx context.Context, volConfig *VolumeConfig, publishInfo *utils.VolumePublishInfo,
) error
UnpublishVolume(ctx context.Context, volConfig *VolumeConfig, nodes []*utils.Node) error
GetVolumeExternal(ctx context.Context, volumeName string) (*VolumeExternal, error)
ImportVolume(ctx context.Context, volConfig *VolumeConfig) (*Volume, error)
ResizeVolume(ctx context.Context, volConfig *VolumeConfig, newSize string) error
RenameVolume(ctx context.Context, volConfig *VolumeConfig, newName string) error
RemoveVolume(ctx context.Context, volConfig *VolumeConfig) error
RemoveCachedVolume(volumeName string)
CanSnapshot(ctx context.Context, snapConfig *SnapshotConfig, volConfig *VolumeConfig) error
GetSnapshot(ctx context.Context, snapConfig *SnapshotConfig, volConfig *VolumeConfig) (*Snapshot, error)
GetSnapshots(ctx context.Context, volConfig *VolumeConfig) ([]*Snapshot, error)
CreateSnapshot(ctx context.Context, snapConfig *SnapshotConfig, volConfig *VolumeConfig) (*Snapshot, error)
RestoreSnapshot(ctx context.Context, snapConfig *SnapshotConfig, volConfig *VolumeConfig) error
DeleteSnapshot(ctx context.Context, snapConfig *SnapshotConfig, volConfig *VolumeConfig) error
GetUpdateType(ctx context.Context, origBackend Backend) *roaring.Bitmap
HasVolumes() bool
Terminate(ctx context.Context)
InvalidateNodeAccess()
ReconcileNodeAccess(ctx context.Context, nodes []*utils.Node) error
ConstructExternal(ctx context.Context) *BackendExternal
ConstructPersistent(ctx context.Context) *BackendPersistent
CanMirror() bool
ChapEnabled
}
type ChapEnabled interface {
GetChapInfo(ctx context.Context, volumeName, nodeName string) (*utils.IscsiChapInfo, error)
}
type Pool interface {
Name() string
SetName(name string)
StorageClasses() []string
SetStorageClasses(storageClasses []string)
Backend() Backend
SetBackend(backend Backend)
Attributes() map[string]storageattribute.Offer
SetAttributes(attributes map[string]storageattribute.Offer)
InternalAttributes() map[string]string
SetInternalAttributes(internalAttributes map[string]string)
SupportedTopologies() []map[string]string
SetSupportedTopologies(supportedTopologies []map[string]string)
AddStorageClass(class string)
RemoveStorageClass(class string) bool
ConstructExternal() *PoolExternal
GetLabelsJSON(ctx context.Context, key string, labelLimit int) (string, error)
GetLabels(ctx context.Context, prefix string) map[string]string
}