oceanstor

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KLunId  = "huaweiLunId"
	KSnapId = "huaweiSnapId"
	KPairId = "huaweiReplicaPairId" // replication pair
)

metadata keys

View Source
const (
	PrefixMappingView = "OpenSDSMappingView"
	PrefixLunGroup    = "OpenSDSLunGroup"
	PrefixHostGroup   = "OpenSDSHostGroup"
)

name prefix

View Source
const (
	ObjectTypeLun             = "11"
	ObjectTypeHost            = "21"
	ObjectTypeSnapshot        = "27"
	ObjectTypeHostGroup       = "14"
	ObjectTypeController      = "207"
	ObjectTypePool            = "216"
	ObjectTypeLunCopy         = 219 // not string, should be integer
	ObjectTypeIscsiInitiator  = "222"
	ObjectTypeFcInitiator     = "223"
	ObjectTypeMappingView     = "245"
	ObjectTypeLunGroup        = "256"
	ObjectTypeReplicationPair = "263"
)

object type id

View Source
const (
	ErrorConnectToServer               = -403
	ErrorUnauthorizedToServer          = -401
	ErrorObjectUnavailable             = 1077948996
	ErrorHostGroupNotExist             = 1077937500
	ErrorObjectNameAlreadyExist        = 1077948993
	ErrorHostAlreadyInHostGroup        = 1077937501
	ErrorObjectIDNotUnique             = 1077948997
	ErrorHostGroupAlreadyInMappingView = 1073804556
	ErrorLunGroupAlreadyInMappingView  = 1073804560
	ErrorLunNotExist                   = 1077936859
)

Error Code

View Source
const (
	ThickLunType         = 0
	ThinLunType          = 1
	MaxNameLength        = 31
	MaxDescriptionLength = 170
	PortNumPerContr      = 2
	PwdExpired           = 3
	PwdReset             = 4
)

misc

View Source
const (
	LunCopySpeedLow     = "1"
	LunCopySpeedMedium  = "2"
	LunCopySpeedHigh    = "3"
	LunCopySpeedHighest = "4"
)

lun copy

View Source
const (
	LunReadyWaitInterval = 2 * time.Second
	LunReadyWaitTimeout  = 20 * time.Second
	LunCopyWaitInterval  = 2 * time.Second
	LunCopyWaitTimeout   = 200 * time.Second
)
View Source
const (
	StatusHealth          = "1"
	StatusQosActive       = "2"
	StatusRunning         = "10"
	StatusVolumeReady     = "27"
	StatusLunCoping       = "39"
	StatusLunCopyStop     = "38"
	StatusLunCopyQueue    = "37"
	StatusLunCopyNotStart = "36"
	StatusLunCopyReady    = "40"
	StatusActive          = "43"
	StatusQosInactive     = "45"
)

Object status key id

View Source
const (
	ArrayTypeReplication   = "1"
	ArrayTypeHeterogeneity = "2"
	ArrayTypeUnknown       = "3"
)

Array type

View Source
const (
	HealthStatusNormal          = "1"
	HealthStatusFault           = "2"
	HealthStatusPreFail         = "3"
	HealthStatusPartiallyBroken = "4"
	HealthStatusDegraded        = "5"
	HealthStatusBadSectorsFound = "6"
	HealthStatusBitErrorsFound  = "7"
	HealthStatusConsistent      = "8"
	HealthStatusInconsistent    = "9"
	HealthStatusBusy            = "10"
	HealthStatusNoInput         = "11"
	HealthStatusLowBattery      = "12"
	HealthStatusSingleLinkFault = "13"
	HealthStatusInvalid         = "14"
	HealthStatusWriteProtect    = "15"
)

Health status

View Source
const (
	RunningStatusNormal      = "1"
	RunningStatusLinkUp      = "10"
	RunningStatusLinkDown    = "11"
	RunningStatusOnline      = "27"
	RunningStatusDisabled    = "31"
	RunningStatusInitialSync = "21"
	RunningStatusSync        = "23"
	RunningStatusSynced      = "24"
	RunningStatusSplit       = "26"
	RunningStatusInterrupted = "34"
	RunningStatusInvalid     = "35"
	RunningStatusConnecting  = "101"
)

Running status

