Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CopyVolume(ctx context.Context, poolName, originalVolumeName, newVolumeName string, ...) error
- func (c *Client) CreateExport(ctx context.Context, poolName, volumeName string, lunID int, ...) error
- func (c *Client) CreateVolume(ctx context.Context, poolName, volumeName string, sizeByte int) error
- func (c *Client) DestroyExport(ctx context.Context, poolName, volumeName, initiatorWWN string) error
- func (c *Client) DestroyVolume(ctx context.Context, poolName, volumeName string) error
- func (c *Client) GetPool(ctx context.Context, poolName string) (*Pool, error)
- func (c *Client) GetPoolList(ctx context.Context) ([]Pool, error)
- func (c *Client) GetVolume(ctx context.Context, poolName, volumeName string) (*Volume, error)
- func (c *Client) GetVolumeList(ctx context.Context, poolName string) ([]Volume, error)
- func (c *Client) ListExport(ctx context.Context) ([]Export, error)
- type ErrorResp
- type Export
- type Pool
- type Response
- type Volume
Constants ¶
View Source
const ( ErrCreateRequest = "failed to create request" ErrRequest = "failed to HTTP request" )
Error values
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { User string Password string URL *url.URL HTTPClient *http.Client Logger *log.Logger }
Client is client of go-targetd
func New ¶
func New(baseURL, username, password string, httpClient *http.Client, logger *log.Logger) (*Client, error)
New create go-targetd client
func (*Client) CopyVolume ¶
func (c *Client) CopyVolume(ctx context.Context, poolName, originalVolumeName, newVolumeName string, sizeByte int) error
CopyVolume copy a volume. you need to set zfs_enable_copy if use ZFS backend.
func (*Client) CreateExport ¶
func (c *Client) CreateExport(ctx context.Context, poolName, volumeName string, lunID int, initiatorWWN string) error
CreateExport create a export
func (*Client) CreateVolume ¶
CreateVolume create a volume
func (*Client) DestroyExport ¶
func (c *Client) DestroyExport(ctx context.Context, poolName, volumeName, initiatorWWN string) error
DestroyExport delete a export
func (*Client) DestroyVolume ¶
DestroyVolume delete a volume
func (*Client) GetPoolList ¶
GetPoolList retrieve list of volume pool
func (*Client) GetVolumeList ¶
GetVolumeList retrieve list of volume in pool
type Export ¶
type Export struct { InitiatorWwn string `json:"initiator_wwn"` LUN int `json:"lun"` VolName string `json:"vol_name"` Pool string `json:"pool"` VolUUID string `json:"vol_uuid"` VolSize int `json:"vol_size"` }
Export is volume export
type Pool ¶
type Pool struct { Name string `json:"name"` Size int64 `json:"size"` FreeSize int64 `json:"free_size"` Type string `json:"type"` UUID string `json:"uuid"` }
Pool is volume pool
Click to show internal directories.
Click to hide internal directories.