eternus

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KLunId        = "eternusVolId"
	KLunGrpId     = "eternusLunGrpId"
	KLunMaskGrpNo = "eternusLunMaskGrpNo"
	KHostId       = "eternusHostId"
	KSnapId       = "eternusSnapshotId"
	KSnapLunId    = "eternusSnapshotVolId"
)

response key name

View Source
const (
	CreateVolume = "create volume"
)

define command

View Source
const (
	LBASize = 2097152
)

define eternus specific parameter

View Source
const (
	NotFound = "0110"
)

define error code

View Source
const (
	SSHPort = "22"
)

define config parameter

Variables

This section is empty.

Functions

func EqualIP

func EqualIP(ip1 string, ip2 string) bool

EqualIP : if ip address is eauql return ture

func GetFnvHash

func GetFnvHash(str string) string

GetFnvHash :

func GetPortNumber

func GetPortNumber(caModuleId string, portNumber string) string

GetPortNumber

func GetPortNumberV2

func GetPortNumberV2(caModuleId string, portNumber string) string

GetPortNumberV2

func IsIPv4

func IsIPv4(ip string) bool

func ParseIPv4

func ParseIPv4(ip string) string

ParseIPv4 : convert hex string to ip address

func ParseIPv6

func ParseIPv6(ip string) string

ParseIPv6 : convert hex string to ip address

Types

type AuthOptions

type AuthOptions struct {
	Username        string `yaml:"username,omitempty"`
	Password        string `yaml:"password,omitempty"`
	AdminUsername   string `yaml:"adminUsername,omitempty"`
	AdminPassword   string `yaml:"adminPassword,omitempty"`
	PwdEncrypter    string `yaml:"PwdEncrypter,omitempty"`
	EnableEncrypted bool   `yaml:"EnableEncrypted,omitempty"`
	Endpoint        string `yaml:"endpoint,omitempty"`
	Insecure        bool   `yaml:"insecure,omitempty"`
}

type Driver

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

Driver

func (*Driver) CreateSnapshot

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

CreateSnapshot :

func (*Driver) CreateVolume

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

CreateVolume : create volume.

func (*Driver) CreateVolumeGroup

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

func (*Driver) DeleteSnapshot

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

DeleteSnapshot :

func (*Driver) DeleteVolume

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

DeleteVolume : delete volume

func (*Driver) DeleteVolumeGroup

func (d *Driver) DeleteVolumeGroup(opt *pb.DeleteVolumeGroupOpts) error

func (*Driver) ExtendVolume

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

ExtendVolume : extend volume

func (*Driver) InitializeConnection

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

InitializeConnection :

func (*Driver) InitializeSnapshotConnection

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

func (*Driver) ListPools

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

ListPools : get pool list

func (*Driver) PullSnapshot

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

PullSnapshot :

func (*Driver) PullVolume

func (d *Driver) PullVolume(id string) (*model.VolumeSpec, error)

PullVolume : get volume information

func (*Driver) Setup

func (d *Driver) Setup() (err error)

Setup eternus driver

func (*Driver) TerminateConnection

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

TerminateConnection :

func (*Driver) TerminateSnapshotConnection

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

func (*Driver) Unset

func (d *Driver) Unset() error

Unset eternus driver

func (*Driver) UpdateVolumeGroup

func (d *Driver) UpdateVolumeGroup(opt *pb.UpdateVolumeGroupOpts) (*model.VolumeGroupSpec, error)

type EternusClient

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

EternusClient :

func NewClient

func NewClient(opt *AuthOptions) (*EternusClient, error)

func NewClientForAdmin

func NewClientForAdmin(opt *AuthOptions) (*EternusClient, error)

func (*EternusClient) AddFcHostWithCheck

func (c *EternusClient) AddFcHostWithCheck(name string, wwnName string) (string, bool, error)

AddFcHostWithCheck :

func (*EternusClient) AddHostAffinity

func (c *EternusClient) AddHostAffinity(lunGrpID string, hostID string, iscsiPort string) (string, error)

AddHostAffinity :

func (*EternusClient) AddIscsiHostWithCheck

func (c *EternusClient) AddIscsiHostWithCheck(name string, iscsiName string, ipAddr string) (string, bool, error)

AddIscsiHostWithCheck :

func (*EternusClient) AddLunGroupWithCheck

func (c *EternusClient) AddLunGroupWithCheck(lgName string, lunID string) (string, error)

AddLunGroupWithCheck :

func (*EternusClient) AddMapping

func (c *EternusClient) AddMapping(lunID string, hostLunID string, port string) error

AddMapping :

func (*EternusClient) CreateSnapshot

func (c *EternusClient) CreateSnapshot(srcLunID string, destLunID string) error

CreateSnapshot is for admin role

func (*EternusClient) CreateVolume

func (c *EternusClient) CreateVolume(id string, size int64, desc string,
	poolName string, provPolicy string) (Volume, error)

CreateVolume :

func (*EternusClient) DeleteFcHostByName

func (c *EternusClient) DeleteFcHostByName(name string) error

DeleteFcHost :

func (*EternusClient) DeleteHostAffinity

func (c *EternusClient) DeleteHostAffinity(portNumber string, hostname string) error

