fusionstorage

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdBin       = "fsc_cli"
	MaxRetryNode = 3
)
View Source
const (
	DefaultConfPath = "/etc/opensds/driver/fusionstorage.yaml"
	DefaultAZ       = "default"
	NamePrefix      = "opensds"
	UnitGiShiftBit  = 10
)

Variables

View Source
var CliErrorMap = map[string]string{
	"50000001": "DSware error",
	"50150001": "Receive a duplicate request",
	"50150002": "Command type is not supported",
	"50150003": "Command format is error",
	"50150004": "Lost contact with major VBS",
	"50150005": "Volume does not exist",
	"50150006": "Snapshot does not exist",
	"50150007": "Volume already exists or name exists or name duplicates with a snapshot name",
	"50150008": "The snapshot has already existed",
	"50150009": "VBS space is not enough",
	"50150010": "The node type is error",
	"50150011": "Volume and snapshot number is beyond max",
	"50150012": "VBS is not ready",
	"50150013": "The ref num of node is not 0",
	"50150014": "The volume is not in the pre-deletion state.",
	"50150015": "The storage resource pool is faulty",
	"50150016": "VBS handle queue busy",
	"50150017": "VBS handle request timeout",
	"50150020": "VBS metablock is locked",
	"50150021": "VBS pool dose not exist",
	"50150022": "VBS is not ok",
	"50150023": "VBS pool is not ok",
	"50150024": "VBS dose not exist",
	"50150064": "VBS load SCSI-3 lock pr meta failed",
	"50150100": "The disaster recovery relationship exists",
	"50150101": "The DR relationship does not exist",
	"50150102": "Volume has existed mirror",
	"50150103": "The volume does not have a mirror",
	"50150104": "Incorrect volume status",
	"50150105": "The mirror volume already exists",
}
View Source
var PoolNotExist = NewCliErrorBase("pool does not exist", "50151010")
View Source
var SnapshotNotExist = NewCliErrorBase("volume does not exist", "50150006")
View Source
var VolumeNotExist = NewCliErrorBase("volume does not exist", "50150005")

Functions

func EncodeName

func EncodeName(id string) string

func NewCliError

func NewCliError(code string) error

func ParseResp

func ParseResp(data string) map[string]string

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

func Value

func Value(data map[string]string, v reflect.Value) error

Types

type AuthOptions

type AuthOptions struct {
	FmIp  string   `yaml:"fmIp,omitempty"`
	FsaIp []string `yaml:"fsaIp,flow"`
}

type Cli

type Cli struct {

	// Command executer
	BaseExecuter exec.Executer
	// Command Root exectuer
	RootExecuter exec.Executer
	// contains filtered or unexported fields
}

func NewCli

func NewCli(fmIp string, fsaIP []string) (*Cli, error)

func (*Cli) CreateSnapshot

func (c *Cli) CreateSnapshot(name string, volName string, smartFlag bool) error

func (*Cli) CreateVolume

func (c *Cli) CreateVolume(name string, size int64, isThin bool, poolId string, encryptOpt *EncryptOpts) error

func (*Cli) CreateVolumeFromSnapshot

func (c *Cli) CreateVolumeFromSnapshot(name string, size int64, snapName string) error

func (*Cli) DeleteSnapshot

func (c *Cli) DeleteSnapshot(name string) error

func (*Cli) DeleteVolume

func (c *Cli) DeleteVolume(name string) error

func (*Cli) ExtendVolume

func (c *Cli) ExtendVolume(name string, newSize int64) error

func (*Cli) QueryAllPoolInfo

func (c *Cli) QueryAllPoolInfo() ([]*PoolResp, error)

func (*Cli) QuerySnapshot

func (c *Cli) QuerySnapshot(name string) error

func (*Cli) QueryVolume

func (c *Cli) QueryVolume(name string) error

func (*Cli) RunCmd

func (c *Cli) RunCmd(args ...string) (string, error)

func (*Cli) StartServer

func (c *Cli) StartServer() error

type CliError

type CliError struct {
	Msg  string
	Code string
}

func NewCliErrorBase

func NewCliErrorBase(msg, code string) *CliError

func (*CliError) Error

func (c *CliError) Error() string

type Config

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