View Source
const (
	DefaultReplicaWaitInterval = 1 * time.Second
	DefaultReplicaWaitTimeout  = 20 * time.Second

	ReplicaSyncMode  = "1"
	ReplicaAsyncMode = "2"
	ReplicaSpeed     = "2"
	ReplicaPeriod    = "3600"
	ReplicaSecondRo  = "2"
	ReplicaSecondRw  = "3"

	ReplicaRunningStatusKey   = "RUNNINGSTATUS"
	ReplicaHealthStatusKey    = "HEALTHSTATUS"
	ReplicaHealthStatusNormal = "1"

	ReplicaLocalDataStatusKey   = "PRIRESDATASTATUS"
	ReplicaRemoteDataStatusKey  = "SECRESDATASTATUS"
	ReplicaDataSyncKey          = "ISDATASYNC"
	ReplicaDataStatusSynced     = "1"
	ReplicaDataStatusComplete   = "2"
	ReplicaDataStatusIncomplete = "3"
)
View Source
const (
	PerfUtilizationPercent = "18"  // usage ratioPerf
	PerfBandwidth          = "21"  // mbs
	PerfIOPS               = "22"  // tps
	PerfServiceTime        = "29"  // excluding queue time(ms)
	PerfCpuUsage           = "68"  // %
	PerfCacheHitRatio      = "303" // %
	PerfLatency            = "370" // ms
)

performance key ids

View Source
const UnitGi = 1024 * 1024 * 1024

Variables

Functions

func EncodeHostName

func EncodeHostName(name string) string

func EncodeName

func EncodeName(id string) string

func Gb2Sector

func Gb2Sector(gb int64) int64

func IsNotFoundError

func IsNotFoundError(err error) bool

func Sector2Gb

func Sector2Gb(sec string) int64

func TruncateDescription

func TruncateDescription(desc string) string

Types

type ArrayInnerError

type ArrayInnerError struct {
	Data interface{} `json:"data"`
	Err  Error       `json:"error"`
}

func (*ArrayInnerError) Error

func (e *ArrayInnerError) Error() string

type Auth

type Auth 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,omitempty"`
	Password        string `yaml:"password,omitempty"`
	VstoreName      string `yaml:"vstoreName,omitempty"`
	PwdEncrypter    string `yaml:"PwdEncrypter,omitempty"`
	EnableEncrypted bool   `yaml:"EnableEncrypted,omitempty"`
	Endpoints       string `yaml:"endpoints,omitempty"`
	Insecure        bool   `yaml:"insecure,omitempty"`
}

type AuthResp

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

type Config

type Config struct {
	Resource string
	Metrics  []string
	Units    []string
}

type Configs

type Configs struct {
	Cfgs []Config `yaml:"resources"`
}

type Count

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

type Driver

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

func (*Driver) CreateSnapshot

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

func (*Driver) CreateVolume

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

func (*Driver) CreateVolumeGroup

func (d *Driver) CreateVolumeGroup(opt *pb.CreateVolumeGroupOpts) (*model.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) error

func (*Driver) ExtendVolume

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

ExtendVolume ...

func (*Driver) InitializeConnection

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

func (*Driver) InitializeConnectionFC

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

func (*Driver) InitializeConnectionIscsi

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

func (*Driver) InitializeSnapshotConnection

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

func (*Driver) ListPools

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

func (*Driver) PullSnapshot

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

func (*Driver) PullVolume

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

func (*Driver) Setup

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

func (*Driver) TerminateConnection

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

func (*Driver) TerminateConnectionFC

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

func (*Driver) TerminateConnectionIscsi

func (d *Driver) TerminateConnectionIscsi(opt *pb.DeleteVolumeAttachmentOpts) 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) (*model.VolumeGroupSpec, error)

type Error

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

type FCInitiator

type FCInitiator struct {
	Isfree        bool   `json:"ISFREE"`
	Id            string `json:"ID"`
	Type          int    `json:"TYPE"`
	RunningStatus string `json:"RUNNINGSTATUS"`
	ParentId      string `json:"PARENTID"`
	ParentType    int    `json:"PARENTTYPE"`
}

type FCInitiatorsResp

type FCInitiatorsResp struct {
	Data  []FCInitiator `json:"data"`
	Error Error         `json:"error"`
}

type FCTargWWPN

type FCTargWWPN struct {
	IniPortWWN  string `json:"INITIATOR_PORT_WWN"`
	TargPortWWN string `json:"TARGET_PORT_WWN"`
}

type FCTargWWPNResp

type FCTargWWPNResp struct {
	Data  []FCTargWWPN `json:"data"`
	Error Error        `json:"error"`
}

type GenericResult

type GenericResult struct {
	Data  interface{} `json:"data"`
	Error Error       `json:"error"`
}

type Host

type Host struct {
	Id               string `json:"ID"`
	Name             string `json:"NAME"`
	OsType           string `json:"OPERATIONSYSTEM"`
	Ip               string `json:"IP"`
	IsAddToHostGroup bool   `json:"ISADD2HOSTGROUP"`
}

type HostAssociateLun

type HostAssociateLun struct {
	Id                string `json:"ID"`
	AssociateMetadata string `json:"ASSOCIATEMETADATA"`
}

type HostAssociateLunsResp

