sfapi

package
v17.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReqID

func NewReqID() int

NewReqID generates a random id for a request

Types

type APIError

type APIError struct {
	ID    int `json:"id"`
	Error struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Name    string `json:"name"`
	} `json:"error"`
}

APIError wrapper

type Account

type Account struct {
	AccountID       int64       `json:"accountID,omitempty"`
	Username        string      `json:"username,omitempty"`
	Status          string      `json:"status,omitempty"`
	Volumes         []int64     `json:"volumes,omitempty"`
	InitiatorSecret string      `json:"initiatorSecret,omitempty"`
	TargetSecret    string      `json:"targetSecret,omitempty"`
	Attributes      interface{} `json:"attributes,omitempty"`
}

Account tbd

type AddAccountRequest

type AddAccountRequest struct {
	Username        string      `json:"username"`
	InitiatorSecret string      `json:"initiatorSecret,omitempty"`
	TargetSecret    string      `json:"targetSecret,omitempty"`
	Attributes      interface{} `json:"attributes,omitempty"`
}

AddAccountRequest tbd

type AddAccountResult

type AddAccountResult struct {
	ID     int `json:"id"`
	Result struct {
		AccountID int64 `json:"accountID"`
	} `json:"result"`
}

AddAccountResult tbd

type AddInitiatorsToVolumeAccessGroupRequest

type AddInitiatorsToVolumeAccessGroupRequest struct {
	Initiators []string `json:"initiators"`
	VAGID      int64    `json:"volumeAccessGroupID"`
}

AddInitiatorsToVolumeAccessGroupRequest tbd

type AddVolumesToVolumeAccessGroupRequest

type AddVolumesToVolumeAccessGroupRequest struct {
	VolumeAccessGroupID int64   `json:"volumeAccessGroupID"`
	Volumes             []int64 `json:"volumes"`
}

AddVolumesToVolumeAccessGroupRequest tbd

type Client

type Client struct {
	SVIP              string
	Endpoint          string
	DefaultAPIPort    int
	DefaultAccountID  int64
	DefaultTenantName string
	VolumeTypes       *[]VolType
	Config            *Config
	AccessGroups      []int64
	DefaultBlockSize  int64
}

Client is used to send API requests to a SolidFire system system

func NewFromParameters

func NewFromParameters(pendpoint string, psvip string, pcfg Config, pdefaultTenantName string) (c *Client, err error)

NewFromParameters is a factory method to create a new sfapi.Client object using the supplied parameters

func (*Client) AddAccount

func (c *Client) AddAccount(req *AddAccountRequest) (accountID int64, err error)

AddAccount tbd

func (*Client) AddInitiatorsToVolumeAccessGroup

func (c *Client) AddInitiatorsToVolumeAccessGroup(r *AddInitiatorsToVolumeAccessGroupRequest) error

AddInitiatorsToVolumeAccessGroup tbd

func (*Client) AddVolumesToAccessGroup

func (c *Client) AddVolumesToAccessGroup(req *AddVolumesToVolumeAccessGroupRequest) (err error)

AddVolumesToAccessGroup tbd

func (*Client) AttachVolume

func (c *Client) AttachVolume(v *Volume, iface string) (path, device string, err error)

AttachVolume tbd

func (*Client) CloneVolume added in v1.3.1

func (c *Client) CloneVolume(req *CloneVolumeRequest) (vol Volume, err error)

func (*Client) CreateSnapshot added in v1.3.1

func (c *Client) CreateSnapshot(req *CreateSnapshotRequest) (snapshot Snapshot, err error)

func (*Client) CreateVolume

func (c *Client) CreateVolume(createReq *CreateVolumeRequest) (vol Volume, err error)

CreateVolume tbd

func (*Client) CreateVolumeAccessGroup

func (c *Client) CreateVolumeAccessGroup(r *CreateVolumeAccessGroupRequest) (vagID int64, err error)

CreateVolumeAccessGroup tbd

func (*Client) DeleteRange

func (c *Client) DeleteRange(startID, endID int64)

DeleteRange tbd

func (*Client) DeleteSnapshot added in v1.3.1

func (c *Client) DeleteSnapshot(snapshotID int64) (err error)

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(volumeID int64) (err error)

DeleteVolume tbd

func (*Client) DetachVolume

func (c *Client) DetachVolume(v Volume) (err error)

DetachVolume tbd

func (*Client) GetAccountByID

func (c *Client) GetAccountByID(req *GetAccountByIDRequest) (account Account, err error)

GetAccountByID tbd

func (*Client) GetAccountByName

func (c *Client) GetAccountByName(req *GetAccountByNameRequest) (account Account, err error)

GetAccountByName tbd