type Driver

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

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(opt *pb.CreateVolumeSnapshotOpts) (*VolumeSnapshotSpec, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(opt *pb.CreateVolumeOpts) (*VolumeSpec, error)

func (*Driver) CreateVolumeGroup

func (d *Driver) CreateVolumeGroup(
	opt *pb.CreateVolumeGroupOpts,
	vg *VolumeGroupSpec) (*VolumeGroupSpec, error)

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(opt *pb.DeleteVolumeSnapshotOpts) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(opt *pb.DeleteVolumeOpts) error

func (*Driver) DeleteVolumeGroup

func (d *Driver) DeleteVolumeGroup(
	opt *pb.DeleteVolumeGroupOpts,
	vg *VolumeGroupSpec,
	volumes []*VolumeSpec) (*VolumeGroupSpec, []*VolumeSpec, error)

func (*Driver) ExtendVolume

func (d *Driver) ExtendVolume(opt *pb.ExtendVolumeOpts) (*VolumeSpec, error)

func (*Driver) InitializeConnection

func (d *Driver) InitializeConnection(opt *pb.CreateAttachmentOpts) (*ConnectionInfo, error)

func (*Driver) InitializeSnapshotConnection

func (d *Driver) InitializeSnapshotConnection(opt *pb.CreateSnapshotAttachmentOpts) (*ConnectionInfo, error)

func (*Driver) ListPools

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

func (*Driver) PullSnapshot

func (d *Driver) PullSnapshot(snapIdentifier string) (*VolumeSnapshotSpec, error)

func (*Driver) PullVolume

func (d *Driver) PullVolume(volIdentifier string) (*VolumeSpec, error)

func (*Driver) Setup

func (d *Driver) Setup() error

func (*Driver) TerminateConnection

func (d *Driver) TerminateConnection(opt *pb.DeleteAttachmentOpts) error

func (*Driver) TerminateSnapshotConnection

func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) error

func (*Driver) Unset

func (d *Driver) Unset() error

func (*Driver) UpdateVolumeGroup

func (d *Driver) UpdateVolumeGroup(
	opt *pb.UpdateVolumeGroupOpts,
	vg *VolumeGroupSpec,
	addVolumesRef []*VolumeSpec,
	removeVolumesRef []*VolumeSpec) (*VolumeGroupSpec, []*VolumeSpec, []*VolumeSpec, error)

type EncryptOpts

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

type PoolResp

type PoolResp struct {
	PoolId        string `fsc:"pool_id"`
	TotalCapacity int64  `fsc:"total_capacity"`
	AllocCapacity int64  `fsc:"alloc_capacity"`
	UsedCapacity  int64  `fsc:"used_capacity"`
	PoolModel     int64  `fsc:"pool_model"`
}

type SnapshotResp

type SnapshotResp struct {
	Name           string `fsc:"snap_name"`
	FatherName     string `fsc:"father_name"`
	Status         int    `fsc:"status"`
	Size           int64  `fsc:"snap_size"`
	RealSize       int64  `fsc:"real_size"`
	PoolId         string `fsc:"pool_id"`
	DeletePriority int    `fsc:"delete_priority"`
	CreateTime     int64  `fsc:"create_time"`
	EncryptFlag    bool   `fsc:"encrypt_flag"`
	SmartCacheFlag bool   `fsc:"smartCacheFlag"`
	TreeId         string `fsc:"tree_id"`
	BranchId       string `fsc:"branch_id"`
	SnapId         string `fsc:"snap_id"`
}

type VolumeResp

type VolumeResp struct {
	Name        string `fsc:"vol_name"`
	FatherName  string `fsc:"father_name"`
	Status      int    `fsc:"status"`
	Size        int64  `fsc:"vol_size"`
	RealSize    int64  `fsc:"real_size"`
	PoolId      string `fsc:"pool_id"`
	CreateTime  int64  `fsc:"create_time"`
	EncryptFlag bool   `fsc:"encrypt_flag"`
	LunId       string `fsc:"lun_id"`
	LLDProgress int    `fsc:"lld_progress"`
	RWRight     int    `fsc:"rw_right"`
	WWN         int    `fsc:"wwn"`
}

Jump to

Keyboard shortcuts

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