Initial commit

This commit is contained in:
haochengkuo
2021-08-31 10:18:35 +08:00
parent 2ad6fb7b44
commit dc05a795b7
44 changed files with 5197 additions and 1 deletions

22
pkg/models/dsm.go Normal file
View File

@@ -0,0 +1,22 @@
// Copyright 2021 Synology Inc.
package models
const (
K8sCsiName = "Kubernetes CSI"
// ISCSI definitions
FsTypeExt4 = "ext4"
FsTypeBtrfs = "btrfs"
LunTypeFile = "FILE"
LunTypeThin = "THIN"
LunTypeAdv = "ADV"
LunTypeBlun = "BLUN" // thin provision, mapped to type 263
LunTypeBlunThick = "BLUN_THICK" // thick provision, mapped to type 259
MaxIqnLen = 128
// CSI definitions
TargetPrefix = "k8s-csi"
LunPrefix = "k8s-csi"
IqnPrefix = "iqn.2000-01.com.synology:"
)

View File

@@ -0,0 +1,36 @@
// Copyright 2021 Synology Inc.
package models
import (
"github.com/SynologyOpenSource/synology-csi/pkg/dsm/webapi"
)
type CreateK8sVolumeSpec struct {
DsmIp string
K8sVolumeName string
LunName string
Location string
Size int64
Type string
ThinProvisioning bool
TargetName string
TargetIqn string
MultipleSession bool
SourceSnapshotId string
SourceVolumeId string
}
type ListK8sVolumeRespSpec struct {
DsmIp string
Lun webapi.LunInfo
Target webapi.TargetInfo
}
type CreateK8sVolumeSnapshotSpec struct {
K8sVolumeId string
SnapshotName string
Description string
TakenBy string
IsLocked bool
}