func (*Client) GetClusterCapacity added in v1.3.1

func (c *Client) GetClusterCapacity() (capacity *ClusterCapacity, err error)

Get cluster capacity stats

func (*Client) GetClusterHardwareInfo

func (c *Client) GetClusterHardwareInfo() (*ClusterHardwareInfo, error)

Get cluster hardware info

func (*Client) GetSnapshot added in v1.3.1

func (c *Client) GetSnapshot(snapID, volID int64, sfName string) (s Snapshot, err error)

func (*Client) GetVolumeByID

func (c *Client) GetVolumeByID(volID int64) (v Volume, err error)

GetVolumeByID tbd

func (*Client) ListActiveVolumes

func (c *Client) ListActiveVolumes(listVolReq *ListActiveVolumesRequest) (volumes []Volume, err error)

ListActiveVolumes tbd

func (*Client) ListSnapshots added in v1.3.1

func (c *Client) ListSnapshots(req *ListSnapshotsRequest) (snapshots []Snapshot, err error)

func (*Client) ListVolumeAccessGroups

func (c *Client) ListVolumeAccessGroups(r *ListVolumeAccessGroupsRequest) (vags []VolumeAccessGroup, err error)

ListVolumeAccessGroups tbd

func (*Client) ListVolumesForAccount

func (c *Client) ListVolumesForAccount(listReq *ListVolumesForAccountRequest) (volumes []Volume, err error)

ListVolumesForAccount tbd

func (*Client) ModifyVolume

func (c *Client) ModifyVolume(req *ModifyVolumeRequest) (err error)

func (*Client) Request

func (c *Client) Request(method string, params interface{}, id int) (response []byte, err error)

Request performs a json-rpc POST to the configured endpoint

func (*Client) RollbackToSnapshot added in v1.3.1

func (c *Client) RollbackToSnapshot(req *RollbackToSnapshotRequest) (newSnapID int64, err error)

type CloneVolumeRequest added in v1.3.1

type CloneVolumeRequest struct {
	VolumeID     int64       `json:"volumeID"`
	Name         string      `json:"name"`
	NewAccountID int64       `json:"newAccountID"`
	NewSize      int64       `json:"newSize"`
	Access       string      `json:"access"`
	SnapshotID   int64       `json:"snapshotID"`
	Attributes   interface{} `json:"attributes"`
}

type CloneVolumeResult added in v1.3.1

type CloneVolumeResult struct {
	Id     int `json:"id"`
	Result struct {
		CloneID     int64 `json:"cloneID"`
		VolumeID    int64 `json:"volumeID"`
		AsyncHandle int64 `json:"asyncHandle"`
	} `json:"result"`
}

type ClusterCapacity added in v1.3.1

type ClusterCapacity struct {
	ActiveBlockSpace             int64  `json:"activeBlockSpace"`
	ActiveSessions               int64  `json:"activeSessions"`
	AverageIOPS                  int64  `json:"averageIOPS"`
	ClusterRecentIOSize          int64  `json:"clusterRecentIOSize"`
	CurrentIOPS                  int64  `json:"currentIOPS"`
	MaxIOPS                      int64  `json:"maxIOPS"`
	MaxOverProvisionableSpace    int64  `json:"maxOverProvisionableSpace"`
	MaxProvisionedSpace          int64  `json:"maxProvisionedSpace"`
	MaxUsedMetadataSpace         int64  `json:"maxUsedMetadataSpace"`
	MaxUsedSpace                 int64  `json:"maxUsedSpace"`
	NonZeroBlocks                int64  `json:"nonZeroBlocks"`
	PeakActiveSessions           int64  `json:"peakActiveSessions"`
	PeakIOPS                     int64  `json:"peakIOPS"`
	ProvisionedSpace             int64  `json:"provisionedSpace"`
	Timestamp                    string `json:"timestamp"`
	TotalOps                     int64  `json:"totalOps"`
	UniqueBlocks                 int64  `json:"uniqueBlocks"`
	UniqueBlocksUsedSpace        int64  `json:"uniqueBlocksUsedSpace"`
	UsedMetadataSpace            int64  `json:"usedMetadataSpace"`
	UsedMetadataSpaceInSnapshots int64  `json:"usedMetadataSpaceInSnapshots"`
	UsedSpace                    int64  `json:"usedSpace"`
	ZeroBlocks                   int64  `json:"zeroBlocks"`
}

type ClusterHardwareInfo

type ClusterHardwareInfo struct {
	Drives interface{} `json:"drives"`
	Nodes  interface{} `json:"nodes"`
}

type Config

type Config struct {
	TenantName       string
	EndPoint         string
	MountPoint       string
	SVIP             string
	InitiatorIFace   string //iface to use of iSCSI initiator
	Types            *[]VolType
	LegacyNamePrefix string
	AccessGroups     []int64
	DefaultBlockSize int64
}

