Documentation ¶
Overview ¶
Please see https://github.com/heketi/heketi/wiki/API for documentation
Index ¶
- Constants
- Variables
- func BrickList(tx *bolt.Tx) ([]string, error)
- func ClusterList(tx *bolt.Tx) ([]string, error)
- func CreateBricks(db *bolt.DB, brick_entries []*BrickEntry) error
- func DestroyBricks(db *bolt.DB, brick_entries []*BrickEntry) error
- func DeviceList(tx *bolt.Tx) ([]string, error)
- func EntryDelete(tx *bolt.Tx, entry DbEntry, key string) error
- func EntryKeys(tx *bolt.Tx, bucket string) []string
- func EntryLoad(tx *bolt.Tx, entry DbEntry, key string) error
- func EntrySave(tx *bolt.Tx, entry DbEntry, key string) error
- func VolumeList(tx *bolt.Tx) ([]string, error)
- type AllocationList
- type App
- func (a *App) Close()
- func (a *App) ClusterCreate(w http.ResponseWriter, r *http.Request)
- func (a *App) ClusterDelete(w http.ResponseWriter, r *http.Request)
- func (a *App) ClusterInfo(w http.ResponseWriter, r *http.Request)
- func (a *App) ClusterList(w http.ResponseWriter, r *http.Request)
- func (a *App) DeviceAdd(w http.ResponseWriter, r *http.Request)
- func (a *App) DeviceDelete(w http.ResponseWriter, r *http.Request)
- func (a *App) DeviceInfo(w http.ResponseWriter, r *http.Request)
- func (a *App) Hello(w http.ResponseWriter, r *http.Request)
- func (a *App) NodeAdd(w http.ResponseWriter, r *http.Request)
- func (a *App) NodeDelete(w http.ResponseWriter, r *http.Request)
- func (a *App) NodeInfo(w http.ResponseWriter, r *http.Request)
- func (a *App) SetRoutes(router *mux.Router) error
- func (a *App) VolumeCreate(w http.ResponseWriter, r *http.Request)
- func (a *App) VolumeDelete(w http.ResponseWriter, r *http.Request)
- func (a *App) VolumeExpand(w http.ResponseWriter, r *http.Request)
- func (a *App) VolumeInfo(w http.ResponseWriter, r *http.Request)
- func (a *App) VolumeList(w http.ResponseWriter, r *http.Request)
- type BrickEntry
- func (b *BrickEntry) BucketName() string
- func (b *BrickEntry) Create(db *bolt.DB) error
- func (b *BrickEntry) Delete(tx *bolt.Tx) error
- func (b *BrickEntry) Destroy(db *bolt.DB) error
- func (b *BrickEntry) Id() string
- func (b *BrickEntry) Marshal() ([]byte, error)
- func (b *BrickEntry) NewInfoResponse(tx *bolt.Tx) (*BrickInfo, error)
- func (b *BrickEntry) Save(tx *bolt.Tx) error
- func (b *BrickEntry) SetId(id string)
- func (b *BrickEntry) Unmarshal(buffer []byte) error
- type BrickInfo
- type ClusterEntry
- func (c *ClusterEntry) BucketName() string
- func (c *ClusterEntry) Delete(tx *bolt.Tx) error
- func (c *ClusterEntry) Marshal() ([]byte, error)
- func (c *ClusterEntry) NewClusterInfoResponse(tx *bolt.Tx) (*ClusterInfoResponse, error)
- func (c *ClusterEntry) NodeAdd(id string)
- func (c *ClusterEntry) NodeDelete(id string)
- func (c *ClusterEntry) PeerNode(tx *bolt.Tx) (*NodeEntry, error)
- func (c *ClusterEntry) Save(tx *bolt.Tx) error
- func (c *ClusterEntry) Unmarshal(buffer []byte) error
- func (c *ClusterEntry) VolumeAdd(id string)
- func (c *ClusterEntry) VolumeDelete(id string)
- type ClusterInfoResponse
- type ClusterListResponse
- type ConfigFile
- type CreateType
- type DbEntry
- type Device
- type DeviceAddRequest
- type DeviceEntry
- func (d *DeviceEntry) BrickAdd(id string)
- func (d *DeviceEntry) BrickDelete(id string)
- func (d *DeviceEntry) BucketName() string
- func (d *DeviceEntry) Delete(tx *bolt.Tx) error
- func (d *DeviceEntry) Id() string
- func (d *DeviceEntry) IsDeleteOk() bool
- func (d *DeviceEntry) Marshal() ([]byte, error)
- func (d *DeviceEntry) NewInfoResponse(tx *bolt.Tx) (*DeviceInfoResponse, error)
- func (d *DeviceEntry) Save(tx *bolt.Tx) error
- func (d *DeviceEntry) SetId(id string)
- func (d *DeviceEntry) StorageAllocate(amount uint64)
- func (d *DeviceEntry) StorageCheck(amount uint64) bool
- func (d *DeviceEntry) StorageFree(amount uint64)
- func (d *DeviceEntry) StorageSet(amount uint64)
- func (d *DeviceEntry) Unmarshal(buffer []byte) error
- type DeviceInfo
- type DeviceInfoResponse
- type GlusterFSConfig
- type HostAddresses
- type NodeAddRequest
- type NodeEntry
- func (n *NodeEntry) BucketName() string
- func (n *NodeEntry) Delete(tx *bolt.Tx) error
- func (n *NodeEntry) DeviceAdd(id string)
- func (n *NodeEntry) DeviceDelete(id string)
- func (n *NodeEntry) IsDeleteOk() bool
- func (n *NodeEntry) ManageHostName() string
- func (n *NodeEntry) Marshal() ([]byte, error)
- func (n *NodeEntry) NewInfoReponse(tx *bolt.Tx) (*NodeInfoResponse, error)
- func (n *NodeEntry) Save(tx *bolt.Tx) error
- func (n *NodeEntry) StorageHostName() string
- func (n *NodeEntry) Unmarshal(buffer []byte) error
- type NodeInfo
- type NodeInfoResponse
- type StorageSize
- type VolumeCreateRequest
- type VolumeEntry
- func (v *VolumeEntry) BrickAdd(id string)
- func (v *VolumeEntry) BrickDelete(id string)
- func (v *VolumeEntry) BricksIds() sort.StringSlice
- func (v *VolumeEntry) BucketName() string
- func (v *VolumeEntry) Create(db *bolt.DB) (e error)
- func (v *VolumeEntry) Delete(tx *bolt.Tx) error
- func (v *VolumeEntry) Destroy(db *bolt.DB) error
- func (v *VolumeEntry) Expand(db *bolt.DB, sizeGB int) (e error)
- func (v *VolumeEntry) Marshal() ([]byte, error)
- func (v *VolumeEntry) NewInfoResponse(tx *bolt.Tx) (*VolumeInfoResponse, error)
- func (v *VolumeEntry) Save(tx *bolt.Tx) error
- func (v *VolumeEntry) Unmarshal(buffer []byte) error
- type VolumeExpandRequest
- type VolumeInfo
- type VolumeInfoResponse
- type VolumeListResponse
Constants ¶
View Source
const ( ASYNC_ROUTE = "/queue" BOLTDB_BUCKET_CLUSTER = "CLUSTER" BOLTDB_BUCKET_NODE = "NODE" BOLTDB_BUCKET_VOLUME = "VOLUME" BOLTDB_BUCKET_DEVICE = "DEVICE" BOLTDB_BUCKET_BRICK = "BRICK" )
View Source
const ( // Byte values in KB KB = 1 MB = KB * 1024 GB = MB * 1024 TB = GB * 1024 // Default values DEFAULT_REPLICA = 2 DEFAULT_THINP_SNAPSHOT_FACTOR = 1.5 // Default limits BRICK_MIN_SIZE = uint64(1 * GB) BRICK_MAX_SIZE = uint64(4 * TB) BRICK_MAX_NUM = 200 )
View Source
const (
VOLUME_CREATE_MAX_SNAPSHOT_FACTOR = 100
)
Variables ¶
View Source
var ( ErrNoSpace = errors.New("No space") ErrNotFound = errors.New("Id not found") ErrConflict = errors.New(http.StatusText(http.StatusConflict)) ErrMaxBricks = errors.New("Maximum number of bricks reached.") ErrMininumBrickSize = errors.New("Minimum brick size limit reached. Out of space.") ErrDbAccess = errors.New("Unable to access db") ErrAccessList = errors.New("Unable to access list") )
Functions ¶
func CreateBricks ¶
func CreateBricks(db *bolt.DB, brick_entries []*BrickEntry) error
func DestroyBricks ¶
func DestroyBricks(db *bolt.DB, brick_entries []*BrickEntry) error
Types ¶
type AllocationList ¶
type AllocationList struct {
// contains filtered or unexported fields
}
func NewAllocationList ¶
func NewAllocationList() *AllocationList
func (*AllocationList) Append ¶
func (a *AllocationList) Append(x string)
func (*AllocationList) IsEmpty ¶
func (a *AllocationList) IsEmpty() bool
func (*AllocationList) Pop ¶
func (a *AllocationList) Pop() (x string)
type App ¶
type App struct {
// contains filtered or unexported fields
}
func NewTestApp ¶
func (*App) ClusterCreate ¶
func (a *App) ClusterCreate(w http.ResponseWriter, r *http.Request)
func (*App) ClusterDelete ¶
func (a *App) ClusterDelete(w http.ResponseWriter, r *http.Request)
func (*App) ClusterInfo ¶
func (a *App) ClusterInfo(w http.ResponseWriter, r *http.Request)
func (*App) ClusterList ¶
func (a *App) ClusterList(w http.ResponseWriter, r *http.Request)
func (*App) DeviceDelete ¶
func (a *App) DeviceDelete(w http.ResponseWriter, r *http.Request)
func (*App) DeviceInfo ¶
func (a *App) DeviceInfo(w http.ResponseWriter, r *http.Request)
func (*App) NodeDelete ¶
func (a *App) NodeDelete(w http.ResponseWriter, r *http.Request)
func (*App) VolumeCreate ¶
func (a *App) VolumeCreate(w http.ResponseWriter, r *http.Request)
func (*App) VolumeDelete ¶
func (a *App) VolumeDelete(w http.ResponseWriter, r *http.Request)
func (*App) VolumeExpand ¶
func (a *App) VolumeExpand(w http.ResponseWriter, r *http.Request)
func (*App) VolumeInfo ¶
func (a *App) VolumeInfo(w http.ResponseWriter, r *http.Request)
func (*App) VolumeList ¶
func (a *App) VolumeList(w http.ResponseWriter, r *http.Request)
type BrickEntry ¶
type BrickEntry struct {
Info BrickInfo
}
func NewBrickEntry ¶
func NewBrickEntry(size uint64, deviceid, nodeid string) *BrickEntry
func NewBrickEntryFromId ¶
func NewBrickEntryFromId(tx *bolt.Tx, id string) (*BrickEntry, error)
func (*BrickEntry) BucketName ¶
func (b *BrickEntry) BucketName() string
func (*BrickEntry) Id ¶
func (b *BrickEntry) Id() string
func (*BrickEntry) Marshal ¶
func (b *BrickEntry) Marshal() ([]byte, error)
func (*BrickEntry) NewInfoResponse ¶
func (b *BrickEntry) NewInfoResponse(tx *bolt.Tx) (*BrickInfo, error)
func (*BrickEntry) SetId ¶
func (b *BrickEntry) SetId(id string)
func (*BrickEntry) Unmarshal ¶
func (b *BrickEntry) Unmarshal(buffer []byte) error
type BrickInfo ¶
type BrickInfo struct { Id string `json:"id"` Path string `json:"path"` DeviceId string `json:"device"` NodeId string `json:"node"` // Size in KB Size uint64 `json:"size"` }
Brick
type ClusterEntry ¶
type ClusterEntry struct {
Info ClusterInfoResponse
}
func NewClusterEntry ¶
func NewClusterEntry() *ClusterEntry
func NewClusterEntryFromId ¶
func NewClusterEntryFromId(tx *bolt.Tx, id string) (*ClusterEntry, error)
func NewClusterEntryFromRequest ¶
func NewClusterEntryFromRequest() *ClusterEntry
func (*ClusterEntry) BucketName ¶
func (c *ClusterEntry) BucketName() string
func (*ClusterEntry) Marshal ¶
func (c *ClusterEntry) Marshal() ([]byte, error)
func (*ClusterEntry) NewClusterInfoResponse ¶
func (c *ClusterEntry) NewClusterInfoResponse(tx *bolt.Tx) (*ClusterInfoResponse, error)
func (*ClusterEntry) NodeAdd ¶
func (c *ClusterEntry) NodeAdd(id string)
func (*ClusterEntry) NodeDelete ¶
func (c *ClusterEntry) NodeDelete(id string)
func (*ClusterEntry) Unmarshal ¶
func (c *ClusterEntry) Unmarshal(buffer []byte) error
func (*ClusterEntry) VolumeAdd ¶
func (c *ClusterEntry) VolumeAdd(id string)
func (*ClusterEntry) VolumeDelete ¶
func (c *ClusterEntry) VolumeDelete(id string)
type ClusterInfoResponse ¶
type ClusterInfoResponse struct { Id string `json:"id"` Nodes sort.StringSlice `json:"nodes"` Volumes sort.StringSlice `json:"volumes"` }
Cluster
type ClusterListResponse ¶
type ClusterListResponse struct {
Clusters []string `json:"clusters"`
}
type ConfigFile ¶
type ConfigFile struct {
GlusterFS GlusterFSConfig `json:"glusterfs"`
}
type DeviceAddRequest ¶
type DeviceEntry ¶
type DeviceEntry struct { Info DeviceInfo Bricks sort.StringSlice NodeId string }
func NewDeviceEntry ¶
func NewDeviceEntry() *DeviceEntry
func NewDeviceEntryFromId ¶
func NewDeviceEntryFromId(tx *bolt.Tx, id string) (*DeviceEntry, error)
func NewDeviceEntryFromRequest ¶
func NewDeviceEntryFromRequest(req *DeviceAddRequest) *DeviceEntry
func (*DeviceEntry) BrickAdd ¶
func (d *DeviceEntry) BrickAdd(id string)
func (*DeviceEntry) BrickDelete ¶
func (d *DeviceEntry) BrickDelete(id string)
func (*DeviceEntry) BucketName ¶
func (d *DeviceEntry) BucketName() string
func (*DeviceEntry) Id ¶
func (d *DeviceEntry) Id() string
func (*DeviceEntry) IsDeleteOk ¶
func (d *DeviceEntry) IsDeleteOk() bool
func (*DeviceEntry) Marshal ¶
func (d *DeviceEntry) Marshal() ([]byte, error)
func (*DeviceEntry) NewInfoResponse ¶
func (d *DeviceEntry) NewInfoResponse(tx *bolt.Tx) (*DeviceInfoResponse, error)
func (*DeviceEntry) SetId ¶
func (d *DeviceEntry) SetId(id string)
func (*DeviceEntry) StorageAllocate ¶
func (d *DeviceEntry) StorageAllocate(amount uint64)
func (*DeviceEntry) StorageCheck ¶
func (d *DeviceEntry) StorageCheck(amount uint64) bool
func (*DeviceEntry) StorageFree ¶
func (d *DeviceEntry) StorageFree(amount uint64)
func (*DeviceEntry) StorageSet ¶
func (d *DeviceEntry) StorageSet(amount uint64)
func (*DeviceEntry) Unmarshal ¶
func (d *DeviceEntry) Unmarshal(buffer []byte) error
type DeviceInfo ¶
type DeviceInfo struct { Device Storage StorageSize `json:"storage"` Id string `json:"id"` }
type DeviceInfoResponse ¶
type DeviceInfoResponse struct { DeviceInfo Bricks []BrickInfo `json:"bricks"` }
type GlusterFSConfig ¶
type HostAddresses ¶
type HostAddresses struct { Manage sort.StringSlice `json:"manage"` Storage sort.StringSlice `json:"storage"` }
type NodeAddRequest ¶
type NodeAddRequest struct { Zone int `json:"zone"` Hostnames HostAddresses `json:"hostnames"` ClusterId string `json:"cluster"` }
Node
type NodeEntry ¶
type NodeEntry struct { Info NodeInfo Devices sort.StringSlice }
func NewNodeEntry ¶
func NewNodeEntry() *NodeEntry
func NewNodeEntryFromRequest ¶
func NewNodeEntryFromRequest(req *NodeAddRequest) *NodeEntry
func (*NodeEntry) BucketName ¶
func (*NodeEntry) DeviceDelete ¶
func (*NodeEntry) IsDeleteOk ¶
func (*NodeEntry) ManageHostName ¶
func (*NodeEntry) NewInfoReponse ¶
func (n *NodeEntry) NewInfoReponse(tx *bolt.Tx) (*NodeInfoResponse, error)
func (*NodeEntry) StorageHostName ¶
type NodeInfo ¶
type NodeInfo struct { NodeAddRequest Id string `json:"id"` }
type NodeInfoResponse ¶
type NodeInfoResponse struct { NodeInfo DevicesInfo []DeviceInfoResponse `json:"devices"` }
type StorageSize ¶
type StorageSize struct { Total uint64 `json:"total"` Free uint64 `json:"free"` Used uint64 `json:"used"` }
Storage values in KB
type VolumeCreateRequest ¶
type VolumeCreateRequest struct { // Size in GB Size int `json:"size"` Clusters []string `json:"clusters,omitempty"` Name string `json:"name"` Replica int `json:"replica"` Snapshot struct { Enable bool `json:"enable"` Factor float32 `json:"factor"` } `json:"snapshot"` }
Volume
type VolumeEntry ¶
type VolumeEntry struct { Info VolumeInfo Bricks sort.StringSlice }
func NewVolumeEntry ¶
func NewVolumeEntry() *VolumeEntry
func NewVolumeEntryFromId ¶
func NewVolumeEntryFromId(tx *bolt.Tx, id string) (*VolumeEntry, error)
func NewVolumeEntryFromRequest ¶
func NewVolumeEntryFromRequest(req *VolumeCreateRequest) *VolumeEntry
func (*VolumeEntry) BrickAdd ¶
func (v *VolumeEntry) BrickAdd(id string)
func (*VolumeEntry) BrickDelete ¶
func (v *VolumeEntry) BrickDelete(id string)
func (*VolumeEntry) BricksIds ¶
func (v *VolumeEntry) BricksIds() sort.StringSlice
func (*VolumeEntry) BucketName ¶
func (v *VolumeEntry) BucketName() string
func (*VolumeEntry) Marshal ¶
func (v *VolumeEntry) Marshal() ([]byte, error)
func (*VolumeEntry) NewInfoResponse ¶
func (v *VolumeEntry) NewInfoResponse(tx *bolt.Tx) (*VolumeInfoResponse, error)
func (*VolumeEntry) Unmarshal ¶
func (v *VolumeEntry) Unmarshal(buffer []byte) error
type VolumeExpandRequest ¶
type VolumeExpandRequest struct {
Size int `json:"expand_size"`
}
type VolumeInfo ¶
type VolumeInfoResponse ¶
type VolumeInfoResponse struct { VolumeInfo Bricks []BrickInfo `json:"bricks"` }
func NewVolumeInfoResponse ¶
func NewVolumeInfoResponse() *VolumeInfoResponse
type VolumeListResponse ¶
type VolumeListResponse struct {
Volumes []string `json:"volumes"`
}
Click to show internal directories.
Click to hide internal directories.