type HostAssociateLunsResp struct {
	Data  []HostAssociateLun `json:"data"`
	Error Error              `json:"error"`
}

type HostGroup

type HostGroup struct {
	Id                string `json:"ID"`
	Name              string `json:"NAME"`
	Description       string `json:"DESCRIPTION"`
	IsAdd2MappingView string `json:"ISADD2MAPPINGVIEW"`
}

type HostGroupResp

type HostGroupResp struct {
	Data  HostGroup `json:"data"`
	Error Error     `json:"error"`
}

type HostGroupsResp

type HostGroupsResp struct {
	Data  []HostGroup `json:"data"`
	Error Error       `json:"error"`
}

type HostResp

type HostResp struct {
	Data  Host  `json:"data"`
	Error Error `json:"error"`
}

type HostsResp

type HostsResp struct {
	Data  []Host `json:"data"`
	Error Error  `json:"error"`
}

type Initiator

type Initiator struct {
	Id         string `json:"ID"`
	Name       string `json:"NAME"`
	ParentId   string `json:"PARENTID"`
	ParentType string `json:"PARENTTYPE"`
	ParentName string `json:"PARENTNAME"`
}

type InitiatorResp

type InitiatorResp struct {
	Data  Initiator `json:"data"`
	Error Error     `json:"error"`
}

type InitiatorsResp

type InitiatorsResp struct {
	Data  []Initiator `json:"data"`
	Error Error       `json:"error"`
}

type IscsiTgtPort

type IscsiTgtPort struct {
	EthPortId string `json:"ETHPORTID"`
	Id        string `json:"ID"`
	Tpgt      string `json:"TPGT"`
	Type      int    `json:"TYPE"`
}

type IscsiTgtPortsResp

type IscsiTgtPortsResp struct {
	Data  []IscsiTgtPort `json:"data"`
	Error Error          `json:"error"`
}

type Lun

type Lun struct {
	AllocCapacity               string `json:"ALLOCCAPACITY"`
	AllocType                   string `json:"ALLOCTYPE"`
	Capability                  string `json:"CAPABILITY"`
	Capacity                    string `json:"CAPACITY"`
	CapacityAlarmLevel          string `json:"CAPACITYALARMLEVEL"`
	Description                 string `json:"DESCRIPTION"`
	DrsEnable                   string `json:"DRS_ENABLE"`
	EnableCompression           string `json:"ENABLECOMPRESSION"`
	EnableIscsiThinLunThreshold string `json:"ENABLEISCSITHINLUNTHRESHOLD"`
	EnableSmartDedup            string `json:"ENABLESMARTDEDUP"`
	ExposedToInitiator          string `json:"EXPOSEDTOINITIATOR"`
	ExtendIfSwitch              string `json:"EXTENDIFSWITCH"`
	HealthStatus                string `json:"HEALTHSTATUS"`
	Id                          string `json:"ID"`
	IsAdd2LunGroup              string `json:"ISADD2LUNGROUP"`
	IsCheckZeroPage             string `json:"ISCHECKZEROPAGE"`
	IscsiThinLunThreshold       string `json:"ISCSITHINLUNTHRESHOLD"`
	LunMigrationOrigin          string `json:"LUNMigrationOrigin"`
	MirrorPolicy                string `json:"MIRRORPOLICY"`
	MirrorType                  string `json:"MIRRORTYPE"`
	Name                        string `json:"NAME"`
	OwningController            string `json:"OWNINGCONTROLLER"`
	ParentId                    string `json:"PARENTID"`
	ParentName                  string `json:"PARENTNAME"`
	PrefetChPolicy              string `json:"PREFETCHPOLICY"`
	PrefetChValue               string `json:"PREFETCHVALUE"`
	RemoteLunId                 string `json:"REMOTELUNID"`
	RemoteReplicationIds        string `json:"REMOTEREPLICATIONIDS"`
	ReplicationCapacity         string `json:"REPLICATION_CAPACITY"`
	RunningStatus               string `json:"RUNNINGSTATUS"`
	RunningWritePolicy          string `json:"RUNNINGWRITEPOLICY"`
	SectorSize                  string `json:"SECTORSIZE"`
	SnapShotIds                 string `json:"SNAPSHOTIDS"`
	SubType                     string `json:"SUBTYPE"`
	ThinCapacityUsage           string `json:"THINCAPACITYUSAGE"`
	Type                        int    `json:"TYPE"`
	UsageType                   string `json:"USAGETYPE"`
	WorkingController           string `json:"WORKINGCONTROLLER"`
	WritePolicy                 string `json:"WRITEPOLICY"`
	Wwn                         string `json:"WWN"`
	RemoteLunWwn                string `json:"remoteLunWwn"`
}

type LunGroup

type LunGroup struct {
	Id                string `json:"ID"`
	Name              string `json:"NAME"`
	Description       string `json:"DESCRIPTION"`
	IsAdd2MappingView string `json:"ISADD2MAPPINGVIEW"`
}

type LunGroupResp

type LunGroupResp struct {
	Data  LunGroup `json:"data"`
	Error Error    `json:"error"`
}

type LunGroupsResp

type LunGroupsResp struct {
	Data  []LunGroup `json:"data"`
	Error Error      `json:"error"`
}

type LunResp

type LunResp struct {
	Data  Lun   `json:"data"`
	Error Error `json:"error"`
}

type LunsResp

type LunsResp struct {
	Data  []Lun `json:"data"`
	Error Error `json:"error"`
}

type MappingView

type MappingView struct {
	Id          string `json:"ID"`
	Name        string `json:"NAME"`
	Description string `json:"DESCRIPTION"`
}

type MappingViewResp

type MappingViewResp struct {
	Data  MappingView `json:"data"`
	Error Error       `json:"error"`
}

type MappingViewsResp

type MappingViewsResp struct {
	Data  []MappingView `json:"data"`
	Error Error         `json:"error"`
}

type MetricDriver

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

func (*MetricDriver) CollectControllerMetrics

func (d *MetricDriver) CollectControllerMetrics() ([]*model.MetricSpec, error)

func (*MetricDriver) CollectMetrics

func (d *MetricDriver) CollectMetrics() ([]*model.MetricSpec, error)

CollectMetrics: Driver entry point to collect metrics. This will be invoked by the dock []*model.MetricSpec -> the array of metrics to be returned

func (*MetricDriver) CollectPerformanceMetrics

func (d *MetricDriver) CollectPerformanceMetrics(resId string, metricList []string) (map[string]float64, error)

func (*MetricDriver) CollectPoolMetrics

func (d *MetricDriver) CollectPoolMetrics() ([]*model.MetricSpec, error)

func (*MetricDriver) GetMetricList

func (d *MetricDriver) GetMetricList(resourceType string) (supportedMetrics []string, err error)

getMetricList:- is to get the list of supported metrics for given resource type supportedMetrics -> list of supported metrics

func (*MetricDriver) Setup

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

func (*MetricDriver) Teardown

func (*MetricDriver) Teardown() error

type NotFoundError

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type ObjCountResp

type ObjCountResp struct {
	Data  Count `json:"data"`
	Error Error `json:"error"`
}

type OceanStorClient

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

func NewClient

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

func (*OceanStorClient) AddFCPortTohost

func (c *OceanStorClient) AddFCPortTohost(hostId string, wwn string) error

func (*OceanStorClient) AddHostToHostGroup

func (c *OceanStorClient) AddHostToHostGroup(hostId string) (string, error)

func (*OceanStorClient) AddHostWithCheck

func (c *OceanStorClient) AddHostWithCheck(hostInfo *pb.HostInfo) (string, error)

func (*OceanStorClient) AddInitiatorToArray

func (c *OceanStorClient) AddInitiatorToArray(initiatorName string) error

func (*OceanStorClient) AddInitiatorToHost

func (c *OceanStorClient) AddInitiatorToHost(hostId, initiatorName string) error

func (*OceanStorClient) AddInitiatorToHostWithCheck

func (c *OceanStorClient) AddInitiatorToHostWithCheck(hostId, initiatorName string) error

func (*OceanStorClient) AssocateHostGroupToMappingView

func (c *OceanStorClient) AssocateHostGroupToMappingView(viewId, groupId string) error

func (*OceanStorClient) AssocateLunGroupToMappingView

func (c *OceanStorClient) AssocateLunGroupToMappingView(viewId, groupId string) error

func (*OceanStorClient) AssociateHostToHostGroup

func (c *OceanStorClient) AssociateHostToHostGroup(hostGrpId, hostId string) error

func (*OceanStorClient) AssociateLunToLunGroup

func (c *OceanStorClient) AssociateLunToLunGroup(lunGrpId, lunId string) error

func (*OceanStorClient) CheckLunExist

func (c *OceanStorClient) CheckLunExist(id, wwn string) bool

func (*OceanStorClient) CheckPairExist

func (c *OceanStorClient) CheckPairExist(id string) bool

func (*OceanStorClient) CreateHostGroup

func (c *OceanStorClient) CreateHostGroup(groupName string) (string, error)

func (*OceanStorClient) CreateHostGroupWithCheck

func (c *OceanStorClient) CreateHostGroupWithCheck(hostGrpName string) (string, error)

func (*OceanStorClient) CreateLunCopy

func (c *OceanStorClient) CreateLunCopy(name, srcid, tgtid, copyspeed string) (string, error)

func (*OceanStorClient) CreateLunGroup

func (c *OceanStorClient) CreateLunGroup(groupName string) (string, error)