DeleteHostAffinity :

func (*EternusClient) DeleteIscsiHostByName

func (c *EternusClient) DeleteIscsiHostByName(name string) error

DeleteIscsiHost :

func (*EternusClient) DeleteLunGroupByName

func (c *EternusClient) DeleteLunGroupByName(lgName string) error

DeleteLunGroup :

func (*EternusClient) DeleteMapping

func (c *EternusClient) DeleteMapping(hostLunID string, Port string) error

DeleteMapping :

func (*EternusClient) DeleteSnapshot

func (c *EternusClient) DeleteSnapshot(sid string) error

DeleteSnapshot is for admin role

func (*EternusClient) DeleteVolume

func (c *EternusClient) DeleteVolume(volumeNumber string) error

DeleteVolume :

func (*EternusClient) Destroy

func (c *EternusClient) Destroy() error

func (*EternusClient) ExtendVolume

func (c *EternusClient) ExtendVolume(volumeNumber string, size int64) error

ExtendVolume :

func (*EternusClient) GetFcPortInfo

func (c *EternusClient) GetFcPortInfo(ceSupport bool, needHostAffinity bool) (FcPortInfo, error)

GetFcPortInfo :

func (*EternusClient) GetHostLunID

func (c *EternusClient) GetHostLunID(lunGrpID string, lunID string) (string, error)

GetHostLunID :

func (*EternusClient) GetIscsiPortInfo

func (c *EternusClient) GetIscsiPortInfo(ceSupport bool, needHostAffinity bool) (IscsiPortInfo, error)

GetIscsiPortInfo :

func (*EternusClient) GetLunGroupByName

func (c *EternusClient) GetLunGroupByName(name string) (LunGroup, error)

GetLunGroupByName :

func (*EternusClient) GetVolume

func (c *EternusClient) GetVolume(lunID string) (Volume, error)

GetVolume :

func (*EternusClient) GetVolumeByName

func (c *EternusClient) GetVolumeByName(name string) (Volume, error)

GetVolumeByName :

func (*EternusClient) ListAllStoragePools

func (c *EternusClient) ListAllStoragePools() ([]StoragePool, error)

ListAllStoragePools :

func (*EternusClient) ListMapping

func (c *EternusClient) ListMapping(port string) ([]Mapping, error)

ListMapping :

func (*EternusClient) ListSnapshot

func (c *EternusClient) ListSnapshot() ([]SnapShot, error)

ListSnapshot is for admin role

func (*EternusClient) ListStoragePools

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

ListStoragePools :

func (*EternusClient) RemoveVolumeFromLunGroup

func (c *EternusClient) RemoveVolumeFromLunGroup(lunID string, lgName string) error

RemoveVolumeFromLunGroup :

type EternusConfig

type EternusConfig struct {
	AuthOptions `yaml:"authOptions"`
	Replication `yaml:"replication"`
	Pool        map[string]PoolProperties `yaml:"pool,flow"`
	TargetIp    string                    `yaml:"targetIp,omitempty"`
	CeSupport   bool                      `yaml:"ceSupport,omitempty"`
}

type FcPortInfo

type FcPortInfo struct {
	PortNumber string
	Wwpn       string
}

FcPortInfo is iscsi port info

type IscsiPortInfo

type IscsiPortInfo struct {
	PortNumber     string
	IscsiName      string
	Ip             string
	TcpPort        int
	IsnsServerIp   string
	IsnsServerPort int
}

IscsiPortInfo is iscsi port info

type LunGroup

type LunGroup struct {
	Volumes []LunGroupVolume
}

LunGroup is lun group info

type LunGroupVolume

type LunGroupVolume struct {
	Id          string
	Name        string
	RawStatus   string
	RoundStatus string
	Size        int64
	Uid         string
	Lun         string
}

LunGroupVolume is lun group info

type Mapping

type Mapping struct {
	Lun               string
	VolumeNumber      string
	VolumeName        string
	VolumeRawStatus   string
	VolumeRoundStatus string
	VolumeSize        int64
}

Mapping

type Replication

type Replication struct {
	RemoteAuthOpt AuthOptions `yaml:"remoteAuthOptions"`
}

type SnapShot

type SnapShot struct {
	Sid        string
	Gen        string
	GenTotal   string
	Type       string
	VolumeType string
	SrcNo      string
	SrcName    string
	DestNo     string
	DestName   string
	Status     string
	Phase      string
	ErrorCode  string
	Requestor  string
}

SnapShot

type StoragePool

type StoragePool struct {
	Id            string
	Name          string
	TotalCapacity int64
	FreeCapacity  int64
}

StoragePool is Pool information

type System

type System struct {
	Id          string `json:"ID"`
	Name        string `json:"NAME"`
	Location    string `json:"LOCATION"`
	ProductMode string `json:"PRODUCTMODE"`
	Wwn         string `json:"wwn"`
}

type Volume

type Volume struct {
	Id            string
	Name          string
	Status        string
	Size          int64
	TotalCapacity int64
	FreeCapacity  int64
	PoolName      string
	PoolId        string
}

Volume is Pool information

Jump to

Keyboard shortcuts

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