oceanstor

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfPath = "/etc/opensds/driver/oceanstor_fileshare.yaml"
	PwdExpired      = 3
	PwdReset        = 4
	NFSProto        = "nfs"
	CIFSProto       = "cifs"
	UnitGi          = 1024 * 1024 * 1024

	StatusFSHealth        = "1"
	StatusFSRunning       = "27"
	AccessLevelRW         = "rw"
	AccessLevelRO         = "ro"
	AccessNFSRw           = "1"
	AccessNFSRo           = "0"
	AccessCIFSRo          = "0"
	AccessCIFSFullControl = "1"
	MaxRetry              = 3
	FileShareName         = "fileshareName"
	FileShareID           = "shareId"
	NamePrefix            = "opensds"
	FileShareSnapshotID   = "fileshareSnapId"
	AccessTypeUser        = "user"
	AccessTypeIp          = "ip"
	AccessLevelRead       = "read"
	AccessLevelWrite      = "write"
	AccessLevelExecute    = "execute"
)

Variables

This section is empty.

Functions

func EncodeName

func EncodeName(id string) string

func Gb2Sector

func Gb2Sector(gb int64) int64

func Sector2Gb

func Sector2Gb(sec int64) int64

Types

type Auth

type Auth struct {
	Data  AuthData `json:"data"`
	Error `json:"error"`
}

type AuthData

type AuthData struct {
	AccountState  int    `json:"accountstate"`
	DeviceId      string `json:"deviceid"`
	IBaseToken    string `json:"iBaseToken"`
	LastLoginIp   string `json:"lastloginip"`
	LastLoginTime int    `json:"lastlogintime"`
	Level         int    `json:"level"`
	PwdChanGeTime int    `json:"pwdchangetime"`
	UserGroup     string `json:"usergroup"`
	UserId        string `json:"userid"`
	UserName      string `json:"username"`
	UserScope     string `json:"userscope"`
}

type AuthOptions

type AuthOptions struct {
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	Endpoint        string `yaml:"endpoints"`
	PwdEncrypter    string `yaml:"PwdEncrypter,omitempty"`
	EnableEncrypted bool   `yaml:"EnableEncrypted,omitempty"`
}

type CIFS

type CIFS struct {
	*Client
}

type CIFSShare

type CIFSShare struct {
	Data  CIFSShareData `json:"data"`
	Error `json:"error"`
}

type CIFSShareClient

type CIFSShareClient struct {
	Data  CIFSShareClientData `json:"data"`
	Error `json:"error"`
}

type CIFSShareClientData

type CIFSShareClientData struct {
	DomainType string `json:"DOMAINTYPE"`
	ID         string `json:"ID"`
	Name       string `json:"NAME"`
	Permission string `json:"PERMISSION"`
}

type CIFSShareData

type CIFSShareData struct {
	Description               string `json:"DESCRIPTION"`
	FSID                      string `json:"FSID"`
	ID                        string `json:"ID"`
	SharePath                 string `json:"SHAREPATH"`
	Name                      string `json:"NAME"`
	AbeEnable                 string `json:"ABEENABLE"`
	EnableCA                  string `json:"ENABLECA"`
	EnableFileExtensionFilter string `json:"ENABLEFILEEXTENSIONFILTER"`
	EnableNotify              string `json:"ENABLENOTIFY"`
	EnableOpLock              string `json:"ENABLEOPLOCK"`
	EnableIPControl           string `json:"ENABLEIPCONTROL"`
	OfflineFileMode           string `json:"OFFLINEFILEMODE"`
	ApplyDefaultACL           string `json:"APPLYDEFAULTACL"`
}

type CIFSShareList