func (*OceanStorClient) CreateMappingView

func (c *OceanStorClient) CreateMappingView(name string) (string, error)

func (*OceanStorClient) CreatePair

func (c *OceanStorClient) CreatePair(params map[string]interface{}) (*ReplicationPair, error)

func (*OceanStorClient) CreateSnapshot

func (c *OceanStorClient) CreateSnapshot(lunId, name, desc string) (*Snapshot, error)

func (*OceanStorClient) CreateVolume

func (c *OceanStorClient) CreateVolume(name string, size int64, desc string, poolId string, provPolicy string) (*Lun, error)

func (*OceanStorClient) DeleteHost

func (c *OceanStorClient) DeleteHost(id string) error

func (*OceanStorClient) DeleteHostGroup

func (c *OceanStorClient) DeleteHostGroup(id string) error

func (*OceanStorClient) DeleteLunCopy

func (c *OceanStorClient) DeleteLunCopy(luncopyid string) error

func (*OceanStorClient) DeleteLunGroup

func (c *OceanStorClient) DeleteLunGroup(id string) error

func (*OceanStorClient) DeleteMappingView

func (c *OceanStorClient) DeleteMappingView(id string) error

func (*OceanStorClient) DeletePair

func (c *OceanStorClient) DeletePair(id string) error

func (*OceanStorClient) DeleteSnapshot

func (c *OceanStorClient) DeleteSnapshot(id string) error

func (*OceanStorClient) DeleteVolume

func (c *OceanStorClient) DeleteVolume(id string) error

func (*OceanStorClient) Destroy

func (c *OceanStorClient) Destroy() error

func (*OceanStorClient) DoMapping

func (c *OceanStorClient) DoMapping(lunId, hostGrpId, hostId string) error

func (*OceanStorClient) ExtendVolume

func (c *OceanStorClient) ExtendVolume(size int64, id string) error

ExtendVolume ...

func (*OceanStorClient) FindHostGroup

func (c *OceanStorClient) FindHostGroup(groupName string) (string, error)

func (*OceanStorClient) FindLunGroup

func (c *OceanStorClient) FindLunGroup(groupName string) (string, error)

func (*OceanStorClient) FindMappingView

func (c *OceanStorClient) FindMappingView(name string) (string, error)

func (*OceanStorClient) GetArrayInfo

func (c *OceanStorClient) GetArrayInfo() (*System, error)

func (*OceanStorClient) GetHostFCInitiators

func (c *OceanStorClient) GetHostFCInitiators(hostId string) ([]string, error)

func (*OceanStorClient) GetHostIdByName

func (c *OceanStorClient) GetHostIdByName(hostName string) (string, error)

func (*OceanStorClient) GetHostIscsiInitiators

func (c *OceanStorClient) GetHostIscsiInitiators(hostId string) ([]string, error)

func (*OceanStorClient) GetHostLunId

func (c *OceanStorClient) GetHostLunId(hostId, lunId string) (int, error)

func (*OceanStorClient) GetHostOnlineFCInitiators

func (c *OceanStorClient) GetHostOnlineFCInitiators(hostId string) ([]string, error)

func (*OceanStorClient) GetIniTargMap

func (c *OceanStorClient) GetIniTargMap(wwns []string) ([]string, map[string][]string, error)

func (*OceanStorClient) GetLunInfo

func (c *OceanStorClient) GetLunInfo(id string) (*Lun, error)

func (*OceanStorClient) GetOnlineFCInitiatorOnArray

func (c *OceanStorClient) GetOnlineFCInitiatorOnArray() ([]string, error)

func (*OceanStorClient) GetOnlineFreeWWNs

func (c *OceanStorClient) GetOnlineFreeWWNs() ([]string, error)

func (*OceanStorClient) GetPair

func (c *OceanStorClient) GetPair(id string) (*ReplicationPair, error)

func (*OceanStorClient) GetPerformance

func (c *OceanStorClient) GetPerformance(resId string, dataIdList []string) (map[string]string, error)

func (*OceanStorClient) GetPoolIdByName

func (c *OceanStorClient) GetPoolIdByName(poolName string) (string, error)

func (*OceanStorClient) GetSnapshot

func (c *OceanStorClient) GetSnapshot(id string) (*Snapshot, error)

func (*OceanStorClient) GetSnapshotByName

func (c *OceanStorClient) GetSnapshotByName(name string) (*Snapshot, error)

func (*OceanStorClient) GetVolume

func (c *OceanStorClient) GetVolume(id string) (*Lun, error)

func (*OceanStorClient) GetVolumeByName

func (c *OceanStorClient) GetVolumeByName(name string) (*Lun, error)

func (*OceanStorClient) IsArrayContainInitiator

func (c *OceanStorClient) IsArrayContainInitiator(initiatorName string) bool

