client

package
v0.0.0-...-52cd4e6 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package client provides fusion storage client

Index

Constants

View Source
const (

	// IPLock defines error code of ip lock
	IPLock = 1077949071
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowNfsShareAccessRequest

type AllowNfsShareAccessRequest struct {
	AccessName  string
	ShareId     string
	AccessValue int
	AllSquash   int
	RootSquash  int
	AccountId   string
}

AllowNfsShareAccessRequest used for AllowNfsShareAccess request

type Client

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

Client defines fusion storage client

func NewClient

func NewClient(ctx context.Context, clientConfig *NewClientConfig) *Client

NewClient used to init a new fusion storage client

func (*Client) AddLunToHost

func (cli *Client) AddLunToHost(ctx context.Context, lunName, hostName string) error

AddLunToHost usd to add lun to host

func (*Client) AddPortToHost

func (cli *Client) AddPortToHost(ctx context.Context, initiatorName, hostName string) error

AddPortToHost used add port to host

func (*Client) AllowNfsShareAccess

func (cli *Client) AllowNfsShareAccess(ctx context.Context, req *AllowNfsShareAccessRequest) error

AllowNfsShareAccess used for create nfs share client

func (*Client) AssociateConvergedQoSWithVolume

func (cli *Client) AssociateConvergedQoSWithVolume(ctx context.Context,
	req *types.AssociateConvergedQoSWithVolumeReq) error

AssociateConvergedQoSWithVolume used to add a converged QoS policy association

func (*Client) AssociateQoSWithVolume

func (cli *Client) AssociateQoSWithVolume(ctx context.Context, volName, qosName string) error

AssociateQoSWithVolume used to associate QoS with volume

func (*Client) AttachVolume

func (cli *Client) AttachVolume(ctx context.Context, name, ip string) error

AttachVolume attaches volume target ip

func (*Client) CreateConvergedQoS

func (cli *Client) CreateConvergedQoS(ctx context.Context, req *types.CreateConvergedQoSReq) (int, error)

CreateConvergedQoS used to create converged QoS

func (*Client) CreateFileSystem

func (cli *Client) CreateFileSystem(ctx context.Context, params map[string]interface{}) (map[string]interface{}, error)

CreateFileSystem used to create file system by params

func (*Client) CreateHost

func (cli *Client) CreateHost(ctx context.Context,
	hostName string,
	alua map[string]interface{}) error

CreateHost used to create host

func (*Client) CreateInitiator

func (cli *Client) CreateInitiator(ctx context.Context, name string) error

CreateInitiator used to create initiator by name

func (*Client) CreateNfsShare

func (cli *Client) CreateNfsShare(ctx context.Context, params map[string]interface{}) (map[string]interface{}, error)

CreateNfsShare used to create nfs share by params

func (*Client) CreateQoS

func (cli *Client) CreateQoS(ctx context.Context, qosName string, qosData map[string]int) error

CreateQoS used to create QoS

func (*Client) CreateQuota

func (cli *Client) CreateQuota(ctx context.Context, params map[string]interface{}) error

CreateQuota creates quota by params

func (*Client) CreateSnapshot

func (cli *Client) CreateSnapshot(ctx context.Context, snapshotName, volName string) error

CreateSnapshot creates volume snapshot

func (*Client) CreateVolume

func (cli *Client) CreateVolume(ctx context.Context, params map[string]interface{}) error

CreateVolume creates volume by params

func (*Client) CreateVolumeFromSnapshot

func (cli *Client) CreateVolumeFromSnapshot(ctx context.Context,
	volName string,
	volSize int64,
	snapshotName string) error

CreateVolumeFromSnapshot creates volume from snapshot

func (*Client) DeleteConvergedQoS

func (cli *Client) DeleteConvergedQoS(ctx context.Context, qosName string) error

DeleteConvergedQoS used to delete converged QoS by name

func (*Client) DeleteFileSystem

func (cli *Client) DeleteFileSystem(ctx context.Context, id string) error

DeleteFileSystem used to delete file system by id

func (*Client) DeleteLunFromHost

func (cli *Client) DeleteLunFromHost(ctx context.Context, lunName, hostName string) error

DeleteLunFromHost used to delete lun from host

func (*Client) DeleteNfsShare

func (cli *Client) DeleteNfsShare(ctx context.Context, id, accountId string) error

DeleteNfsShare used to delete nfs share by id

func (*Client) DeleteNfsShareAccess

func (cli *Client) DeleteNfsShareAccess(ctx context.Context, accessID string) error

DeleteNfsShareAccess used to delete nfs share access by id

func (*Client) DeleteQoS

func (cli *Client) DeleteQoS(ctx context.Context, qosName string) error

DeleteQoS used to delete QoS by name

func (*Client) DeleteQuota

func (cli *Client) DeleteQuota(ctx context.Context, quotaID string) error

DeleteQuota deletes quota by id

func (*Client) DeleteSnapshot

func (cli *Client) DeleteSnapshot(ctx context.Context, snapshotName string) error

DeleteSnapshot deletes volume snapshot

func (*Client) DeleteVolume

func (cli *Client) DeleteVolume(ctx context.Context, name string) error

DeleteVolume deletes volume by name

func (*Client) DetachVolume

func (cli *Client) DetachVolume(ctx context.Context, name, ip string) error

DetachVolume detaches volume from target ip

func (*Client) DisassociateConvergedQoSWithVolume

func (cli *Client) DisassociateConvergedQoSWithVolume(ctx context.Context, objectName string) error

DisassociateConvergedQoSWithVolume used to delete a converged QoS policy association

func (*Client) DisassociateQoSWithVolume

func (cli *Client) DisassociateQoSWithVolume(ctx context.Context, volName, qosName string) error

DisassociateQoSWithVolume used to disassociate QoS with volume

func (*Client) DuplicateClient

func (cli *Client) DuplicateClient() *Client

DuplicateClient used to duplicate client

func (*Client) ExtendVolume

func (cli *Client) ExtendVolume(ctx context.Context, lunName string, newCapacity int64) error

ExtendVolume extends volume capacity

func (*Client) GetAccountIdByName

func (cli *Client) GetAccountIdByName(ctx context.Context, accountName string) (string, error)

GetAccountIdByName gets account id by account name

func (*Client) GetAllAccounts

func (cli *Client) GetAllAccounts(ctx context.Context) ([]string, error)

GetAllAccounts gets all accounts

func (*Client) GetAllPools

func (cli *Client) GetAllPools(ctx context.Context) (map[string]interface{}, error)

GetAllPools gets all pools

func (*Client) GetAssociateCountOfQoS

func (cli *Client) GetAssociateCountOfQoS(ctx context.Context, qosName string) (int, error)

GetAssociateCountOfQoS used to get associate count of QoS

func (*Client) GetConvergedQoSNameByID

func (cli *Client) GetConvergedQoSNameByID(ctx context.Context, qosId int) (string, error)

GetConvergedQoSNameByID used to get qos name by id

func (*Client) GetFileSystemByName

func (cli *Client) GetFileSystemByName(ctx context.Context, name string) (map[string]interface{}, error)

GetFileSystemByName used to get file system by name

func (*Client) GetHostByName

func (cli *Client) GetHostByName(ctx context.Context, hostName string) (map[string]interface{}, error)

GetHostByName used to get host by name

func (*Client) GetHostLunId

func (cli *Client) GetHostLunId(ctx context.Context, hostName, lunName string) (string, error)

GetHostLunId gets host lun id of hostName

func (*Client) GetInitiatorByName

func (cli *Client) GetInitiatorByName(ctx context.Context, name string) (map[string]interface{}, error)

GetInitiatorByName used to get initiator by name

func (*Client) GetNFSServiceSetting

func (cli *Client) GetNFSServiceSetting(ctx context.Context) (map[string]bool, error)

GetNFSServiceSetting gets nfs service settings

func (*Client) GetNfsShareAccess

func (cli *Client) GetNfsShareAccess(ctx context.Context, shareID string) (map[string]interface{}, error)

GetNfsShareAccess used to get nfs share access by id

func (*Client) GetNfsShareByPath

func (cli *Client) GetNfsShareByPath(ctx context.Context, path, accountId string) (map[string]interface{}, error)

GetNfsShareByPath used to get nfs share by path

func (*Client) GetPoolById

func (cli *Client) GetPoolById(ctx context.Context, poolId int64) (map[string]interface{}, error)

GetPoolById gets pool by pool id

func (*Client) GetPoolByName

func (cli *Client) GetPoolByName(ctx context.Context, poolName string) (map[string]interface{}, error)

GetPoolByName gets pool by pool name

func (*Client) GetQoSNameByVolume

func (cli *Client) GetQoSNameByVolume(ctx context.Context, volName string) (string, error)

GetQoSNameByVolume used to get QoS name by volume name

func (*Client) GetQoSPolicyAssociationCount

func (cli *Client) GetQoSPolicyAssociationCount(ctx context.Context, qosPolicyId int) (int, error)

GetQoSPolicyAssociationCount used to get count of qos association

func (*Client) GetQoSPolicyIdByFsName

func (cli *Client) GetQoSPolicyIdByFsName(ctx context.Context, namespaceName string) (int, error)

GetQoSPolicyIdByFsName used to get qos id by fs name

func (*Client) GetQuotaByFileSystemById

func (cli *Client) GetQuotaByFileSystemById(ctx context.Context, fsID string) (map[string]interface{}, error)

GetQuotaByFileSystemById query quota info by file system id

func (*Client) GetQuotaByFileSystemName

func (cli *Client) GetQuotaByFileSystemName(ctx context.Context, fsName string) (map[string]interface{}, error)

GetQuotaByFileSystemName query quota info by file system name

func (*Client) GetSnapshotByName

func (cli *Client) GetSnapshotByName(ctx context.Context, snapshotName string) (map[string]interface{}, error)

GetSnapshotByName get snapshot by name

func (*Client) GetVolumeByName

func (cli *Client) GetVolumeByName(ctx context.Context, name string) (map[string]interface{}, error)

GetVolumeByName gets volume info by name

func (*Client) KeepAlive

func (cli *Client) KeepAlive(ctx context.Context)

KeepAlive used to keep connection token alive

func (*Client) Login

func (cli *Client) Login(ctx context.Context) error

Login try to login fusion storage by backend id

func (*Client) Logout

func (cli *Client) Logout(ctx context.Context)

Logout used to log out

func (*Client) Post

func (cli *Client) Post(ctx context.Context, url string, data map[string]interface{}) (map[string]interface{}, error)

Post used to send post request to storage client

func (*Client) QueryHostByPort

func (cli *Client) QueryHostByPort(ctx context.Context, port string) (string, error)

QueryHostByPort used query host by port

func (*Client) QueryHostOfVolume

func (cli *Client) QueryHostOfVolume(ctx context.Context, lunName string) ([]map[string]interface{}, error)

QueryHostOfVolume used to query host of volume

func (*Client) QueryIscsiPortal

func (cli *Client) QueryIscsiPortal(ctx context.Context) ([]map[string]interface{}, error)

QueryIscsiPortal used to query iscsi portal

func (*Client) SetAccountId

func (cli *Client) SetAccountId(ctx context.Context) error

SetAccountId used to set account id of the client

func (*Client) UpdateHost

func (cli *Client) UpdateHost(ctx context.Context, hostName string, alua map[string]interface{}) error

UpdateHost used to update host

func (*Client) UpdateQuota

func (cli *Client) UpdateQuota(ctx context.Context, params map[string]interface{}) error

UpdateQuota updates quota by params

func (*Client) ValidateLogin

func (cli *Client) ValidateLogin(ctx context.Context) error

ValidateLogin try to login fusion storage by secret

type NewClientConfig

type NewClientConfig struct {
	Url             string
	User            string
	SecretName      string
	SecretNamespace string
	ParallelNum     string
	BackendID       string
	AccountName     string
	UseCert         bool
	CertSecretMeta  string
}

NewClientConfig stores the information needed to create a new FusionStorage client

Jump to

Keyboard shortcuts

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