dorado

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThickLuntype      = 0
	ThinLuntype       = 1
	MaxNameLength     = 31
	MaxVolDescription = 170
	PortNumPerContr   = 2
	PwdExpired        = 3
	PwdReset          = 4
)
View Source
const (
	ErrorConnectToServer      = -403
	ErrorUnauthorizedToServer = -401
)
View Source
const (
	MappingViewPrefix = "OpenSDS_MappingView_"
	LunGroupPrefix    = "OpenSDS_LunGroup_"
	HostGroupPrefix   = "OpenSDS_HostGroup_"
)
View Source
const (
	UnitGi = 1024 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

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"`
	Endpoints string `yaml:"endpoints,omitempty"`
	Insecure  bool   `yaml:"insecure,omitempty"`
}

type AuthResp

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

type DoradoClient

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

func NewClient

func NewClient(user, passwd string, endpoints []string, insecure bool) (*DoradoClient, error)

func (*DoradoClient) AddHostToHostGroup

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

func (*DoradoClient) AddHostWithCheck

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

func (*DoradoClient) AddInitiatorToArray

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

func (*DoradoClient) AddInitiatorToHost

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

func (*DoradoClient) AddInitiatorToHostWithCheck

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

func (*DoradoClient) AssocateHostGroupToMappingView

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

func (*DoradoClient) AssocateLunGroupToMappingView

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

func (*DoradoClient) AssociateHostToHostGroup

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

func (*DoradoClient) AssociateLunToLunGroup

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

func (*DoradoClient) CreateHostGroup

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

func (*DoradoClient) CreateHostGroupWithCheck

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

func (*DoradoClient) CreateLunGroup

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

func (*DoradoClient) CreateMappingView

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

func (*DoradoClient) CreateSnapshot

func (c *DoradoClient) CreateSnapshot(volId, name, desc string) (*Snapshot, error)

func (*DoradoClient) CreateVolume

func (c *DoradoClient) CreateVolume(name string, sectors int64, desc string) (*Lun, error)

func (*DoradoClient) DeleteHost

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

func (*DoradoClient) DeleteHostGroup

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

func (*DoradoClient) DeleteLunGroup

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

func (*DoradoClient) DeleteMappingView

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

func (*DoradoClient) DeleteSnapshot

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

func (*DoradoClient) DeleteVolume

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

func (*DoradoClient) Destroy

func (c *DoradoClient) Destroy() error

func (*DoradoClient) DoMapping

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

func (*DoradoClient) ExtendVolume added in v0.1.1

func (c *DoradoClient) ExtendVolume(capacity int64, id string) error

ExtendVolume ...

func (*DoradoClient) FindHostGroup

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

func (*DoradoClient) FindLunGroup

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

func (*DoradoClient) FindMappingView

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

func (*DoradoClient) GetHostIdByName

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

func (*DoradoClient) GetHostLunId

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

func (*DoradoClient) GetSnapshot

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

func (*DoradoClient) GetVolume

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

func (*DoradoClient) IsArrayContainInitiator

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

func (*DoradoClient) IsHostContainInitiator

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

func (*DoradoClient) IsHostGroupContainHost

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

func (*DoradoClient) IsLunGroupContainLun

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

func (*DoradoClient) IsMappingViewContainHostGroup

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

func (*DoradoClient) IsMappingViewContainLunGroup

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

func (*DoradoClient) ListHostAssociateLuns

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

func (*DoradoClient) ListStoragePools

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

func (*DoradoClient) ListTgtPort

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

func (*DoradoClient) RemoveHostFromHostGroup

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

func (*DoradoClient) RemoveHostGroupFromMappingView

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

func (*DoradoClient) RemoveIscsiFromHost

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

func (*DoradoClient) RemoveLunFromLunGroup

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

func (*DoradoClient) RemoveLunGroupFromMappingView

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

type DoradoConfig

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

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) DeleteSnapshot

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

func (*Driver) DeleteVolume

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

func (*Driver) ExtendVolume added in v0.1.1

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

ExtendVolume ...

func (*Driver) InitializeConnection

func (d *Driver) InitializeConnection(opt *pb.CreateAttachmentOpts) (*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() error

func (*Driver) TerminateConnection

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

func (*Driver) Unset

func (d *Driver) Unset() error

type Error

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

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"`
}

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 HttpError

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

func (*HttpError) Error

func (e *HttpError) Error() string

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 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 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"`
}

Jump to

Keyboard shortcuts

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