func (*OceanStorClient) IsHostAssociatedToHostgroup

func (c *OceanStorClient) IsHostAssociatedToHostgroup(hostId string) (bool, error)

func (*OceanStorClient) IsHostContainInitiator

func (c *OceanStorClient) IsHostContainInitiator(hostId, initiatorName string) bool

func (*OceanStorClient) IsHostGroupContainHost

func (c *OceanStorClient) IsHostGroupContainHost(hostGrpId, hostId string) bool

func (*OceanStorClient) IsLunGroupContainLun

func (c *OceanStorClient) IsLunGroupContainLun(lunGrpId, lunId string) bool

func (*OceanStorClient) IsMappingViewContainHostGroup

func (c *OceanStorClient) IsMappingViewContainHostGroup(viewId, groupId string) bool

func (*OceanStorClient) IsMappingViewContainLunGroup

func (c *OceanStorClient) IsMappingViewContainLunGroup(viewId, groupId string) bool

func (*OceanStorClient) ListAllStoragePools

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

func (*OceanStorClient) ListControllers

func (c *OceanStorClient) ListControllers() ([]SimpleStruct, error)

func (*OceanStorClient) ListHostAssociateLuns

func (c *OceanStorClient) ListHostAssociateLuns(hostId string) (*HostAssociateLunsResp, error)

func (*OceanStorClient) ListRemoteDevices

func (c *OceanStorClient) ListRemoteDevices() (*[]RemoteDevice, error)

func (*OceanStorClient) ListStoragePools

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

func (*OceanStorClient) ListTgtPort

func (c *OceanStorClient) ListTgtPort() (*IscsiTgtPortsResp, error)

func (*OceanStorClient) RemoveHost

func (c *OceanStorClient) RemoveHost(hostId string) error

func (*OceanStorClient) RemoveHostFromHostGroup

func (c *OceanStorClient) RemoveHostFromHostGroup(hostGrpId, hostId string) error

func (*OceanStorClient) RemoveHostGroupFromMappingView

func (c *OceanStorClient) RemoveHostGroupFromMappingView(viewId, hostGrpId string) error

func (*OceanStorClient) RemoveIscsiFromHost

func (c *OceanStorClient) RemoveIscsiFromHost(initiator string) error

func (*OceanStorClient) RemoveLunFromLunGroup

func (c *OceanStorClient) RemoveLunFromLunGroup(lunGrpId, lunId string) error

func (*OceanStorClient) RemoveLunGroupFromMappingView

func (c *OceanStorClient) RemoveLunGroupFromMappingView(viewId, lunGrpId string) error

func (*OceanStorClient) SetPairSecondAccess

func (c *OceanStorClient) SetPairSecondAccess(id string, access string) error

func (*OceanStorClient) SplitPair

func (c *OceanStorClient) SplitPair(id string) error

func (*OceanStorClient) StartLunCopy

func (c *OceanStorClient) StartLunCopy(luncopyid string) error

func (*OceanStorClient) SwitchPair

func (c *OceanStorClient) SwitchPair(id string) error

func (*OceanStorClient) SyncPair

func (c *OceanStorClient) SyncPair(id string) error

type OceanStorConfig

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

type PairOperation

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

func NewPairOperation

func NewPairOperation(client *OceanStorClient) *PairOperation

func (*PairOperation) Create

func (p *PairOperation) Create(localLunId, rmtLunId, rmtDevId, rmtDevName,
	replicationMode, speed, period string) (*ReplicationPair, error)

func (*PairOperation) Delete

func (p *PairOperation) Delete(id string) error

func (*PairOperation) GetReplicationInfo

func (p *PairOperation) GetReplicationInfo(id string) (*ReplicationPair, error)

func (*PairOperation) ProtectSecond

func (p *PairOperation) ProtectSecond(id string) error

func (*PairOperation) Split

func (p *PairOperation) Split(id string) error

func (*PairOperation) Switch

func (p *PairOperation) Switch(id string) error

func (*PairOperation) Sync

func (p *PairOperation) Sync(id string) error

func (*PairOperation) UnprotectSecond

func (p *PairOperation) UnprotectSecond(id string) error

type Performance

type Performance struct {
	Uuid       string `json:"CMO_STATISTIC_UUID"`
	DataIdList string `json:"CMO_STATISTIC_DATA_ID_LIST"`
	DataList   string `json:"CMO_STATISTIC_DATA_LIST"`
	TimeStamp  string `json:"CMO_STATISTIC_TIMESTAMP"`
}

type PerformancesResp

type PerformancesResp struct {
	Data  []Performance `json:"data"`
	Error Error         `json:"error"`
}

type RemoteDevice