Config holds the configuration data for the Client to communicate with a SolidFire storage system

type CreateSnapshotRequest added in v1.3.1

type CreateSnapshotRequest struct {
	VolumeID                int64       `json:"volumeID"`
	SnapshotID              int64       `json:"snapshotID"`
	Name                    string      `json:"name"`
	EnableRemoteReplication bool        `json:"enableRemoteReplication"`
	Retention               string      `json:"retention"`
	Attributes              interface{} `json:"attributes"`
}

type CreateSnapshotResult added in v1.3.1

type CreateSnapshotResult struct {
	Id     int `json:"id"`
	Result struct {
		SnapshotID int64  `json:"snapshotID"`
		Checksum   string `json:"checksum"`
	} `json:"result"`
}

type CreateVolumeAccessGroupRequest

type CreateVolumeAccessGroupRequest struct {
	Name       string   `json:"name"`
	Volumes    []int64  `json:"volumes,omitempty"`
	Initiators []string `json:"initiators,omitempty"`
}

CreateVolumeAccessGroupRequest tbd

type CreateVolumeAccessGroupResult

type CreateVolumeAccessGroupResult struct {
	ID     int `json:"id"`
	Result struct {
		VagID int64 `json:"volumeAccessGroupID"`
	} `json:"result"`
}

CreateVolumeAccessGroupResult tbd

type CreateVolumeRequest

type CreateVolumeRequest struct {
	Name       string      `json:"name"`
	AccountID  int64       `json:"accountID"`
	TotalSize  int64       `json:"totalSize"`
	Enable512e bool        `json:"enable512e"`
	Qos        QoS         `json:"qos,omitempty"`
	Attributes interface{} `json:"attributes"`
}

CreateVolumeRequest tbd

type CreateVolumeResult

type CreateVolumeResult struct {
	ID     int `json:"id"`
	Result struct {
		VolumeID int64 `json:"volumeID"`
	} `json:"result"`
}

CreateVolumeResult tbd

type DeleteSnapshotRequest added in v1.3.1

type DeleteSnapshotRequest struct {
	SnapshotID int64 `json:"snapshotID"`
}

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	VolumeID int64 `json:"volumeID"`
}

DeleteVolumeRequest tbd

type EmptyResponse

type EmptyResponse struct {
	ID     int `json:"id"`
	Result struct {
	} `json:"result"`
}

EmptyResponse tbd

type GetAccountByIDRequest

type GetAccountByIDRequest struct {
	AccountID int64 `json:"accountID"`
}

GetAccountByIDRequest tbd

type GetAccountByNameRequest

type GetAccountByNameRequest struct {
	Name string `json:"username"`
}

GetAccountByNameRequest tbd

type GetAccountResult

type GetAccountResult struct {
	ID     int `json:"id"`
	Result struct {
		Account Account `json:"account"`
	} `json:"result"`
}

GetAccountResult tbd

type GetClusterCapacityRequest added in v1.3.1

type GetClusterCapacityRequest struct {
}

type GetClusterCapacityResult added in v1.3.1

type GetClusterCapacityResult struct {
	Id     int `json:"id"`
	Result struct {
		ClusterCapacity ClusterCapacity `json:"clusterCapacity"`
	} `json:"result"`
}

type GetClusterHardwareInfoResult

type GetClusterHardwareInfoResult struct {
	Id     int `json:"id"`
	Result struct {
		ClusterHardwareInfo ClusterHardwareInfo `json:"clusterHardwareInfo"`
	} `json:"result"`
}

type ListActiveVolumesRequest

type ListActiveVolumesRequest struct {
	StartVolumeID int64 `json:"startVolumeID"`
	Limit         int64 `json:"limit"`
}

ListActiveVolumesRequest tbd

type ListSnapshotsRequest added in v1.3.1

type ListSnapshotsRequest struct {
	VolumeID int64 `json:"volumeID"`
}

type ListSnapshotsResult added in v1.3.1

type ListSnapshotsResult struct {
	ID     int `json:"id"`
	Result struct {
		Snapshots []Snapshot `json:"snapshots"`
	} `json:"result"`
}

type ListVolumeAccessGroupsRequest

type ListVolumeAccessGroupsRequest struct {
	StartVAGID int64 `json:"startVolumeAccessGroupID,omitempty"`
	Limit      int64 `json:"limit,omitempty"`
}

ListVolumeAccessGroupsRequest tbd

type ListVolumesAccessGroupsResult

type ListVolumesAccessGroupsResult struct {
	ID     int `json:"id"`
	Result struct {
		Vags []VolumeAccessGroup `json:"volumeAccessGroups"`
	} `json:"result"`
}

