1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00
Files
glusterd2/pkg/api/snapshot_resp.go
Madhu Rajanna 305072d7f9 rename snapTime field to createAt in snapshot response
instead of returning the time as string,return
snapshot creation time as time.Time, the rest user
dont need to convert back to the time.Time if he
want to do any time conversion.

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-09-15 11:34:24 +05:30

64 lines
1.9 KiB
Go

package api
import (
"time"
"github.com/pborman/uuid"
)
// SnapInfo contains static information about the snapshot.
// Clients should NOT use this struct directly.
type SnapInfo struct {
VolInfo VolumeInfo `json:"snapinfo"`
ParentVolName string `json:"parentname"`
Description string `json:"description"`
CreatedAt time.Time `json:"created-at"`
}
//SnapList contains snapshots information of a volume.
type SnapList struct {
ParentName string `json:"parentname"`
SnapList []SnapInfo `json:"snaps"`
}
//LvsData gives the information provided in lvs command
type LvsData struct {
VgName string `json:"vgname"`
DataPercentage float32 `json:"datapercentage"`
LvSize string `json:"lvsize"`
PoolLV string `json:"pool-lv"`
}
//SnapBrickStatus contains information about a snap brick
type SnapBrickStatus struct {
Brick BrickStatus `json:"brick"`
LvData LvsData `json:"lvs-data"`
}
//SnapStatusResp contains snapshot status
type SnapStatusResp struct {
ParentName string `json:"parentname"`
SnapName string `json:"snaps"`
ID uuid.UUID `json:"id"`
BrickStatus []SnapBrickStatus `json:"snapbrickstatus"`
}
// SnapCreateResp is the response sent for a snapshot create request.
type SnapCreateResp SnapInfo
// SnapGetResp is the response sent for a snapshot get request.
type SnapGetResp SnapInfo
// SnapListResp is the response sent for a snapsht list request.
type SnapListResp []SnapList
// SnapshotActivateResp is the response sent for a snapshot activate request.
type SnapshotActivateResp SnapInfo
// SnapshotDeactivateResp is the response sent for a snapshot deactivate request.
type SnapshotDeactivateResp SnapInfo
// SnapshotCloneResp is the response sent for a snapshot clone request.
// Snapshot clone will create a regular volume
type SnapshotCloneResp VolumeInfo