type RemoteDevice struct {
	Id            string `json:"ID"`
	Name          string `json:"NAME"`
	ArrayType     string `json:"ARRAYTYPE"`
	HealthStatus  string `json:"HEALTHSTATUS"`
	RunningStatus string `json:"RUNNINGSTATUS"`
	Wwn           string `json:"WWN"`
}

type RemoteDevicesResp

type RemoteDevicesResp struct {
	Data  []RemoteDevice `json:"data"`
	Error Error          `json:"error"`
}

type ReplicaCommonDriver

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

func NewReplicaCommonDriver

func NewReplicaCommonDriver(conf *OceanStorConfig, op *PairOperation) *ReplicaCommonDriver

func (*ReplicaCommonDriver) Enable

func (r *ReplicaCommonDriver) Enable(replicaId string, waitSyncComplete bool) error

func (*ReplicaCommonDriver) Failover

func (r *ReplicaCommonDriver) Failover(replicaId string) error

func (*ReplicaCommonDriver) ProtectSecond

func (r *ReplicaCommonDriver) ProtectSecond(replicaId string) error

func (*ReplicaCommonDriver) Split

func (r *ReplicaCommonDriver) Split(replicaId string) error

func (*ReplicaCommonDriver) Switch

func (r *ReplicaCommonDriver) Switch(replicaId string) error

func (*ReplicaCommonDriver) Sync

func (r *ReplicaCommonDriver) Sync(replicaId string, waitComplete bool) error

func (*ReplicaCommonDriver) UnprotectSecond

func (r *ReplicaCommonDriver) UnprotectSecond(replicaId string) error

func (*ReplicaCommonDriver) WaitExpectState

func (r *ReplicaCommonDriver) WaitExpectState(replicaId string, runningStatus, healthStatus []string) error

func (*ReplicaCommonDriver) WaitReplicaReady

func (r *ReplicaCommonDriver) WaitReplicaReady(replicaId string) error

func (*ReplicaCommonDriver) WaitSecondAccess

func (r *ReplicaCommonDriver) WaitSecondAccess(replicaId string, accessMode string)

type ReplicaPairMgr

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

func NewReplicaPairMgr

func NewReplicaPairMgr(conf *OceanStorConfig) (r *ReplicaPairMgr, err error)

func (*ReplicaPairMgr) CheckRemoteAvailable

func (r *ReplicaPairMgr) CheckRemoteAvailable() bool

func (*ReplicaPairMgr) CreateReplication

func (r *ReplicaPairMgr) CreateReplication(localLunId, rmtLunId, replicationMode string, replicaPeriod string) (map[string]string, error)

func (*ReplicaPairMgr) DeletePair

func (r *ReplicaPairMgr) DeletePair(id string) error

func (*ReplicaPairMgr) DeleteReplication

func (r *ReplicaPairMgr) DeleteReplication(pairId, rmtLunId string) error

func (*ReplicaPairMgr) Failback

func (r *ReplicaPairMgr) Failback(pairId string) error

func (*ReplicaPairMgr) Failover

func (r *ReplicaPairMgr) Failover(pairId string) error

func (*ReplicaPairMgr) GetRemoteDevInfo

func (r *ReplicaPairMgr) GetRemoteDevInfo() (id, name string)

func (*ReplicaPairMgr) TryGetRemoteDevByWwn

func (r *ReplicaPairMgr) TryGetRemoteDevByWwn(wwn string) *RemoteDevice

func (*ReplicaPairMgr) TryGetRemoteWwn

func (r *ReplicaPairMgr) TryGetRemoteWwn() string

func (*ReplicaPairMgr) WaitVolumeOnline

func (r *ReplicaPairMgr) WaitVolumeOnline(client *OceanStorClient, lun *Lun, interval, timeout time.Duration) error

type Replication

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

type ReplicationDriver

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

ReplicationDriver

func (*ReplicationDriver) CreateReplication

func (r *ReplicationDriver) CreateReplication(opt *pb.CreateReplicationOpts) (*model.ReplicationSpec, error)

CreateReplication

func (*ReplicationDriver) DeleteReplication

func (r *ReplicationDriver) DeleteReplication(opt *pb.DeleteReplicationOpts) error

func (*ReplicationDriver) DisableReplication

func (r *ReplicationDriver) DisableReplication(opt *pb.DisableReplicationOpts) error

func (*ReplicationDriver) EnableReplication

func (r *ReplicationDriver) EnableReplication(opt *pb.EnableReplicationOpts) error

func (*ReplicationDriver) FailoverReplication

func (r *ReplicationDriver) FailoverReplication(opt *pb.FailoverReplicationOpts) error

func (*ReplicationDriver) Setup

func (r *ReplicationDriver) Setup() (err error)

Setup

func (*ReplicationDriver) Unset

func (r *ReplicationDriver) Unset() error

Unset

type ReplicationPair

