Documentation ¶
Index ¶
- Constants
- type CephClient
- func (cli *CephClient) Child(pool string) *CephClient
- func (cli *CephClient) Close() error
- func (cli *CephClient) CreateImage(name string, sizeMb int64) (*SImage, error)
- func (cli *CephClient) GetCapacity() (*SCapacity, error)
- func (cli *CephClient) GetImage(name string) (*SImage, error)
- func (cli *CephClient) ListImages() ([]string, error)
- func (cli *CephClient) Output(name string, opts []string) (jsonutils.JSONObject, error)
- func (cli *CephClient) SetTimeout(timeout int)
- func (cli *CephClient) ShowConf() error
- type SCapacity
- type SChildren
- type SImage
- func (img *SImage) Clone(ctx context.Context, pool, name string) (*SImage, error)
- func (img *SImage) CreateSnapshot(name string) (*SSnapshot, error)
- func (img *SImage) Delete() error
- func (img *SImage) Flatten() error
- func (img *SImage) GetInfo() (*SImageInfo, error)
- func (img *SImage) GetName() string
- func (img *SImage) GetSnapshot(name string) (*SSnapshot, error)
- func (img *SImage) IsSnapshotExist(name string) (bool, error)
- func (img *SImage) ListSnapshots() ([]SSnapshot, error)
- func (img *SImage) Remove() error
- func (img *SImage) Rename(name string) error
- func (img *SImage) Resize(sizeMb int64) error
- type SImageInfo
- type SSnapshot
- func (snap *SSnapshot) Clone(pool, name string, flattern bool) (*SImage, error)
- func (snap *SSnapshot) Delete() error
- func (snap *SSnapshot) GetName() string
- func (snap *SSnapshot) ListChildren() ([]SChildren, error)
- func (snap *SSnapshot) Remove() error
- func (snap *SSnapshot) Rollback() error
- func (snap *SSnapshot) Unprotect() error
Constants ¶
View Source
const DEFAULT_TIMTOUT_SECOND = 15
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CephClient ¶
type CephClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(monHost, key, pool string) (*CephClient, error)
func (*CephClient) Child ¶
func (cli *CephClient) Child(pool string) *CephClient
func (*CephClient) Close ¶
func (cli *CephClient) Close() error
func (*CephClient) CreateImage ¶
func (cli *CephClient) CreateImage(name string, sizeMb int64) (*SImage, error)
func (*CephClient) GetCapacity ¶
func (cli *CephClient) GetCapacity() (*SCapacity, error)
* {"kb_used":193408,"bytes_used":198049792,"percent_used":0.32,"bytes_used2":0,"percent_used2":0.00,"osd_max_used":0,"osd_max_used_ratio":0.32,"max_avail":61003137024,"objects":1,"origin_bytes":0,"compress_bytes":0} * {"stored":6198990973173,"objects":1734699,"kb_used":12132844593,"bytes_used":12424032862699,"percent_used":0.30800202488899231,"max_avail":13956734255104}
func (*CephClient) ListImages ¶
func (cli *CephClient) ListImages() ([]string, error)
func (*CephClient) Output ¶
func (cli *CephClient) Output(name string, opts []string) (jsonutils.JSONObject, error)
func (*CephClient) SetTimeout ¶
func (cli *CephClient) SetTimeout(timeout int)
func (*CephClient) ShowConf ¶
func (cli *CephClient) ShowConf() error
type SImage ¶
type SImage struct {
// contains filtered or unexported fields
}
func (*SImage) GetInfo ¶
func (img *SImage) GetInfo() (*SImageInfo, error)
func (*SImage) ListSnapshots ¶
type SImageInfo ¶
type SImageInfo struct { Name string `json:"name"` ID string `json:"id"` SizeByte int64 `json:"size"` Objects int `json:"objects"` Order int `json:"order"` ObjectSize int `json:"object_size"` SnapshotCount int `json:"snapshot_count"` BlockNamePrefix string `json:"block_name_prefix"` Format int `json:"format"` Features []string `json:"features"` OpFeatures []interface{} `json:"op_features"` Flags []interface{} `json:"flags"` CreateTimestamp time.Time `json:"create_timestamp"` AccessTimestamp time.Time `json:"access_timestamp"` ModifyTimestamp time.Time `json:"modify_timestamp"` }
Click to show internal directories.
Click to hide internal directories.