webapi

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIpReachable added in v1.1.1

func CheckIpReachable(ip string, port int) bool

Types

type ConncetedSession

type ConncetedSession struct {
	Iqn string `json:"iqn"`
	Ip  string `json:"ip"`
}

type DSM

type DSM struct {
	Ip         string
	Port       int
	Username   string
	Password   string
	Sid        string
	Https      bool
	Controller string //new
}

func (*DSM) DsmInfoGet

func (dsm *DSM) DsmInfoGet() (*DsmInfo, error)

func (*DSM) DsmSystemInfoGet

func (dsm *DSM) DsmSystemInfoGet() (*DsmSysInfo, error)

func (*DSM) GetAnotherController added in v1.1.1

func (dsm *DSM) GetAnotherController() (*DSM, error)

func (*DSM) IsUC added in v1.1.1

func (dsm *DSM) IsUC() bool

func (*DSM) Login

func (dsm *DSM) Login() error

Login by given user name and password

func (*DSM) Logout

func (dsm *DSM) Logout() error

Logout on current IP and reset the synoToken

func (*DSM) LunClone

func (dsm *DSM) LunClone(spec LunCloneSpec) (string, error)

func (*DSM) LunCreate

func (dsm *DSM) LunCreate(spec LunCreateSpec) (string, error)

func (*DSM) LunDelete

func (dsm *DSM) LunDelete(lunUuid string) error

func (*DSM) LunGet

func (dsm *DSM) LunGet(uuid string) (LunInfo, error)

func (*DSM) LunList

func (dsm *DSM) LunList() ([]LunInfo, error)

func (*DSM) LunMapTarget

func (dsm *DSM) LunMapTarget(targetIds []string, lunUuid string) error

func (*DSM) LunUpdate

func (dsm *DSM) LunUpdate(spec LunUpdateSpec) error

func (*DSM) NetworkInterfaceList added in v1.1.1

func (dsm *DSM) NetworkInterfaceList(relayNode string) ([]NetworkInterface, error)

func (*DSM) SetShareQuota added in v1.1.0

func (dsm *DSM) SetShareQuota(shareInfo ShareInfo, newSizeInMB int64) error

func (*DSM) ShareClone added in v1.1.0

func (dsm *DSM) ShareClone(spec ShareCloneSpec) (string, error)

func (*DSM) ShareCreate

func (dsm *DSM) ShareCreate(spec ShareCreateSpec) error

func (*DSM) ShareDelete

func (dsm *DSM) ShareDelete(shareName string) error

func (*DSM) ShareGet added in v1.1.0

func (dsm *DSM) ShareGet(shareName string) (ShareInfo, error)

----------------------- Share APIs -----------------------

func (*DSM) ShareList

func (dsm *DSM) ShareList() ([]ShareInfo, error)

func (*DSM) SharePermissionList added in v1.1.0

func (dsm *DSM) SharePermissionList(shareName string, userGroupType string) ([]SharePermission, error)

func (*DSM) SharePermissionSet added in v1.1.0

func (dsm *DSM) SharePermissionSet(spec SharePermissionSetSpec) error

----------------------- Share Permission APIs -----------------------

func (*DSM) ShareSet added in v1.1.0

func (dsm *DSM) ShareSet(shareName string, updateInfo ShareUpdateInfo) error

func (*DSM) ShareSnapshotCreate added in v1.1.0

func (dsm *DSM) ShareSnapshotCreate(spec ShareSnapshotCreateSpec) (string, error)

----------------------- Share Snapshot APIs -----------------------

func (*DSM) ShareSnapshotDelete added in v1.1.0

func (dsm *DSM) ShareSnapshotDelete(snapTime string, shareName string) error

func (*DSM) ShareSnapshotList added in v1.1.0

func (dsm *DSM) ShareSnapshotList(name string) ([]ShareSnapshotInfo, error)

func (*DSM) SnapshotClone

func (dsm *DSM) SnapshotClone(spec SnapshotCloneSpec) (string, error)

func (*DSM) SnapshotCreate

func (dsm *DSM) SnapshotCreate(spec SnapshotCreateSpec) (string, error)

func (*DSM) SnapshotDelete

func (dsm *DSM) SnapshotDelete(snapshotUuid string) error

func (*DSM) SnapshotGet

func (dsm *DSM) SnapshotGet(snapshotUuid string) (SnapshotInfo, error)

func (*DSM) SnapshotList

func (dsm *DSM) SnapshotList(lunUuid string) ([]SnapshotInfo, error)

func (*DSM) TargetCreate

func (dsm *DSM) TargetCreate(spec TargetCreateSpec) (string, error)

func (*DSM) TargetDelete

func (dsm *DSM) TargetDelete(targetName string) error

func (*DSM) TargetGet

func (dsm *DSM) TargetGet(targetId string) (TargetInfo, error)

func (*DSM) TargetList

func (dsm *DSM) TargetList() ([]TargetInfo, error)

func (*DSM) TargetSet

func (dsm *DSM) TargetSet(targetId string, maxSession int) error

Enable muti session

func (*DSM) VolumeGet

func (dsm *DSM) VolumeGet(name string) (VolInfo, error)

func (*DSM) VolumeList

func (dsm *DSM) VolumeList() ([]VolInfo, error)

type DsmInfo

type DsmInfo struct {
	Hostname string `json:"hostname"`
}

type DsmSysInfo

type DsmSysInfo struct {
	Model       string `json:"model"`
	FirmwareVer string `json:"firmware_ver"`
	Serial      string `json:"serial"`
}

type LunCloneSpec

type LunCloneSpec struct {
	Name       string
	SrcLunUuid string
	Location   string
}

type LunCreateSpec

type LunCreateSpec struct {
	Name        string
	Description string
	Location    string
	Size        int64
	Type        string
	DevAttribs  []LunDevAttrib
}