type ReplicationPair struct {
	Capacity            string `json:"CAPACITY"`
	CompressValid       string `json:"COMPRESSVALID"`
	EnableCompress      string `json:"ENABLECOMPRESS"`
	HealthStatus        string `json:"HEALTHSTATUS"`
	Id                  string `json:"ID"`
	IsDataSync          string `json:"ISDATASYNC"`
	IsInCg              string `json:"ISINCG"`
	IsPrimary           string `json:"ISPRIMARY"`
	IsRollback          string `json:"ISROLLBACK"`
	LocalResId          string `json:"LOCALRESID"`
	LocalResName        string `json:"LOCALRESNAME"`
	LocalResType        string `json:"LOCALRESTYPE"`
	PriResDataStatus    string `json:"PRIRESDATASTATUS"`
	RecoveryPolicy      string `json:"RECOVERYPOLICY"`
	RemoteDeviceId      string `json:"REMOTEDEVICEID"`
	RemoteDeviceName    string `json:"REMOTEDEVICENAME"`
	RemoteDeviceSn      string `json:"REMOTEDEVICESN"`
	RemoteResId         string `json:"REMOTERESID"`
	RemoteResName       string `json:"REMOTERESNAME"`
	ReplicationMode     string `json:"REPLICATIONMODEL"`
	ReplicationProgress string `json:"REPLICATIONPROGRESS"`
	RunningStatus       string `json:"RUNNINGSTATUS"`
	SecResAccess        string `json:"SECRESACCESS"`
	SecResDataStatus    string `json:"SECRESDATASTATUS"`
	Speed               string `json:"SPEED"`
	SynchronizeType     string `json:"SYNCHRONIZETYPE"`
	SyncLeftTime        string `json:"SYNCLEFTTIME"`
	TimeDifference      string `json:"TIMEDIFFERENCE"`
	RemTimeoutPeriod    string `json:"REMTIMEOUTPERIOD"`
	Type                string `json:"TYPE"`
}

type ReplicationPairResp

type ReplicationPairResp struct {
	Data  ReplicationPair `json:"data"`
	Error Error           `json:"error"`
}

type SimpleResp

type SimpleResp struct {
	Data  []SimpleStruct `json:"data"`
	Error Error          `json:"error"`
}

type SimpleStruct

type SimpleStruct struct {
	Id   string `json:"ID"`
	Name string `json:"NAME"`
}

type Snapshot

type Snapshot struct {
	CascadedLevel         string `json:"CASCADEDLEVEL"`
	CascadedNum           string `json:"CASCADEDNUM"`
	ConsumedCapacity      string `json:"CONSUMEDCAPACITY"`
	Description           string `json:"DESCRIPTION"`
	ExposedToInitiator    string `json:"EXPOSEDTOINITIATOR"`
	HealthStatus          string `json:"HEALTHSTATUS"`
	Id                    string `json:"ID"`
	IoClassId             string `json:"IOCLASSID"`
	IoPriority            string `json:"IOPRIORITY"`
	SourceLunCapacity     string `json:"SOURCELUNCAPACITY"`
	Name                  string `json:"NAME"`
	ParentId              string `json:"PARENTID"`
	ParentName            string `json:"PARENTNAME"`
	ParentType            int    `json:"PARENTTYPE"`
	RollBackendTime       string `json:"ROLLBACKENDTIME"`
	RollbackRate          string `json:"ROLLBACKRATE"`
	RollbackSpeed         string `json:"ROLLBACKSPEED"`
	RollbackStartTime     string `json:"ROLLBACKSTARTTIME"`
	RollbackTargetObjId   string `json:"ROLLBACKTARGETOBJID"`
	RollbackTargetObjName string `json:"ROLLBACKTARGETOBJNAME"`
	RunningStatus         string `json:"RUNNINGSTATUS"`
	SourceLunId           string `json:"SOURCELUNID"`
	SourceLunName         string `json:"SOURCELUNNAME"`
	SubType               string `json:"SUBTYPE"`
	TimeStamp             string `json:"TIMESTAMP"`
	Type                  int    `json:"TYPE"`
	UserCapacity          string `json:"USERCAPACITY"`
	WorkingController     string `json:"WORKINGCONTROLLER"`
	Wwn                   string `json:"WWN"`
	ReplicationCapacity   string `json:"replicationCapacity"`
}

type SnapshotResp

type SnapshotResp struct {
	Data  Snapshot `json:"data"`
	Error Error    `json:"error"`
}

type SnapshotsResp

type SnapshotsResp struct {
	Data  []Snapshot `json:"data"`
	Error 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 StoragePoolsResp

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

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 SystemResp

type SystemResp struct {
	Data  System `json:"data"`
	Error Error  `json:"error"`
}

Jump to

Keyboard shortcuts

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