Documentation ¶
Index ¶
- Constants
- Variables
- func BindMountDevice(sourcefile, destfile string) error
- func DeleteFile(pathname string) error
- func EnsureFreeLoopbackDeviceFile() (uint64, error)
- func ExpandDeviceFileSize(pathname string, size int64) error
- func ExpandFilesystem(device, fsType string) error
- func FormatDevice(device, fsType string) error
- func GetCommonExtendedInfo() map[string]string
- func GetDeviceMinorNumber(device string) (uint32, error)
- func GetNFSExports(address string) ([]string, error)
- func IsShareMounted(targetPath string) (bool, error)
- func MakeEmptyRawFile(pathname string, size int64) error
- func MountFilesystem(sourcefile, destfile, fsType string, mountFlags []string) error
- func MountShare(sourcePath, targetPath string, mountFlags []string) error
- func SetMetadataTags(localPath string, tags map[string]string) error
- func UnmountFilesystem(targetPath string) error
- type AppliedObjectiveResponse
- type Cluster
- type ClusterObjectiveResponse
- type ClusterResponse
- type DataPortal
- type DataPortalNode
- type DataPortalNodeAddress
- type File
- type FileSnapshot
- type HSVolume
- type HSVolumeParameters
- type ObjectivesResponse
- type PortalFloatingIps
- type ShareExportOptions
- type ShareInodesResponse
- type ShareRequest
- type ShareResponse
- type ShareSpaceResponse
- type ShareUpdateRequest
- type SnapshotResponse
- type Task
- type TaskParamsMap
- type VolumeResponse
Constants ¶
View Source
const ( CsiPluginName = "com.hammerspace.csi" // Directory on hosts where backing shares for file-backed volumes will be mounted // Must end with a "/" DefaultBackingFileSizeBytes = 1073741824 DefaultVolumeNameFormat = "%s" // Topology keys TopologyKeyDataPortal = "topology.csi.hammerspace.com/is-data-portal" )
View Source
const ( // Validation errors EmptyVolumeId = "Volume ID cannot be empty" VolumeIdTooLong = "Volume ID cannot be longer than %d characters" SnapshotIdTooLong = "Shapshot ID cannot be longer than %d characters" ImproperlyFormattedSnapshotId = "Shapshot ID should be of the format <datetime>|<share export path>, received %s" EmptyTargetPath = "Target path cannot be empty" EmptyStagingTargetPath = "Staging target path cannot be empty" EmptyVolumePath = "Volume Path cannot be empty" NoCapabilitiesSupplied = "No capabilities supplied for volume %s" // volume id ConflictingCapabilities = "Cannot request a volume to be both raw and a filesystem" InvalidDeleteDelay = "deleteDelay parameter must be an Integer. Value received '%s'" InvalidComment = "Failed to set comment, invalid value" InvalidCommentSize = "Share comment cannot be longer than 255 characters" EmptySnapshotId = "Snapshot ID cannot be empty" MissingSnapshotSourceVolumeId = "Snapshot SourceVolumeId cannot be empty" BlockVolumeSizeNotSpecified = "Capacity must be specified for block volumes" InvalidExportOptions = "Export options must consist of 3 values: subnet,access,rootSquash, received '%s'" InvalidRootSquash = "rootSquash must be a bool. Value received '%s'" InvalidAdditionalMetadataTags = "Extended Info must be of format key=value, received '%s'" InvalidObjectiveNameDoesNotExist = "Cannot find objective with the name %s" VolumeExistsSizeMismatch = "Requested volume exists, but has a different size. Existing: %d, Requested: %d" VolumeDeleteHasSnapshots = "Volumes with snapshots cannot be deleted, delete snapshots first" VolumeBeingDeleted = "The specified volume is currently being deleted" // Not Found errors VolumeNotFound = "Volume does not exist" FileNotFound = "File does not exist" SourceSnapshotNotFound = "Could not find source snapshots" // Internal errors UnexpectedHSStatusCode = "Unexpected HTTP response from Hammerspace API: recieved status code %d, expected %d" OutOfCapacity = "Requested capacity %d exceeds available %d" LoopDeviceAttachFailed = "Failed setting up loop device: device=%s, filePath=%s" TargetPathUnknownFiletype = "Target path exists but is not a block device nor directory" UnknownError = "Unknown internal error" // CSI v0 BlockVolumesUnsupported = "Block volumes are unsupported in CSI v0.3" )
These are error messages that may be returned as responses via the gRPC API Convention is to be lowercase with no ending punctuation
Variables ¶
View Source
var ( // These should be set at compile time Version = "NONE" Githash = "NONE" CsiVersion = "1" // The list of export path prefixes to try to use, in order, when mounting to a data portal DefaultDataPortalMountPrefixes = [...]string{"/", "/mnt/data-portal", ""} DataPortalMountPrefix = "" CommandExecTimeout = 300 * time.Second // Seconds UseAnvil bool )
View Source
var ExecCommand = execCommandHelper
Functions ¶
func BindMountDevice ¶
func DeleteFile ¶
func EnsureFreeLoopbackDeviceFile ¶
EnsureFreeLoopbackDeviceFile finds the next available loop device under /dev/loop* If no free loop devices exist, a new one is created
func ExpandDeviceFileSize ¶
func ExpandFilesystem ¶
func FormatDevice ¶
func GetCommonExtendedInfo ¶
Extended info to be set on every share created by the driver
func GetDeviceMinorNumber ¶
func GetNFSExports ¶
func IsShareMounted ¶
func MakeEmptyRawFile ¶
func MountFilesystem ¶
func MountShare ¶
func UnmountFilesystem ¶
Types ¶
type AppliedObjectiveResponse ¶
type AppliedObjectiveResponse struct {
Name string `json:"name"`
}
type Cluster ¶
type Cluster struct { Name string `json:"name"` PortalFloatingIps []PortalFloatingIps `json:"portalFloatingIps"` }
type ClusterObjectiveResponse ¶
type ClusterObjectiveResponse struct {
Name string `json:"name"`
}
type ClusterResponse ¶
We must create separate req and response objects since the API does not allow specifying unused fields
type DataPortal ¶
type DataPortal struct { OperState string `json:"operState"` // We want 'UP' AdminState string `json:"adminState"` // We want 'UP' DataPortalType string `json:"dataPortalType"` // We want NFS_V3 Exported []string `json:"exported"` Node DataPortalNode `json:"node"` Uoid map[string]string `json:"uoid"` }
type DataPortalNode ¶
type DataPortalNode struct { Name string `json:"name"` MgmtIpAddress DataPortalNodeAddress `json:"mgmtIpAddress"` // do we want this or some data ip? }
type DataPortalNodeAddress ¶
type FileSnapshot ¶
type HSVolumeParameters ¶
type HSVolumeParameters struct { DeleteDelay int64 ExportOptions []ShareExportOptions Objectives []string VolumeNameFormat string FSType string Comment string AdditionalMetadataTags map[string]string }
Structures to hold information about a plugin created volume
type ObjectivesResponse ¶
type ObjectivesResponse struct {
Applied []AppliedObjectiveResponse `json:"appliedObjectives"`
}
type PortalFloatingIps ¶
type PortalFloatingIps struct { Address string `json:"address"` PrefixLength int `json:"prefixLength"` }
Portal Data Floating IPs are a cluster-wide resource
type ShareExportOptions ¶
type ShareExportOptions struct {}
type ShareInodesResponse ¶
type ShareInodesResponse struct {}
type ShareRequest ¶
type ShareRequest struct {}
type ShareResponse ¶
type ShareResponse struct {}
type ShareSpaceResponse ¶
type ShareSpaceResponse struct {}
type ShareUpdateRequest ¶
type ShareUpdateRequest struct {}
type SnapshotResponse ¶
type Task ¶
type Task struct { Uuid string `json:"uuid"` Action string `json:"name"` Status string `json:"status"` ExitValue string `json:"exitValue"` ParamsMap TaskParamsMap `json:"paramsMap"` }
type TaskParamsMap ¶
Click to show internal directories.
Click to hide internal directories.