Documentation ¶
Index ¶
- Constants
- Variables
- func CancelSnapshot(uuid, user, volumeName string) error
- func CreateClone(src, dest, user string, lazy bool) error
- func CreateSnapshot(volumeName, user, snapshotName string) error
- func DeleteSnapshot(uuid, volumeName, user string) error
- func Flatten(user, uuid string) error
- func GetCloneTaskNeedFlatten(r *pigeon.Request, volumeName, user string) ([]string, error)
- func Init(cfg map[string]string)
- type CreateSnapshotCloneResponse
- type GetCloneTasksResponse
- type GetSnapShotResponse
- type ListSnapshotInfo
- type SnapshotCloneResponse
- type SnapshotInfo
- type TaskInfo
Constants ¶
View Source
const ( ACTION_GET_CLONE_TASKS = "GetCloneTasks" ACTION_CLONE = "Clone" ACTION_FLATTEN = "Flatten" CLONE_STATUS_DONE = "done" CLONE_STATUS_CLONING = "cloning" CLONE_STATUS_RECOVERING = "recovering" CLONE_STATUS_CLEANING = "cleaning" CLONE_STATUS_ERROR_CLEANING = "errorCleaning" CLONE_STATUS_ERROR = "error" CLONE_STATUS_RETRYING = "retrying" CLONE_STATUS_METAINSTALLED = "metaInstalled" )
View Source
const ( SERVICE_ROUTER = "/SnapshotCloneService" SNAPSHOT_CLONE_VERSION = "0.0.6" ERROR_CODE_SUCCESS = "0" )
View Source
const ( ACTION_CREATE_SANPSHOT = "CreateSnapshot" ACTION_CANCEL_SNAPSHOT = "CancelSnapshot" ACTION_GET_SNAPSHOT_LIST = "GetFileSnapshotList" ACTION_DELETE_SNAPSHOT = "DeleteSnapshot" // snapshot status STATUS_DONE = "done" STATUS_IN_PROCESS = "inProcess" STATUS_DELETING = "deleting" STATUS_ERROR_DELETING = "errorDeleting" STATUS_CANCELING = "canceling" STATUS_ERROR = "error" STATUS_NOT_SUPPORT = "notSupport" LIST_SNAPSHOT_LIMIT = 100 )
View Source
const (
CURVEBS_SNAPSHOT_CLONE_PROXY_ADDRESS = "snapshot.clone.proxy.address"
)
Variables ¶
View Source
var (
GSnapshotCloneClient *snapshotCloneClient
)
Functions ¶
func CancelSnapshot ¶
func CreateClone ¶
func CreateSnapshot ¶
func DeleteSnapshot ¶
func GetCloneTaskNeedFlatten ¶
Types ¶
type GetCloneTasksResponse ¶
type GetSnapShotResponse ¶
type GetSnapShotResponse struct { Code string `json:"Code" binding:"required"` Message string `json:"Message" binding:"required"` RequestId string `json:"RequestId" binding:"required"` Snapshots []snapshot `json:"Snapshots"` TotalCount uint64 `json:"TotalCount"` }
struct received from snapshot clone server
type ListSnapshotInfo ¶
type ListSnapshotInfo struct { Total int `json:"total" binding:"required"` Info []SnapshotInfo `json:"info" binding:"required"` }
struct return to uplayer
func GetSnapshot ¶
func GetSnapshot(size, page uint32, uuid, user, fileName, status string) (ListSnapshotInfo, error)
type SnapshotCloneResponse ¶
type SnapshotInfo ¶
type SnapshotInfo struct { UUID string `json:"uuid" binding:"required"` User string `json:"user" binding:"required"` File string `json:"file" binding:"required"` Name string `json:"name" binding:"required"` SeqNum uint64 `json:"seqNum" binding:"required"` Ctime string `json:"time" binding:"required"` FileLength uint64 `json:"length" binding:"required"` Status string `json:"status" binding:"required"` Progress string `json:"Progress" binding:"required"` }
func GetAllSnapshot ¶
func GetAllSnapshot(user, fileName, status string) ([]SnapshotInfo, error)
type TaskInfo ¶
type TaskInfo struct { File string `json:"File"` FileType int `json:"FileType"` IsLazy bool `json:"IsLazy"` NextStep int `json:"NextStep"` Progress int `json:"Progress"` Src string `json:"Src"` TaskStatus int `json:"TaskStatus"` TaskType int `json:"TaskType"` Time uint64 `json:"Time"` UUID string `json:"UUID"` User string `json:"User"` }
Click to show internal directories.
Click to hide internal directories.