type LunDevAttrib

type LunDevAttrib struct {
	DevAttrib string `json:"dev_attrib"`
	Enable    int    `json:"enable"`
}

type LunInfo

type LunInfo struct {
	Name             string `json:"name"`
	Uuid             string `json:"uuid"`
	LunType          int    `json:"type"`
	Location         string `json:"location"`
	Size             uint64 `json:"size"`
	Used             uint64 `json:"allocated_size"`
	Status           string `json:"status"`
	FlashcacheStatus string `json:"flashcache_status"`
	IsActionLocked   bool   `json:"is_action_locked"`
}

type LunUpdateSpec

type LunUpdateSpec struct {
	Uuid    string
	NewSize uint64
}

type MappedLun

type MappedLun struct {
	LunUuid      string `json:"lun_uuid"`
	MappingIndex int    `json:"mapping_index"`
}

type NetworkInterface added in v1.1.1

type NetworkInterface struct {
	Ifname  string `json:"ifname"`
	Ip      string `json:"ip"`
	Mask    string `json:"mask"`
	Speed   int    `json:"speed"`
	Status  string `json:"status"`
	Type    string `json:"type"`
	UseDhcp bool   `json:"use_dhcp"`
}

type NetworkPortal

type NetworkPortal struct {
	ControllerId  int    `json:"controller_id"`
	InterfaceName string `json:"interface_name"`
}

type Response

type Response struct {
	StatusCode int
	ErrorCode  int
	Success    bool
	Data       interface{}
}

type ShareCloneSpec added in v1.1.0

type ShareCloneSpec struct {
	Name      string
	Snapshot  string
	ShareInfo ShareInfo
}

type ShareCreateSpec

type ShareCreateSpec struct {
	Name      string
	ShareInfo ShareInfo
}

type ShareInfo

type ShareInfo struct {
	Name                string `json:"name"`     // required
	VolPath             string `json:"vol_path"` // required
	Desc                string `json:"desc"`
	EnableShareCow      bool   `json:"enable_share_cow"` // field for create
	EnableRecycleBin    bool   `json:"enable_recycle_bin"`
	RecycleBinAdminOnly bool   `json:"recycle_bin_admin_only"`
	Encryption          int    `json:"encryption"` // field for create
	QuotaForCreate      *int64 `json:"share_quota,omitempty"`
	QuotaValueInMB      int64  `json:"quota_value"`      // field for get
	SupportSnapshot     bool   `json:"support_snapshot"` // field for get
	Uuid                string `json:"uuid"`             // field for get
	NameOrg             string `json:"name_org"`         // required for clone
}

type SharePermission added in v1.1.0

type SharePermission struct {
	Name       string `json:"name"`
	IsReadonly bool   `json:"is_readonly"`
	IsWritable bool   `json:"is_writable"`
	IsDeny     bool   `json:"is_deny"`
	IsCustom   bool   `json:"is_custom,omitempty"`
	IsAdmin    bool   `json:"is_admin,omitempty"` // field for list
}

type SharePermissionSetSpec added in v1.1.0

type SharePermissionSetSpec struct {
	Name          string
	UserGroupType string // "local_user"/"local_group"/"system"
	Permissions   []*SharePermission
}

type ShareSnapshotCreateSpec added in v1.1.0

type ShareSnapshotCreateSpec struct {
	ShareName string
	Desc      string
	IsLocked  bool
}

type ShareSnapshotInfo added in v1.1.0

type ShareSnapshotInfo struct {
	Uuid             string `json:"ruuid"`
	Time             string `json:"time"`
	Desc             string `json:"desc"`
	SnapSize         string `json:"snap_size"` // the complete size of the snapshot
	Lock             bool   `json:"lock"`
	ScheduleSnapshot bool   `json:"schedule_snapshot"`
}

type ShareUpdateInfo added in v1.1.0

type ShareUpdateInfo struct {
	Name           string `json:"name"`     // required
	VolPath        string `json:"vol_path"` // required
	QuotaForCreate *int64 `json:"share_quota,omitempty"`
}

type SnapshotCloneSpec

type SnapshotCloneSpec struct {
	Name            string
	SrcLunUuid      string
	SrcSnapshotUuid string
}

type SnapshotCreateSpec

type SnapshotCreateSpec struct {
	Name        string
	LunUuid     string
	Description string
	TakenBy     string
	IsLocked    bool
}

type SnapshotInfo

type SnapshotInfo struct {
	Name       string `json:"name"`
	Uuid       string `json:"uuid"`
	ParentUuid string `json:"parent_uuid"`
	Status     string `json:"status"`
	TotalSize  int64  `json:"total_size"`
	CreateTime int64  `json:"create_time"`
	RootPath   string `json:"root_path"`
}

type TargetCreateSpec

type TargetCreateSpec struct {
	Name string
	Iqn  string
}

type TargetInfo

type TargetInfo struct {
	Name              string             `json:"name"`
	Iqn               string             `json:"iqn"`
	Status            string             `json:"status"`
	MaxSessions       int                `json:"max_sessions"`
	MappedLuns        []MappedLun        `json:"mapped_luns"`
	ConnectedSessions []ConncetedSession `json:"connected_sessions"`
	NetworkPortals    []NetworkPortal    `json:"network_portals"`
	TargetId          int                `json:"target_id"`
}

type VolInfo

type VolInfo struct {
	Name      string `json:"display_name"`
	Path      string `json:"volume_path"`
	Status    string `json:"status"`
	FsType    string `json:"fs_type"`
	Size      string `json:"size_total_byte"`
	Free      string `json:"size_free_byte"`
	Container string `json:"container"`
	Location  string `json:"location"`
}

Jump to

Keyboard shortcuts

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