Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeName(id string) string
- func NewCliError(code string) error
- func ParseResp(data string) map[string]string
- func Unmarshal(data []byte, v interface{}) error
- func Value(data map[string]string, v reflect.Value) error
- type AuthOptions
- type Cli
- func (c *Cli) CreateSnapshot(name string, volName string, smartFlag bool) error
- func (c *Cli) CreateVolume(name string, size int64, isThin bool, poolId string, encryptOpt *EncryptOpts) error
- func (c *Cli) CreateVolumeFromSnapshot(name string, size int64, snapName string) error
- func (c *Cli) DeleteSnapshot(name string) error
- func (c *Cli) DeleteVolume(name string) error
- func (c *Cli) ExtendVolume(name string, newSize int64) error
- func (c *Cli) QueryAllPoolInfo() ([]*PoolResp, error)
- func (c *Cli) QuerySnapshot(name string) error
- func (c *Cli) QueryVolume(name string) error
- func (c *Cli) RunCmd(args ...string) (string, error)
- func (c *Cli) StartServer() error
- type CliError
- type Config
- type Driver
- func (d *Driver) CreateSnapshot(opt *pb.CreateVolumeSnapshotOpts) (*VolumeSnapshotSpec, error)
- func (d *Driver) CreateVolume(opt *pb.CreateVolumeOpts) (*VolumeSpec, error)
- func (d *Driver) CreateVolumeGroup(opt *pb.CreateVolumeGroupOpts, vg *VolumeGroupSpec) (*VolumeGroupSpec, error)
- func (d *Driver) DeleteSnapshot(opt *pb.DeleteVolumeSnapshotOpts) error
- func (d *Driver) DeleteVolume(opt *pb.DeleteVolumeOpts) error
- func (d *Driver) DeleteVolumeGroup(opt *pb.DeleteVolumeGroupOpts, vg *VolumeGroupSpec, volumes []*VolumeSpec) (*VolumeGroupSpec, []*VolumeSpec, error)
- func (d *Driver) ExtendVolume(opt *pb.ExtendVolumeOpts) (*VolumeSpec, error)
- func (d *Driver) InitializeConnection(opt *pb.CreateAttachmentOpts) (*ConnectionInfo, error)
- func (d *Driver) InitializeSnapshotConnection(opt *pb.CreateSnapshotAttachmentOpts) (*ConnectionInfo, error)
- func (d *Driver) ListPools() ([]*StoragePoolSpec, error)
- func (d *Driver) PullSnapshot(snapIdentifier string) (*VolumeSnapshotSpec, error)
- func (d *Driver) PullVolume(volIdentifier string) (*VolumeSpec, error)
- func (d *Driver) Setup() error
- func (d *Driver) TerminateConnection(opt *pb.DeleteAttachmentOpts) error
- func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) error
- func (d *Driver) Unset() error
- func (d *Driver) UpdateVolumeGroup(opt *pb.UpdateVolumeGroupOpts, vg *VolumeGroupSpec, ...) (*VolumeGroupSpec, []*VolumeSpec, []*VolumeSpec, error)
- type EncryptOpts
- type PoolResp
- type SnapshotResp
- type VolumeResp
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 NewCliError ¶
Types ¶
type AuthOptions ¶
type Cli ¶
type Cli struct { // Command executer BaseExecuter exec.Executer // Command Root exectuer RootExecuter exec.Executer // contains filtered or unexported fields }
func (*Cli) CreateSnapshot ¶
func (*Cli) CreateVolume ¶
func (*Cli) CreateVolumeFromSnapshot ¶
func (*Cli) DeleteSnapshot ¶
func (*Cli) DeleteVolume ¶
func (*Cli) QueryAllPoolInfo ¶
func (*Cli) QuerySnapshot ¶
func (*Cli) QueryVolume ¶
func (*Cli) StartServer ¶
type CliError ¶
func NewCliErrorBase ¶
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) PullSnapshot ¶
func (*Driver) PullVolume ¶
func (*Driver) TerminateConnection ¶
func (d *Driver) TerminateConnection(opt *pb.DeleteAttachmentOpts) error
func (*Driver) TerminateSnapshotConnection ¶
func (d *Driver) TerminateSnapshotConnection(opt *pb.DeleteSnapshotAttachmentOpts) 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 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"` }
Click to show internal directories.
Click to hide internal directories.