type CIFSShareList struct {
	Data  []CIFSShareData `json:"data"`
	Error `json:"error"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) ListStoragePools

func (c *Client) ListStoragePools() ([]StoragePool, error)

type Config

type Config struct {
	AuthOptions `yaml:"authOptions"`
	Pool        map[string]PoolProperties `yaml:"pool,flow"`
}

type Count

type Count struct {
	Counter string `json:"COUNT"`
}

type DeleteError

type DeleteError struct {
	Error `json:"error"`
}

type Driver

type Driver struct {
	*Config
	*Client
}

func (*Driver) CreateFileShare

func (d *Driver) CreateFileShare(opt *pb.CreateFileShareOpts) (*model.FileShareSpec, error)

func (*Driver) CreateFileShareAcl

func (d *Driver) CreateFileShareAcl(opt *pb.CreateFileShareAclOpts) (*model.FileShareAclSpec, error)

AllowAccess allow access to the share

func (*Driver) CreateFileShareAclParamCheck

func (d *Driver) CreateFileShareAclParamCheck(opt *pb.CreateFileShareAclOpts) (string, string, string, string, error)

func (*Driver) CreateFileShareSnapshot

func (d *Driver) CreateFileShareSnapshot(opt *pb.CreateFileShareSnapshotOpts) (*model.FileShareSnapshotSpec, error)

func (*Driver) DeleteFileShare

func (d *Driver) DeleteFileShare(opt *pb.DeleteFileShareOpts) error

func (*Driver) DeleteFileShareAcl

func (d *Driver) DeleteFileShareAcl(opt *pb.DeleteFileShareAclOpts) error

func (*Driver) DeleteFileShareAclParamCheck

func (d *Driver) DeleteFileShareAclParamCheck(opt *pb.DeleteFileShareAclOpts) (string, string, string, error)

func (*Driver) DeleteFileShareSnapshot

func (d *Driver) DeleteFileShareSnapshot(opt *pb.DeleteFileShareSnapshotOpts) error

func (*Driver) DeleteFileSystem

func (d *Driver) DeleteFileSystem(fsName string) error

func (*Driver) InitConf

func (d *Driver) InitConf()

func (*Driver) ListPools

func (d *Driver) ListPools() ([]*model.StoragePoolSpec, error)

func (*Driver) Setup

func (d *Driver) Setup() error

func (*Driver) Unset

func (d *Driver) Unset() error

type Error

type Error struct {
	Code        int    `json:"code"`
	Description string `json:"description"`
}

type FSSnapshot

type FSSnapshot struct {
	Data  FSSnapshotData `json:"data"`
	Error `json:"error"`
}

type FSSnapshotData

type FSSnapshotData struct {
	Type            int    `json:"TYPE"`
	ID              string `json:"ID"`
	Name            string `json:"NAME"`
	ConsumeCapacity string `json:"CONSUMEDCAPACITY"`
	HealthStatus    string `json:"HEALTHSTATUS"`
	ParentID        string `json:"PARENTID"`
	ParentName      string `json:"PARENTNAME"`
	ParentType      int    `json:"PARENTTYPE"`
	Capacity        string `json:"USERCAPACITY"`
}

FSSnapshot file system snapshot ...

type FSSnapshotList

type FSSnapshotList struct {
	Data  []FSSnapshotData `json:"data"`
	Error `json:"error"`
}

type FileSystem

type FileSystem struct {
	Data  FileSystemData `json:"data"`
	Error `json:"error"`
}

type FileSystemData

type FileSystemData struct {
	HealthStatus  string `json:"HEALTHSTATUS"`
	RunningStatus string `json:"RUNNINGSTATUS"`
	ID            string `json:"ID"`
	Capacity      string `json:"CAPACITY"`
	PoolName      string `json:"POOLNAME"`
	AllocType     string `json:"ALLOCTYPE"`
	Name          string `json:"NAME"`
}

type FileSystemList

type FileSystemList struct {
	Data  []FileSystemData `json:"data"`
	Error `json:"error"`
}

type LogicalPortData

type LogicalPortData struct {
	ID     string `json:"ID"`
	IpAddr string `json:"IPV4ADDR"`
}

type LogicalPortList

type LogicalPortList struct {
	Data  []LogicalPortData `json:"data"`
	Error `json:"error"`
}

LogicalPortList logical portal ...

type NFS

type NFS struct {
	*Client
}

type NFSShare

type NFSShare struct {
	Data  NFSShareData `json:"data"`
	Error `json:"error"`
}

type NFSShareClient

type NFSShareClient struct {
	Error `json:"error"`
}

type NFSShareData

type NFSShareData struct {
	Description       string `json:"DESCRIPTION"`
	FSID              string `json:"FSID"`
	ID                string `json:"ID"`
	SharePath         string `json:"SHAREPATH"`
	LockPolicy        string `json:"LOCKPOLICY"`
	Name              string `json:"NAME"`
	CharacterEncoding string `json:"CHARACTERENCODING"`
}

type NFSShareList

type NFSShareList struct {
	Data  []NFSShareData `json:"data"`
	Error `json:"error"`
}

type Protocol

type Protocol interface {
	// contains filtered or unexported methods
}

func NewProtocol

func NewProtocol(proto string, c *Client) Protocol

type ShareAuthClientData

type ShareAuthClientData struct {
	ID   string `json:"ID"`
	Name string `json:"NAME"`
	// contains filtered or unexported fields
}

type ShareAuthClientList

type ShareAuthClientList struct {
	Data  []ShareAuthClientData `json:"data"`
	Error `json:"error"`
}

type StoragePool

type StoragePool struct {
	Description       string `json:"DESCRIPTION"`
	Id                string `json:"ID"`
	Name              string `json:"NAME"`
	UserFreeCapacity  string `json:"USERFREECAPACITY"`
	UserTotalCapacity string `json:"USERTOTALCAPACITY"`
}

type StoragePoolList

type StoragePoolList struct {
	Data  []StoragePool `json:"data"`
	Error `json:"error"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL