Documentation ¶
Overview ¶
Package manager provides access to the QNAP Disk Management and iSCSI API (http://www.qnap.com).
More information is available on the project website: https://github.com/nine-lives-later/go-qnap-disk-manager/
Index ¶
- type ConfigOptions
- type ISCSITarget
- type LUN
- type LUNAllocateMode
- type QnapSession
- func (s *QnapSession) AssignLUN(lunIndex int, targetIndex int) error
- func (s *QnapSession) Close() error
- func (s *QnapSession) CreateBlockBasedLUN(storagePoolID int, name string, capacityGB int, allocateMode LUNAllocateMode, ...) (*LUN, error)
- func (s *QnapSession) DeleteLUN(lunID int) error
- func (s *QnapSession) GetISCSITargets() ([]*ISCSITarget, error)
- func (s *QnapSession) GetLUNByIndex(lunIndex int) (*LUN, error)
- func (s *QnapSession) GetLUNs() ([]*LUN, error)
- func (s *QnapSession) GetStoragePools() ([]*StoragePool, error)
- func (s *QnapSession) Login(username, password string) error
- func (s *QnapSession) Logout() error
- func (s *QnapSession) String() string
- func (s *QnapSession) WaitForLUNVolume(lunID int) (*LUN, error)
- type StoragePool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigOptions ¶
ConfigOptions contains some advanced settings on server communication.
type ISCSITarget ¶
type LUN ¶
type LUN struct { LUNIndex int `xml:"LUNIndex"` LUNName string `xml:"LUNName"` LUNPath string `xml:"LUNPath"` LUNStatus int `xml:"LUNStatus"` LUNThinAllocate bool `xml:"LUNThinAllocate"` LUNAttachedTarget int `xml:"LUNAttachedTarget"` LUNNumber int `xml:"LUNNumber"` LUNSerialNum string `xml:"LUNSerialNum"` LUNBackupStatus int `xml:"LUNBackupStatus"` IsSnap int `xml:"isSnap"` IsRemoving int `xml:"isRemoving"` BMap int `xml:"bMap"` CapacityBytes int64 `xml:"capacity_bytes"` VolumeBase string `xml:"VolumeBase"` WCEnable bool `xml:"WCEnable"` FUAEnable bool `xml:"FUAEnable"` LUNThresholdPercent int `xml:"LUNThreshold"` LUNNAA string `xml:"LUNNAA"` LUNSectorSize int `xml:"LUNSectorSize"` SsdCache string `xml:"ssd_cache"` PoolID int `xml:"poolID"` PoolVjbod bool `xml:"pool_vjbod"` VolumeID int `xml:"volno"` BlockSize int64 `xml:"block_size"` LUNTargetList struct { SingleRow *struct { TargetIndex int `xml:"targetIndex"` LUNNumber int `xml:"LUNNumber"` LUNEnable bool `xml:"LUNEnable"` } `xml:"row"` } `xml:"LUNTargetList"` LUNInitiatorList struct { LUNInitInfo []struct { InitiatorIndex int `xml:"initiatorIndex"` InitiatorIQN string `xml:"initiatorIQN"` AccessMode int `xml:"accessMode"` } `xml:"LUNInitInfo"` } `xml:"LUNInitList"` }
type LUNAllocateMode ¶
type LUNAllocateMode string
const ( LUNAllocateMode_Thin LUNAllocateMode = "1" LUNAllocateMode_Thick LUNAllocateMode = "0" )
type QnapSession ¶
type QnapSession struct {
// contains filtered or unexported fields
}
QnapSession is a container for our session state.
func Connect ¶
func Connect(host, username, password string, configOptions *ConfigOptions) (*QnapSession, error)
Connect sets up our connection to the QNAP system.
func (*QnapSession) AssignLUN ¶
func (s *QnapSession) AssignLUN(lunIndex int, targetIndex int) error
AssignLUN assigns an existing LUN to an existing iSCSI target
func (*QnapSession) Close ¶
func (s *QnapSession) Close() error
func (*QnapSession) CreateBlockBasedLUN ¶
func (s *QnapSession) CreateBlockBasedLUN(storagePoolID int, name string, capacityGB int, allocateMode LUNAllocateMode, useSSDCache bool, alertThresoldPercent int) (*LUN, error)
CreateBlockBasedLUN creates a new block-based volume inside a storage pool and returns the new LUN.
func (*QnapSession) DeleteLUN ¶
func (s *QnapSession) DeleteLUN(lunID int) error
DeleteLUN retrieves the a storage LUN by its LUN ID (not volume ID!)
func (*QnapSession) GetISCSITargets ¶
func (s *QnapSession) GetISCSITargets() ([]*ISCSITarget, error)
GetISCSITargets retrieves the list of all iSCSI targets.
func (*QnapSession) GetLUNByIndex ¶
func (s *QnapSession) GetLUNByIndex(lunIndex int) (*LUN, error)
GetLUNByIndex retrieves the a storage LUN by its LUN ID (not volume ID!)
func (*QnapSession) GetLUNs ¶
func (s *QnapSession) GetLUNs() ([]*LUN, error)
GetLUNs retrieves the list of all storage LUNs.
func (*QnapSession) GetStoragePools ¶
func (s *QnapSession) GetStoragePools() ([]*StoragePool, error)
GetStoragePools retrieves the list of storage pools.
func (*QnapSession) Login ¶
func (s *QnapSession) Login(username, password string) error
Login perform the authentication against the QNAP storage. Any existing session will be logged-out, first.
func (*QnapSession) String ¶
func (s *QnapSession) String() string
String returns the session's hostname.
func (*QnapSession) WaitForLUNVolume ¶
func (s *QnapSession) WaitForLUNVolume(lunID int) (*LUN, error)
WaitForLUNVolume waits for the volume of the LUN to become ready.
type StoragePool ¶
type StoragePool struct { PoolID int `xml:"poolID"` PoolTiering int `xml:"pool_tiering"` TierThinPool int `xml:"tier_thin_pool"` PoolVjbod int `xml:"pool_vjbod"` AllowSysVol int `xml:"allow_sys_vol"` PoolTr int `xml:"pool_tr"` SedPool int `xml:"sed_pool"` RemovingType int `xml:"removing_type"` PoolStatus int `xml:"pool_status"` PoolType int `xml:"pool_type"` PoolOverThreshold int `xml:"pool_over_threshold"` PoolFullType int `xml:"pool_full_type"` CapacityBytes int64 `xml:"capacity_bytes"` AllocatedBytes int64 `xml:"allocated_bytes"` FreesizeBytes int64 `xml:"freesize_bytes"` UnutilizedSpaceBytes int64 `xml:"unutilized_space_bytes"` MaxThickCreateSizeBytes int64 `xml:"max_thick_create_size_bytes"` TpReservedSizeBytes int64 `xml:"tp_reserved_size_bytes"` SnapshotReservedEnable int `xml:"snapshot_reserved_enable"` SnapshotReserved int `xml:"snapshot_reserved"` SetSnapshotReservedBytes int64 `xml:"set_snapshot_reserved_bytes"` RealFreesizeBytes int64 `xml:"real_freesize_bytes"` SnapshotBytes int64 `xml:"snapshot_bytes"` SnapshotReservedBytes int64 `xml:"snapshot_reserved_bytes"` PoolAllocatedNoSnapshotBytes int64 `xml:"pool_allocated_no_snapshot_bytes"` VolAllocating int `xml:"vol_allocating"` TieringProcessing int `xml:"tiering_processing"` RecoverFromReadDeleteKb int64 `xml:"recover_from_read_delete_kb"` OpTotalReserveSpaceKb int64 `xml:"op_total_reserve_space_kb"` PoolStripe int `xml:"pool_stripe"` IsTrRaid int `xml:"is_tr_raid"` VolRemove int `xml:"vol_remove"` }