go-ceph/cephfs/admin/volume_octopus.go
John Mulligan c362706640 cephfs admin: add "Similar To" doc comments
Removes some old reminder comments.
Adds doc comments with the keyword "Similar To" followed by block quoted
text that shows a cli command the function will behave similarly to.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-08-31 10:38:38 -04:00

39 lines
1015 B
Go

// +build octopus
package admin
// VolumePool reports on the pool status for a CephFS volume.
type VolumePool struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Available uint64 `json:"avail"`
Used uint64 `json:"used"`
}
// VolumeStatus reports various properties of a CephFS volume.
// TODO: Fill in.
type VolumeStatus struct {
MDSVersion string `json:"mds_version"`
Pools []VolumePool `json:"pools"`
}
func parseVolumeStatus(res []byte, status string, err error) (*VolumeStatus, error) {
var vs VolumeStatus
err = unmarshalResponseJSON(res, status, err, &vs)
return &vs, err
}
// VolumeStatus returns a VolumeStatus object for the given volume name.
//
// Similar To:
// ceph fs status cephfs <name>
func (fsa *FSAdmin) VolumeStatus(name string) (*VolumeStatus, error) {
r, s, err := fsa.marshalMgrCommand(map[string]string{
"fs": name,
"prefix": "fs status",
"format": "json",
})
return parseVolumeStatus(r, s, err)
}