ListVolumesAccessGroupsResult tbd

type ListVolumesForAccountRequest

type ListVolumesForAccountRequest struct {
	AccountID int64 `json:"accountID"`
}

ListVolumesForAccountRequest tbd

type ListVolumesResult

type ListVolumesResult struct {
	ID     int `json:"id"`
	Result struct {
		Volumes []Volume `json:"volumes"`
	} `json:"result"`
}

ListVolumesResult tbd

type ModifyVolumeRequest

type ModifyVolumeRequest struct {
	VolumeID   int64       `json:"volumeID"`
	AccountID  int64       `json:"accountID,omitempty"`
	Access     string      `json:"access,omitempty"`
	Qos        QoS         `json:"qos,omitempty"`
	TotalSize  int64       `json:"totalSize,omitempty"`
	Attributes interface{} `json:"attributes,omitempty"`
}

type ModifyVolumeResult

type ModifyVolumeResult struct {
	Volume Volume `json:"volume,omitempty"`
	Curve  QoS    `json:"curve,omitempty"`
}

type QoS

type QoS struct {
	MinIOPS   int64 `json:"minIOPS,omitempty"`
	MaxIOPS   int64 `json:"maxIOPS,omitempty"`
	BurstIOPS int64 `json:"burstIOPS,omitempty"`
	BurstTime int64 `json:"-"`
}

QoS settings

type RollbackToSnapshotRequest added in v1.3.1

type RollbackToSnapshotRequest struct {
	VolumeID         int64       `json:"volumeID"`
	SnapshotID       int64       `json:"snapshotID"`
	SaveCurrentState bool        `json:"saveCurrentState"`
	Name             string      `json:"name"`
	Attributes       interface{} `json:"attributes"`
}

type RollbackToSnapshotResult added in v1.3.1

type RollbackToSnapshotResult struct {
	ID     int `json:"id"`
	Result struct {
		Checksum   string `json:"checksum"`
		SnapshotID int64  `json:"snapshotID"`
	} `json:"result"`
}

type Snapshot added in v1.3.1

type Snapshot struct {
	SnapshotID int64       `json:"snapshotID"`
	VolumeID   int64       `json:"volumeID"`
	Name       string      `json:"name"`
	Checksum   string      `json:"checksum"`
	Status     string      `json:"status"`
	TotalSize  int64       `json:"totalSize"`
	GroupID    int64       `json:"groupID"`
	CreateTime string      `json:"createTime"`
	Attributes interface{} `json:"attributes"`
}

type VolType

type VolType struct {
	Type string
	QOS  QoS
}

VolType holds quality of service configuration data

type Volume

type Volume struct {
	VolumeID           int64        `json:"volumeID"`
	Name               string       `json:"name"`
	AccountID          int64        `json:"accountID"`
	CreateTime         string       `json:"createTime"`
	Status             string       `json:"status"`
	Access             string       `json:"access"`
	Enable512e         bool         `json:"enable512e"`
	Iqn                string       `json:"iqn"`
	ScsiEUIDeviceID    string       `json:"scsiEUIDeviceID"`
	ScsiNAADeviceID    string       `json:"scsiNAADeviceID"`
	Qos                QoS          `json:"qos"`
	VolumeAccessGroups []int64      `json:"volumeAccessGroups"`
	VolumePairs        []VolumePair `json:"volumePairs"`
	DeleteTime         string       `json:"deleteTime"`
	PurgeTime          string       `json:"purgeTime"`
	SliceCount         int64        `json:"sliceCount"`
	TotalSize          int64        `json:"totalSize"`
	BlockSize          int64        `json:"blockSize"`
	VirtualVolumeID    string       `json:"virtualVolumeID"`
	Attributes         interface{}  `json:"attributes"`
}

Volume settings

type VolumeAccessGroup

type VolumeAccessGroup struct {
	Initiators     []string    `json:"initiators"`
	Attributes     interface{} `json:"attributes"`
	DeletedVolumes []int64     `json:"deletedVolumes"`
	Name           string      `json:"name"`
	VAGID          int64       `json:"volumeAccessGroupID"`
	Volumes        []int64     `json:"volumes"`
}

VolumeAccessGroup tbd

type VolumePair

type VolumePair struct {
	ClusterPairID    int64  `json:"clusterPairID"`
	RemoteVolumeID   int64  `json:"remoteVolumeID"`
	RemoteSliceID    int64  `json:"remoteSliceID"`
	RemoteVolumeName string `json:"remoteVolumeName"`
	VolumePairUUID   string `json:"volumePairUUID"`
}

VolumePair settings

Jump to

Keyboard shortcuts

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