Documentation
¶
Index ¶
- Constants
- Variables
- type AccessKrb
- type BaseCreator
- func (c *BaseCreator) AllowShareAccess(ctx context.Context, params ShareAccessParams) error
- func (c *BaseCreator) CreateNfsShare(ctx context.Context, fsName, fsId, desc, vStoreId string) (string, error)
- func (c *BaseCreator) CreateQoS(ctx context.Context, fsID, vStoreId string) (string, error)
- func (c *BaseCreator) GetPoolID(ctx context.Context, storagePoolName string) (string, error)
- func (c *BaseCreator) Init(params *Parameter)
- func (c *BaseCreator) RollbackQoS(ctx context.Context, qosId, fsId, vStoreId string) error
- func (c *BaseCreator) RollbackShare(ctx context.Context, shareId, vStoreId string) error
- func (c *BaseCreator) RollbackShareAccess(ctx context.Context, shareId, vStoreId, authClient string) error
- type CloneFsCreator
- type CloneFsOptionFunc
- type FilesystemCreator
- type FsOptionFunc
- type HyperMetroFsCreator
- type HyperMetroFsOptionFunc
- type HyperMetroFsRequiredOptions
- type ModifyFsCreator
- type ModifyFsOptionFunc
- type Parameter
- func (p *Parameter) AccessKrb5() int
- func (p *Parameter) AccessKrb5i() int
- func (p *Parameter) AccessKrb5p() int
- func (p *Parameter) ActiveVStoreID() string
- func (p *Parameter) AllSquash() int
- func (p *Parameter) AllocType() int
- func (p *Parameter) AuthClient() string
- func (p *Parameter) Backend() string
- func (p *Parameter) Capacity() int64
- func (p *Parameter) CloneFrom() string
- func (p *Parameter) CloneSpeed() int
- func (p *Parameter) Description() string
- func (p *Parameter) FilesystemMode() string
- func (p *Parameter) FsPermission() string
- func (p *Parameter) IsClone() bool
- func (p *Parameter) IsHyperMetro() bool
- func (p *Parameter) IsModifyVolume() bool
- func (p *Parameter) IsReplication() bool
- func (p *Parameter) IsShowSnapDir() (bool, bool)
- func (p *Parameter) IsSkipNfsShareAndQos() bool
- func (p *Parameter) IsSnapshot() bool
- func (p *Parameter) MetroDomainID() string
- func (p *Parameter) PoolID() string
- func (p *Parameter) Product() StorageProduct
- func (p *Parameter) PvcName() string
- func (p *Parameter) QoS() map[string]int
- func (p *Parameter) RemotePoolId() string
- func (p *Parameter) RemoteStoragePool() string
- func (p *Parameter) RootSquash() int
- func (p *Parameter) SetIsSkipNfsShare(isSkip bool)
- func (p *Parameter) SetQos(qos map[string]int)
- func (p *Parameter) SnapshotID() string
- func (p *Parameter) SnapshotParentId() string
- func (p *Parameter) SnapshotParentName() string
- func (p *Parameter) SnapshotReservePer() (int, bool)
- func (p *Parameter) SourceSnapshotName() string
- func (p *Parameter) SourceVolumeName() string
- func (p *Parameter) StandByVStoreID() string
- func (p *Parameter) StoragePool() string
- func (p *Parameter) VStorePairId() string
- func (p *Parameter) WorkloadTypeID() string
- type ShareAccessParams
- type SnapshotFsCreator
- type SnapshotFsOptionFunc
- type StorageProduct
- type VolumeCreator
Constants ¶
const ( AccessKrb5ReadOnly = "read_only" AccessKrb5ReadWrite = "read_write" AccessKrb5ReadNone = "none" )
const ( // AllocTypeKey is the string of AllocType's key AllocTypeKey = "alloctype" // AllSquashKey is the string of AllSquash's key AllSquashKey = "allsquash" // AuthClientKey is the string of AuthClient's key AuthClientKey = "authclient" // BackendKey is the string of Backend's key BackendKey = "backend" // CapacityKey is the string of Capacity's key CapacityKey = "capacity" // DescriptionKey is the string of Description's key DescriptionKey = "description" // MetroDomainIDKey is the string of MetroDomainID's key MetroDomainIDKey = "metroDomainID" // PvcNameKey is the string of PvcName's key PvcNameKey = "name" // PoolIDKey is the string of PoolID's key PoolIDKey = "poolID" // RootSquashKey is the string of RootSquash's key RootSquashKey = "rootsquash" // StoragePoolKey is the string of StoragePool's key StoragePoolKey = "storagepool" // ActiveVStoreIDKey is the string of ActiveVStoreID's key ActiveVStoreIDKey = "localVStoreID" // StandByVStoreIDKey is the string of StandByVStoreID's key StandByVStoreIDKey = "remoteVStoreID" // CloneFromKey is the string of CloneFrom's key CloneFromKey = "clonefrom" // CloneSpeedKey is the string of CloneSpeed's key CloneSpeedKey = "clonespeed" // SourceVolumeNameKey is the string of SourceVolumeName's key SourceVolumeNameKey = "sourcevolumename" // SourceSnapshotNameKey is the string of SourceSnapshotName's key SourceSnapshotNameKey = "sourcesnapshotname" // SnapshotParentIdKey is the string of SnapshotParentId's key SnapshotParentIdKey = "snapshotparentid" // HyperMetroKey is the string of HyperMetro's key HyperMetroKey = "hypermetro" // RemoteStoragePoolKey is the string of RemoteStoragePool's key RemoteStoragePoolKey = "remotestoragepool" // RemotePoolIdKey is the string of RemotePoolId's key RemotePoolIdKey = "remotePoolID" // VStorePairIdKey is the string of VStorePairId's key VStorePairIdKey = "vstorepairid" // ReplicationKey is the string of Replication's key ReplicationKey = "replication" // FsPermissionKey is the string of FsPermission's key FsPermissionKey = "fspermission" // SnapshotFromKey is the string of FromSnapshot's key SnapshotFromKey = "fromSnapshot" IsSkipNfsShareAndQoS = "skipNfsShareAndQos" // QoSKey is the string of qos's key QoSKey = "qos" // WorkloadTypeIDKey is the string of WorkloadTypeID's key WorkloadTypeIDKey = "workloadTypeID" // IsShowSnapDirKey is the string of IsShowSnapDir's key IsShowSnapDirKey = "isshowsnapdir" // SnapshotReservePerKey is the string of SnapshotReservePer's key SnapshotReservePerKey = "reservedsnapshotspaceratio" // AccessKrb5Key is the string of AccessKrb5's key AccessKrb5Key = "accesskrb5" // AccessKrb5iKey is the string of AccessKrb5i's key AccessKrb5iKey = "accesskrb5i" // AccessKrb5pKey is the string of AccessKrb5p's key AccessKrb5pKey = "accesskrb5p" // FilesystemModeKey is the string of FilesystemMode's key FilesystemModeKey = "filesystemmode" // ProductKey is the string of product's key ProductKey = "product" // ModifyVolumeKey is the string of ModifyVolume's key ModifyVolumeKey = "ModifyVolume" // SnapshotIDKey is the string of SnapshotID's key SnapshotIDKey = "snapshotID" // SnapshotParentNameKey is the string of SnapshotParentName's key SnapshotParentNameKey = "snapshotParentName" // DefaultAllSquash is the default value of all squash DefaultAllSquash = 1 // DefaultRootSquash is the default value of root squash DefaultRootSquash = 1 // DefaultCloneSpeed is the default value of clone speed DefaultCloneSpeed = 3 // DefaultAllocType is the default value of alloc type DefaultAllocType = 1 )
const (
// FilesystemObjectType filesystem object identifier
FilesystemObjectType = "fs"
)
Variables ¶
var ( // ErrVolumeTypeConflict is used for create a conflict volume. ErrVolumeTypeConflict = errors.New("cannot create replication and hypermetro for a volume at the same time") // ErrNotFoundCli is used for get empty client interface. ErrNotFoundCli = errors.New("not found client") )
Functions ¶
This section is empty.
Types ¶
type BaseCreator ¶
type BaseCreator struct {
// contains filtered or unexported fields
}
BaseCreator provides some common methods for volume creation.
func (*BaseCreator) AllowShareAccess ¶
func (c *BaseCreator) AllowShareAccess(ctx context.Context, params ShareAccessParams) error
AllowShareAccess allows nfs share access.
func (*BaseCreator) CreateNfsShare ¶
func (c *BaseCreator) CreateNfsShare(ctx context.Context, fsName, fsId, desc, vStoreId string) (string, error)
CreateNfsShare creates nfs share for the filesystem.
func (*BaseCreator) Init ¶
func (c *BaseCreator) Init(params *Parameter)
Init initiates fields of BaseCreator
func (*BaseCreator) RollbackQoS ¶
func (c *BaseCreator) RollbackQoS(ctx context.Context, qosId, fsId, vStoreId string) error
RollbackQoS rollbacks qos resource.
func (*BaseCreator) RollbackShare ¶
func (c *BaseCreator) RollbackShare(ctx context.Context, shareId, vStoreId string) error
RollbackShare rollbacks nfs share resource.
func (*BaseCreator) RollbackShareAccess ¶
func (c *BaseCreator) RollbackShareAccess(ctx context.Context, shareId, vStoreId, authClient string) error
RollbackShareAccess rollbacks nfs share access.
type CloneFsCreator ¶
type CloneFsCreator struct {
*BaseCreator
// contains filtered or unexported fields
}
CloneFsCreator provides the ability to create a clone file system.
func NewCloneFsCreatorByParams ¶
func NewCloneFsCreatorByParams(cli client.BaseClientInterface, params *Parameter, opts ...CloneFsOptionFunc) *CloneFsCreator
NewCloneFsCreatorByParams returns an instance of CloneFsCreator
func (*CloneFsCreator) CreateVolume ¶
CreateVolume creates a clone filesystem volume on the storage backend.
type CloneFsOptionFunc ¶
type CloneFsOptionFunc func(*CloneFsCreator)
CloneFsOptionFunc defines the function to change fields of CloneFsCreator
func WithCloneFrom ¶
func WithCloneFrom(cloneFrom string) CloneFsOptionFunc
WithCloneFrom sets cloneFrom field of CloneFsCreator
func WithIsDeleteParentSnapshot ¶
func WithIsDeleteParentSnapshot(isDeleteParentSnapshot bool) CloneFsOptionFunc
WithIsDeleteParentSnapshot sets isDeleteParentSnapshot field of CloneFsCreator
func WithParentSnapshotId ¶
func WithParentSnapshotId(snapshotId string) CloneFsOptionFunc
WithParentSnapshotId sets parentSnapshotId field of CloneFsCreator
type FilesystemCreator ¶
type FilesystemCreator struct {
*BaseCreator
// contains filtered or unexported fields
}
FilesystemCreator is the filesystem creator that implement VolumeCreator interface.
func NewFsCreatorFromParams ¶
func NewFsCreatorFromParams(cli client.BaseClientInterface, params *Parameter, opts ...FsOptionFunc) *FilesystemCreator
NewFsCreatorFromParams returns an instance of FilesystemCreator
func (*FilesystemCreator) CreateVolume ¶
CreateVolume creates a filesystem volume on the storage backend.
type FsOptionFunc ¶
type FsOptionFunc func(*FilesystemCreator)
FsOptionFunc defines the function to change fields of FilesystemCreator
type HyperMetroFsCreator ¶
type HyperMetroFsCreator struct {
*BaseCreator
// contains filtered or unexported fields
}
HyperMetroFsCreator is the filesystem creator that implement VolumeCreator interface.
func NewHyperMetroCreatorFromParams ¶
func NewHyperMetroCreatorFromParams( activeCli client.BaseClientInterface, standbyCli client.BaseClientInterface, params *Parameter, opts ...HyperMetroFsOptionFunc, ) *HyperMetroFsCreator
NewHyperMetroCreatorFromParams returns an instance of HyperMetroFsCreator
func (*HyperMetroFsCreator) CreateVolume ¶
CreateVolume creates a hyper metro filesystem volume on the storage backend.
type HyperMetroFsOptionFunc ¶
type HyperMetroFsOptionFunc func(creator *HyperMetroFsCreator)
HyperMetroFsOptionFunc defines the function to change fields of ModifyFsCreator
type HyperMetroFsRequiredOptions ¶
type HyperMetroFsRequiredOptions struct {
// Name is the name of clone filesystem
Name string
// StoragePoolName is the name of storage pool that the filesystem belong to
StoragePoolName string
// StoragePoolId is the id of storage pool that the filesystem belong to
StoragePoolId string
// Description is the description of the filesystem
Description string
// Capacity is the capacity of the filesystem
Capacity int64
// AllocType is the allocation type of the filesystem
AllocType int
// contains filtered or unexported fields
}
HyperMetroFsRequiredOptions defines the required options of ModifyFsCreator
type ModifyFsCreator ¶
type ModifyFsCreator struct {
*BaseCreator
// contains filtered or unexported fields
}
ModifyFsCreator is the filesystem creator that implement VolumeCreator interface.
func NewModifyCreatorFromParams ¶
func NewModifyCreatorFromParams( activeCli client.BaseClientInterface, standbyCli client.BaseClientInterface, params *Parameter, opts ...ModifyFsOptionFunc, ) *ModifyFsCreator
NewModifyCreatorFromParams returns an instance of ModifyFsCreator
func (*ModifyFsCreator) CreateVolume ¶
CreateVolume creates a hyper metro filesystem volume on the storage backend.
type ModifyFsOptionFunc ¶
type ModifyFsOptionFunc func(creator *ModifyFsCreator)
ModifyFsOptionFunc defines the function to change fields of ModifyFsCreator
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
Parameter wraps the parameters from the PVC creation request, make each of parameters can be type-checked, and make it is easier to read and use.
func NewParameter ¶
NewParameter returns a new instance of Parameter.
func (*Parameter) AccessKrb5 ¶
AccessKrb5 gets the AccessKrb5 value of the params map.
func (*Parameter) AccessKrb5i ¶
AccessKrb5i gets the AccessKrb5i value of the params map.
func (*Parameter) AccessKrb5p ¶
AccessKrb5p gets the AccessKrb5p value of the params map.
func (*Parameter) ActiveVStoreID ¶
ActiveVStoreID gets the ActiveVStoreID value of the params map.
func (*Parameter) AuthClient ¶
AuthClient gets the AuthClient value of the params map.
func (*Parameter) CloneSpeed ¶
CloneSpeed gets the CloneSpeed value of the params map.
func (*Parameter) Description ¶
Description gets the Description value of the params map.
func (*Parameter) FilesystemMode ¶
FilesystemMode gets the FilesystemMode value of the params map.
func (*Parameter) FsPermission ¶
FsPermission gets the FsPermission value of the params map.
func (*Parameter) IsClone ¶
IsClone returns true if a clone filesystem needs to be created, or returns false.
func (*Parameter) IsHyperMetro ¶
IsHyperMetro gets the HyperMetro value of the params map.
func (*Parameter) IsModifyVolume ¶
IsModifyVolume gets the ModifyVolume value of the params map.
func (*Parameter) IsReplication ¶
IsReplication gets the Replication value of the params map.
func (*Parameter) IsShowSnapDir ¶
IsShowSnapDir gets the IsShowSnapDir value of the params map.
func (*Parameter) IsSkipNfsShareAndQos ¶
IsSkipNfsShareAndQos returns true if the filesystem didn't need to create nfs share and QoS, or return false.
func (*Parameter) IsSnapshot ¶
IsSnapshot returns true if a snapshot filesystem needs to be created, or returns false.
func (*Parameter) MetroDomainID ¶
MetroDomainID gets the MetroDomainID value of the params map.
func (*Parameter) Product ¶
func (p *Parameter) Product() StorageProduct
Product gets the Product value of the params map.
func (*Parameter) RemotePoolId ¶
RemotePoolId gets the RemotePoolID value of the params map.
func (*Parameter) RemoteStoragePool ¶
RemoteStoragePool gets the RemoteStoragePool value of the params map.
func (*Parameter) RootSquash ¶
RootSquash gets the RootSquash value of the params map.
func (*Parameter) SetIsSkipNfsShare ¶
SetIsSkipNfsShare sets the value of isSkipNfsShare
func (*Parameter) SnapshotID ¶
SnapshotID gets the SnapshotID value of the params map.
func (*Parameter) SnapshotParentId ¶
SnapshotParentId gets the SnapshotParentId value of the params map.
func (*Parameter) SnapshotParentName ¶
SnapshotParentName gets the SnapshotParentName value of the params map.
func (*Parameter) SnapshotReservePer ¶
SnapshotReservePer gets the SnapshotReservePer value of the params map.
func (*Parameter) SourceSnapshotName ¶
SourceSnapshotName gets the SourceSnapshotName value of the params map.
func (*Parameter) SourceVolumeName ¶
SourceVolumeName gets the SourceVolumeName value of the params map.
func (*Parameter) StandByVStoreID ¶
StandByVStoreID gets the ActiveVStoreID value of the params map.
func (*Parameter) StoragePool ¶
StoragePool gets the StoragePool value of the params map.
func (*Parameter) VStorePairId ¶
VStorePairId gets the VStorePairId value of the params map.
func (*Parameter) WorkloadTypeID ¶
WorkloadTypeID gets the WorkloadTypeID value of the params map.
type ShareAccessParams ¶
type ShareAccessParams struct {
// contains filtered or unexported fields
}
ShareAccessParams is parameters for creating share access
type SnapshotFsCreator ¶
type SnapshotFsCreator struct {
*BaseCreator
// contains filtered or unexported fields
}
SnapshotFsCreator provides the ability to create a snapshot file system.
func NewSnapshotFsFromParams ¶
func NewSnapshotFsFromParams(cli client.BaseClientInterface, params *Parameter, opts ...SnapshotFsOptionFunc) *SnapshotFsCreator
NewSnapshotFsFromParams returns an instance of NewSnapshotFsFromParams
func (*SnapshotFsCreator) CreateVolume ¶
CreateVolume creates a snapshot filesystem volume on the storage backend.
type SnapshotFsOptionFunc ¶
type SnapshotFsOptionFunc func(*SnapshotFsCreator)
SnapshotFsOptionFunc defines the function to change fields of SnapshotFsCreator
type StorageProduct ¶
type StorageProduct string
func (StorageProduct) IsV6 ¶
func (s StorageProduct) IsV6() bool
type VolumeCreator ¶
type VolumeCreator interface {
CreateVolume(context.Context) (utils.Volume, error)
// contains filtered or unexported methods
}
VolumeCreator is the interface that wraps the CreateVolume method.
func NewFromParameters ¶
func NewFromParameters( ctx context.Context, parameters map[string]any, activeCli client.BaseClientInterface, standbyCli client.BaseClientInterface, ) (VolumeCreator, error)
NewFromParameters generates a volume creator instance from parameters.